Closed bizarrechaos closed 9 years ago
Hello all,
I corrected this issue by modifing the terminalMousewheel event in lib/termk-view.coffee file, as follows:
terminalMousewheel: (event) =>
deltaY = event.wheelDeltaY
#This line breaks things on OS X
#deltaY/120 is not needed for scrolling
#deltaY /= 120
deltaY *= -1
@terminal.scrollDisp(deltaY)
From what I can tell, the way that the delta Y values from the "mouse wheel" are being used is causing the problem. Depending on your operating system, the way in which this value is interpreted varies. If this is the case, the way this mouse event is handled needs to be universal.
Mozilla has some good documentation talking about these delta values - https://developer.mozilla.org/en-US/docs/Web/Events/mousewheel
This solution works for me as well, does it work for anyone else? I changed how scrolling was handled -- I pretty much looked how term.js does it, and converted it over to CoffeeScript.
terminalMousewheel: (event) =>
#This breaks everything :(
#deltaY = event.wheelDeltaY
#deltaY /= 120
#deltaY *= -1
#Works on OSX only?
#deltaY = event.wheelDeltaY
#deltaY *= -1
#Possible catch-all solution?
deltaY = event.wheelDeltaY
#Handle scrolling based on the event type
#Based on how term.js handles mouse scrolling
if event.type is 'DOMMouseScroll'
deltaY += if event.detail < 0 then -1 else 1
deltaY *= -1 #Correct scrolling direction
else
deltaY += if event.wheelDeltaY > 0 then -1 else 1
deltaY *= -1 #Correct scrolling direction
@terminal.scrollDisp(deltaY)
This has been reported as fixed. Closing, but reopen if it's not the case.
[Enter steps to reproduce below:]
Atom Version: 0.209.0 System: Mac OS X 10.8.5 Thrown From: Termrk package, v0.1.17
Stack Trace
Uncaught TypeError: Cannot read property '0' of undefined
Commands
Config
Installed Packages