Closed GhostValk closed 6 years ago
I've gone through the source and have been unable to figure it out. I thought I could do something like:
{
"profiles": [
{
"name": "Default profile",
"selected": true,
"simple_modifications": {
"caps_lock": "escape"
},
"fn_function_keys": {
// mac function stuff
},
"pointing_buttons": {
"button4": "left"
}
}
]
}
I feel like I'm on the right path but can't quite filter through the source to figure out where it should be (v0.90.46).
I'd love to know as well. I miss my "back" key on my mouse!
Mouse usage is key for me, i got Dashboard and Expose binded to lateral buttons of the mouse =/
Any update here?
I also want to know how to map a key to a mouse button click.
It would be good to have an answer from a dev, just to know if the mouse buttons can't currently be remapped or they can be but i'm not seeing the option :s
I'm also hoping that mapping of keys (e.g., R-command, R-option) to mouse keys (e.g., middle-click, right-click) will be added. That is critical for me. It worked great in the original Karabiner.
+1 on this. I used to have middle button mapped to left alt which in return through BetterTouchTools would help me drag windows easily. Hope a dev can chime in and shed some light.
+1. I understand tekezo is incredibly busy working on Karabiner, but I hope he finds some time to at least let us know if this is possible.
+1 from me too - its one of primary features of Karabiner for me. Thanks for any time / energy spent on this aspect! :)
i'm a curious party
I would love to be able to map button4 to cmd-[
+1
Now that MacOs provides capslock->control, the only reason to use Karabiner for me is to map left mouse button to left_control. A key issue.
I'd love to see this getting a higher priority, too. I can simulate Karabiner's other features with other software, or, my Ergodox EZ, but when it comes to my 6 button mouse, I'm out of luck so far. It's my main usage for Karabiner, along with my Trackball buttons.
Karabiner was - at least to my knowledge - the only app which could assign actions to all three different modes: click, double-click and hold.
I'd love to use this again:
Any news on this one? Simple mapping mouse buttons (3+) to keyboard or actions like previous/next space would be amazing. This was the only thing I used in original Karabiner.
I got tired of waiting for this, so I wrote Clicker, a little app with no user interface that translates presses/releases of a key to presses/releases of the left mouse button. I've tested it for two months on OS X 10.11 and macOS 10.12, and it works flawlessly, even for complex mouse dragging operations. The only downside is that it doesn't work when a password field is focused (a security limitation of the Event Tap library).
Note that this doesn't translate mouse button presses to key presses or actions (even though one could make it work based on similar code).
Feel free to use it and modify it until Karabiner-Elements supports keyboard key to mouse button mapping.
@tekezo Are you planning on implementing mouse button mapping support at some stage? Thanks!
My Google searches for how to use the scroll drag on my Logitech mouse on my MBP pointed me to karabiner Elements (which I already had installed). Bummer that it's not working. I miss my Magic Mouse, but between it and the Magic Keyboard, I had gotten tennis elbow.
still be waiting for it
I'd love to map [button4]/[button5] to [cmd]+<[eft_arrow]/[right_arrow], respectively.
@nawkwan @PayneJoe @timbitzen @LunaticoCR @piotr-tobolski @pattulus @jhimanka @graygilmore @GhostValk etc --
Looks like as of Karabiner Elements 11.0, this can work if you don't mind json hacking:
(Note: This is just a snippet of the JSON, not the entire thing.)
"complex_modifications": {
"parameters": {
"basic.to_if_alone_timeout_milliseconds": 1000
},
"rules": [
{
"manipulators": [
{
"description": "Swipe down to move left one space",
"from": {
"pointing_button": "button4",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "left_arrow",
"modifiers": [
"left_control"
]
}
],
"type": "basic"
},
{
"description": "Swipe up to move right one space",
"from": {
"pointing_button": "button5",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "right_arrow",
"modifiers": [
"left_control"
]
}
],
"type": "basic"
}
]
}
]
},
I titled them "swipe down" and "swipe up" because that's how I trigger button4/button5 on my Microsoft Sculpt Comfort Mouse, AND you'll want to change "left_control" to "left_command" in both of these, but the above works for me. HUZZAH!
...but the magic sauce, in both "complex" and simple rules, is to use "pointing_button" : "button4" to refer to button4, etc. These work if you put them in the JSON, but as far as I can tell, they don't work the same in the GUI (and show up as weird-looking entries there).
I think this function is cool !but it doesn't work in Karabiner-Element.
@jimmy-biznessapps Your json isn't working for me, but if I look in the log I see:
[2017-09-20 11:18:30.594] [info] [grabber] USB Optical Mouse (device_id:3) is ignored.
So It doesn't look like it's going to register any pointing events. Do you see your mouse under Devices? I only have my keyboard and the Apple Internal Keyboard / Trackpad.
I do see my mouse under "devices." So that's probably a prerequisite for this to work.
@jimmy-biznessapps thanks for that. Unfortunately I have the similar error as above:
[2017-09-20 10:46:23.334] [info] [grabber] Razer DeathAdder 2013 (device_id:4) is ignored.
Oddly enough the mouse does appear under "Devices" in the GUI and I'm able to modify some of its values in the JSON config (for example, setting "is_keyboard": false
on the mouse causes it to stop working entirely).
I'll have to return to this when I have a little more debugging time.
@nawkwan My device is also ignored in Karabiner. For now to map M4 and M5 to a keystroke I am using ControllerMate app (free) with a custom made program. (Sample ControllerMate programe: M4M5.cmate.zip)
Hello! From the Karabiner-Elements 11.1.8(11.2.0?) mouse was supported!
Mouse button modifications has been added.
Mouse buttons 4, 5 and 6 are now available. I also moved in my environment. I could assign Button 4 to "Back". Thank youβΊοΈ
{ "description": "button4 β [ + command", "from": { "pointing_button": "button4" }, "to": [ { "key_code": "close_bracket", "modifiers": [ "command" ] } ], "type": "basic" },
@hanamiche Where do you put that? It didn't work for me if I put it under "Simple Modifications". Under "Complex Modifications" doesn't seem to have that format.
@luispedrofonseca I think you need to pull down a beta build.
@LunaticoCR Thanks, but yes, I have the latest beta. I can assign a mouse button to a key (like backspace) but I can't add the modifiers.
@luispedrofonseca Hello. I put this file under "Complex Modifications". Could you please use the json file? my setting json file. The path is "~/.config/karabiner/assets/complex_modifications/mouse.json". (I'm using Japanese keyboard, so I may need to modify "key_code".)
I also made a screen shot of the setting screen.
I hope to go well.
@hanamiche That did it! Thanks for the explanation!
@luispedrofonseca Was good! Congratulations!!! π
Works great. Now I can change spaces by tilting mouse wheel π
@piotr-tobolski How did you reference the scrollwheel tilt input? I successfully got all my mouse buttons working, but after digging through the source code I still can't determine how to reference scrollwheel::LEFT and scrollwheel::RIGHT like in the previous version!
@ScottStevenson in my mouse (Logitech M325) tilting scrollwheel triggers mouse buttons 4 and 5. I am not using any 3rd party drivers or other software. I used Karabiner-EventViewer to check what events are triggered.
@piotr-tobolski Ah I see. I am using a Microsoft Sculpt mouse where tilting the scrollwheel outputs a "ScrollWheel" event in Karabiner-EventViewer with x and y coordinates/velocity.
After parsing through the source I am pretty sure this can't be referenced in the configuration at this time.
@jimmy-biznessapps @hanamiche The magic sauce of "pointing_button" didn't work for me. In fact, I've tried copying a slightly modified version (my_mouse.json) of hanamiche's mouse.json settings file under ~/.config/karabiner/assets/complex_modifications/mouse.json and it didn't map correctly. In fact, the rules didn't even show up under the Complex Modifications tab under KE's Preferences.
UPDATE: Please ignore these screenshots, they don't offer any insight. Instead, read about my new finings in my next reply.
@nawkwan Hello. I think that ignoring the mouse when looking at the log. Is karabiner-elements the latest beta version? Β (In my environment, it is 11.1.11) Forgive me if I am wrong.
@hanamiche Thank you very much, works great! Have been waiting for mouse feature forever!
@hanamiche Yes, I have updated to 11.1.11. The fact that the rules defined in your mouse.json don't even show up on the Complex Modifications tab suggests that something is wrong on my end. Since the last post, I've taken a closer look at the Log messages and compared it to the USB hardware on my MBP and have discovered where the conflict might be. But before I continue, I want to apologize for posting the previous screenshots of the Log and the Event Viewer, because they offer no insights.
This time around, I've disconnected all external USB devices from my MBP and restarted Karabiner-Elements. (The activities that occur starting from the arrow is when I first inserted the USB receiver for the mouse)
After KE started, I inserted the mouse USB Receiver directly into my MBP. Here you might be wondering why KE detected and registered ("grabbed") two USB receivers. Well, that's because I have two device entries with the same vendor_id and product_id for the two Logitech USB receivers -- one for the keyboard, and the other one for the mouse. (Please see lines 234 and 256 of my karabiner.json) This is probably causing some confusion for KE, because it's recognizing the receiver as both for the keyboard and the mouse.
Now, what I don't understand is why the VirtualHIDPointing device is being ignored.
Here's the Devices listing:
Additionally, there are a few things I'd like to ask about putting settings json files under ~/.config/karabiner/assets/complex_modifications:
Take your mouse.json for example: 1) Which profile(s) are the rules defined in mouse.json applied to when you stick it under the /complex_modifications directory?
2) A follow up to 1): When you just stick that mouse.json file under the /complex_modifications directory, how does KE know what type of device are the rules for? There's no device-related information in mouse.json; you only have rules in there.
Can someone who has pointing_buttons working please share their karabiner.json file?
@nawkwan Hello, thank you for the information. My device list is the same Logitech. Even in my environment "USB Receiver" is the only one. I have not used the Logitech keyboard, so I unchecked it.
It is necessary to enable json in ~/.config/karabiner/assets/complex_modifications from the GUI. It is merged into ~/.config/karabiner/karabiner.json and it becomes available. So I do not edit karabiner.json directly. You can activate it for each profile. (Will it be an answer to 1.?)
I will post the procedure. Karabiner-Elements Preferences -> Complex Modifications -> "Add rule"
Since the rule list of the json file placed in ~/.config/karabiner/assets/complex_modifications is displayed Please Enable All or Enable.
In the Enabled rules, the selected rule will be displayed and ready to use. (merged into ~/.config/karabiner/karabiner.json)
I uploaded the ~/.config/karabiner/karabiner.json as it might be useful.
(I occasionally have Japanese but do not mind.π)
I hope that it will work.
Hi @jimmy-biznessapps Do your json code have a modified function on the tilt and click of the scrollwheel on MS comfort sculpt mouse? If possible could you please share your json code with me/us?
Thank you
Anybody have any idea why my Logitech G5 is ignored by Karabiner? It's not in the device list.
[2017-11-06 10:23:42.999] [info] [grabber] USB Gaming Mouse (device_id:2) is ignored.
[update] finally works on 11.2.0
{
"description": "Mouse button4 β command+[",
"manipulators": [
{
"from": {
"pointing_button": "button4"
},
"to": [
{
"key_code": "open_bracket",
"modifiers": [
"command"
]
}
],
"conditions": [
{
"type": "frontmost_application_unless",
"bundle_identifiers": [
"^com\\.microsoft\\.rdc\\.osx"
]
}
],
"type": "basic"
}
]
}
@xbjconan -- nope, I'm leaving that as-is. Sorry I can't help.
Also, turns out my other two MS Sculpt Comfort mice send different codes for the blue button... :|
Can i remap Command + Left mouse click to Control + Left Arrow and Command + Right Mouse to Control + Right Arrow? Is something like this?
` "manipulators": [
{
"from": {
"pointing_button": "RIGHT",
"modifiers": {
"mandatory": [
"command"
],
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "right_arrow",
"modifiers": [
"control"
]
}
],
"type": "basic"
}
]`
For those who are looking to have the back button to their Microsoft Sculpt mouse on Mac 10.12 you can use the following configuration:
{
"manipulators": [
{
"description": "Mouse back",
"from": {
"pointing_button": "button4"
},
"to": [
{
"key_code": "left_arrow",
"modifiers": [
"left_command"
]
}
],
"type": "basic"
}
]
}
Inside /Users/YOURNAME/.config/karabiner/karabiner.json
Also, make sure that in the Karabiner preference you have checked Microsoft 2.4Ghz Transceiver v9.0 (Microsoft)
with the "mouse" icon in the type column.
Thanks very much for this thread, it helped me get my mouse4/5 buttons working as I like them. Karabiner seems to have some great functionality in this area. How do we "officially" share these excellent add ons?
Sorry if it's a bit obvious the answer, but, what are the keycodes for the mouse buttons? I've tried button1, button2, button3, etc. unsuccesfully (are already implemented?)