Open wedi opened 6 years ago
+1 bump bump, would love to see this added.
i have the same problem, but the point is understand what type of input is the "scroll_wheel", a keycode? a keyconsumercode? or a pointing buttom? Sorry for my english, is bad, but this can help everyone to solve the problem.
This would be an excellent addition.
eagerly waiting for this feature
It might help if more people upvoting this feature request would sponsor @tekezo ... ;)
+1
I noticed that 'scrollwheel functionality' is slated on the road map.
Maybe the following will be useful for someone: attached is Swift code I hobbled together today to make a tiny little 'scroll_to_left_right_arrows' CLI program. A user can launch such a program as part of a Karabiner Custom Command. I think this workaround can implement many of the use-cases for the requested feature (until such time as dev implements the feature).
What my "scroll_to_left_right_arrows" program does is [1] listen for scroll events, and convert them to left and right arrow keypresses (a more sophisticated version would actually throttle according to the deltaY values, but I hacked this together in a couple hours, so I didn't bother) [2] as soon as the user creates any keypress or click, the program exits (which, if anyone edits my program,they should be mindful of, since without exiting, you won't be able to operate any thing at all except left and right arrow! At one point today I absent-mindedly made a version that didn't exit, and had to reboot my Mac!).
My Complex Karabiner command to start it up looks like this (when the user presses F16, Karabiner presses Fn F2 to select the Apple Menu, and then runs my helper tool so the user can scroll left or right through the Menu bar)
{ "description": "F16 ➞ Menu", "manipulators": [ { "type": "basic", "from": { "key_code": "f16" }, "to": [ { "key_code": "f2", "modifiers": ["control"] }, { "key_code": "down_arrow", "repeat": false } ], "to_after_key_up": [ { "shell_command": "~/bin/scroll_to_left_right_arrows" } ] } ] }
This sounds very good!
How can I use it inside a complex modification?
I can't run your script in terminal to test it: 'import: command not found' among other errors :(
I can't run your script in terminal to test it: 'import: command not found' among other errors :(
It's a Swift code, not shell script. So, you will have to compile it first. After that, use the executable you got.
How can I use it inside a complex modification?
There is an example in the post you quoted. ~/bin/scroll_to_left_right_arrows
is the executable. Your path may differ depending on where you compile it, or put the executable.
I can't run your script in terminal to test it: 'import: command not found' among other errors :(
It's a Swift code, not shell script. So, you will have to compile it first. After that, use the executable you got.
How can I use it inside a complex modification?
There is an example in the post you quoted.
~/bin/scroll_to_left_right_arrows
is the executable. Your path may differ depending on where you compile it, or put the executable.
Hi Muhammed, thanks for the answer.
I tried to compile the script in Terminal (version of Swift 5.1.3, but I get this error:
`main.swift:118:84: error: the compiler is unable to type-check this expression in reasonable time; try breaking up the expression into distinct sub-expressions = (1 << 1) | (1 << 3) | (1 << 6) | (1 << 7) | (1 << 10) | (1 << 22) | (1 << 25) | (1 << 27)
`
Maybe is there a typo in the script?
Best!
Try splitting that line:
// Split the expression due to compilation error.
let _mask1: UInt32 = (1 << 1) | (1 << 3) | (1 << 6)
let _mask2: UInt32 = _mask1 | (1 << 7) | (1 << 10)
let mask: UInt32 = _mask2 | (1 << 22) | (1 << 25) | (1 << 27)
🙏
+1
need both scroll wheels func (mx master 3) ready to donate
need both scroll wheels func (mx master 3) ready to donate – @deadElk
There is this old saying: Actions speak louder than words.
could show
Maybe that helps supporting this issue. I'd be very happy. 😃
@radman0x and anyone wanting to zoom with ctrl+scroll I modified the swift code provided by @uniqueidentifier to do that.
main.swift.txt
Compile it with: swiftc main.swift -o scrollzoom
I don't know swift so it's a hack based on a hack, use at your own risk!
Based on @alexDevBR and @uniqueidentifier 's code I've added keyboard layout independency (original code worked only with US layout), changed the control key to command key and fixed a bug (the scroll delta value for my mouse was 0 in idle state, and the delta_y > 0 wasn't enough for deciding on zoom direction)
Uploaded the fresh code here: https://gist.github.com/BalazsGyarmati/e199080a9e47733870889626609d34c5
You can change the zoom direction by changing < and > signs to the other one here: https://gist.github.com/BalazsGyarmati/e199080a9e47733870889626609d34c5#file-scroll_to_plusminus_macos-swift-L172
@BalazsGyarmati @alexDevBR Did you use a karabiner command? I set the executable to start at login and it worked great.
Edit: maybe not, I can't tell if it keeps running or not.
This seems to be the most active issue on adding scroll wheel event support, so I thought it would be worth mentioning here that the roadmap aka TASKS.md was updated in August 2023 to include "[ ] Add scroll wheel to source events." I'm optimistic that this means we'll see support for scroll wheel events relatively soon.
In the mean time, I've found a simple open source app called LinearMouse that is able to handle rebinding scroll wheel events to virtual keyboard events. It coexists just fine with Karabiner.
Hi, I got into the habbit using ctrl + left/right scroll to switch desktops. Unfortunately, I still haven't found a way to achieve this with Karabiner Elements.
Does anyone know a way to make this work? I am looking for a way to react to horizontal ScrollWheel events. As to-event this is documented but unfortunately I haven't found anything about a correspondig from-event.
Thank you!
Related Issues: https://github.com/tekezo/Karabiner-Elements/issues/261#issuecomment-339164627, #579, #1066, #1113, https://github.com/tekezo/Karabiner/issues/814
In the old days it used to work this way:
1066 describes exactly how this was achieved earlier: