Karabiner-elements: Multiple key strokes as one

Created on 16 Sep 2016  ·  157Comments  ·  Source: pqrs-org/Karabiner-Elements

Anyway that we could use karabiner-elements to simulate a combo of "cmd+opt+ctrl" using "Caps Lock"?

Most helpful comment

Yeah, I'd like something similar.

I want to remap the Caps Lock to 'Shift-Command-Option-Control' to get my 'Hyper Key' back.

All 157 comments

Yeah, I'd like something similar.

I want to remap the Caps Lock to 'Shift-Command-Option-Control' to get my 'Hyper Key' back.

@jonohunt I definitely second this one. I'm sooooo missing my Hyper key on 10.11.

Looking forward to Hyper key support again :)

Yeah. I miss Forward Delete key from simultaneous + & backspace ;)
What do you use the Hyper Key for?

@niieani I use hyper key with HammerSpoon.

My Capslock is mapped to ctrl.
Ctrl is mapped to hyper key.

I press Hyper key with different combinations to launch Hammerspoon actions.

Say Hyper+s to put system to sleep.
Hyper+a+<key> to launch applications. (<key> from this list)

I just donated to this very worthy project. It seems Karabiner-Elements is, for the moment, limited to swapping two keys, whereas the syntax from the old Karabiner would allow for much more complex substitutions. Here's to hoping this functionality will be restored post haste, in any form.

Anyone can contribute a simple version of 'Hyper Key'? This is the only function that I need...to active my Alfred basically.

Based on karabiner-elements, there’s no examples on hyper key functions. Just simple key swapping which is the same as what macOS provides.

On Sep 21, 2016, at 16:59, Aether [email protected] wrote:

Anyone can contribute a simple version of 'Hyper Key'? This is the only function that I need...to active my Alfred basically.


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub https://github.com/tekezo/Karabiner-Elements/issues/16#issuecomment-248552414, or mute the thread https://github.com/notifications/unsubscribe-auth/ADKNgkHn7GAVQquPU_zP3cqCYRf1R38sks5qsPHugaJpZM4J-nDt.

Big +1 for this, main reason I used Seil/Karabiner was to remap capslock -> cmd+space to trigger Alfred

I hope this gets implemented soon. I used several custom fn+cmd+ mappings and my muscle memory is driving me crazy after updating one of my machines to sierra...

As a workaround I am using karabiner-elements to map caps to right control, since all of my hyper binds are setup in https://github.com/koekeishiya/kwm . Right control support hasn't been added yet, so you can use a different modifier that you don't use, or use my fork https://github.com/matthewdias/kwm/tree/rightcontrol?files=1 for right or left control.

Also: keep an eye on https://github.com/koekeishiya/khd as binds are being moved out into that repo.

Has anyone rooted around in the source to see if there's more advanced syntax that's just not included in the examples? I really don't want to buy something like "Keyboard Maestro" but I'm really stuck!

@prohtex Yes, I had a look last week and there wasn't. I think Keyboard Maestro has quite a generous trial period, and changes are being made to Karabiner Elements very quickly, so perhaps you won't need to buy a license for Keyboard Maestro before Karabiner Elements has the functionality you need.

Well, after a good deal of work, neither Keyboard Maestro nor Hammerspoon seem to work from the lock screen (not the login screen, the lock screen that appears after the screensaver is triggered) and so are not useful for my application. I guess karabiner-elements is the only hope.

Would definitely love to vote for this. Losing access to my Hyper key due to Seil+Karabiner not working with macOS Sierra has definitely been the sour part of my day. At the same point, thank you very much for your efforts to work on this for the community. Wish Apple would just give us access to a key mapper in the OS by default.

I have created a Keyboard Maestro Macro Library that approximates the Hyper Key if based off F19 remap.

{
    "profiles": [
        {
            "name": "Default profile",
            "selected": true,
            "simple_modifications": {
                "caps_lock": "left_control",
                "left_control": "f19"
            }
        }
    ]
} 

There are a couple of things though

  • You have to release Left Control (F19) or whatever you mapped between each keystroke
  • There is a mode notification that Keyboard Maestro displays
  • Not every key has been created. Currently:

A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, Grave, Minus, Equal, LeftBracket, RightBracket, Semicolon, Quote, Comma, Period, Slash, Backslash, Space, Return, Tab, Delete, ForwardDelete, Linefeed ?, Escape, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, LeftArrow, RightArrow, DownArrow, UpArrow

Key Code Reference

F19 Macros.zip

I'd love any comments or enhancements. I hope this helps some of you.

@warthurton though it's annoying to have to release between each keystroke, this is at least getting me SOME sanity back with Slate.

Thank you!

When this feature will be added? Is there are any estimations for that?

@warthurton @birarda it seems Better Touch Tool has a similar functionality if you use the key sequence option instead of shortcuts. I found it to be too annoying to bother with. Having to release between each keystroke is a huge nuisance, it's a shame Apple gimped the original Karabiner/Seil, but I'm looking forward to Karabiner-Elements progressing in the future. I really miss having a hyper key in Caps Lock T'_T;.

EDIT: Thanks to the combined efforts of @lodestone @prenagha @dalemanthei (https://gist.github.com/ttscoff/cce98a711b5476166792d5e6f1ac5907#gistcomment-1886969) @ttscoff, I've got my caps lock hyper key back in macOS Sierra!! Thanks everyone! Also, Hammerspoon is hella sick! Learning LUA lately to interface with Renoise and Pico-8, so having another LUA powered tool in my arsenal is really great fun.

I figured out a hack to simulate Hyper Key functionality in MacOS 10.12 Sierra using Karabiner-Elements and Keyboard Maestro. It's straightforward and works for most key combinations. Check it out here: https://redd.it/541oiq

For using e.g CTRL or CAPS as modifiers to activate Diamond-style (j-l-i-k) arrow keys here's a simple workaround that only requires Karabiner-Elements if a CAPS key remap is desired. It uses built-in macOS functionality for the rest of the remapping. Should be extensible a variety of other use cases as well.

Update: does not appear to work within terminal :(

BTW, Karabiner Elements works well for mapping Caps Lock to Switch Input Sources or Alfred.

Map it to F19 (or anything else) in karabiner.json:

{
    "profiles": [
        {
            "name": "Default profile",
            "selected": true,
            "simple_modifications": {
                "caps_lock": "f19"
            }
        }
    ]
}

And then just use Caps Lock as any other key in Alfred or macOS keyboard settings.

Update: I found one downside with this approach—it's not possible to have Caps Lock and ⌘+Space as input source switcher simultaneously.

Update 2: I've been able to create workaround for ⌘+Space issue above using Alfred Workflow.

Is it possible to get Caps Lock to send Esc normally and Ctrl when held / pressed (is that the same as "selected")?

@zeekay See #8

@princed this exactly what I want! Thank you very much!

I was using Seil, Karabiner and Slate for Caps Lock as Hyper and Escape simultaneously as per https://msol.io/blog/tech/work-more-efficiently-on-your-mac-for-developers/#tap-caps-lock-for-escape . Currently, it's possible to remap Caps Lock to F19 as per @princed 's post and change the ~/.slate config file to alias hyper to that key: "alias hyper f19". This way, you're able to switch apps and resize windows, but you can't execute two actions without lifting Caps Lock and you can't use it as Escape (when not used as a modifier Hyper key).

Desperately need to be able to trigger control key sequences, e.g. map HOME to Ctrl+A, END to Ctrl+E. My muscle memory is enslaved to these conventions :) Donating some $$ now b/c Karabiner has been such a lifesaver (and hopefully Karabiner-Elements, too!). Thanks for the hard work, guys!

waiting on this so I can map vi keys with fn.

I'd be curious to know what facility macOS Sierra removed that caused Karabiner to stop working. And is there another way within the OS to emit these synthetic keypresses and we're just waiting for this project to take advantage of it? Or is it simply not possible? I'm not fully clear reading others comments here whether the various workarounds fully replicate what Karabiner was doing.

@marplesoft it's possible, we just need to be patient as @tekezo reimplements all the features.

To all those "looking forward to it", please, use the thumbs-up reaction to the first post, do not spam the issue with irrelevant comments - subscribers get notifications for each one, including some via email, which can be really annoying. Thank you. 🌹

It seems @tekezo is using karabiner-elements for 2 purposes:
First, it is a stopgap measure for 1-to-1 key remapping
Second, a framework is being developed that could eventually support the more advanced syntax of Karabiner
For most of us, the usefulness of Karabiner lies in its capability to remap combinations of keypresses to other combinations. karabiner-elements seems to be more barebones, despite being updated almost hourly at times. It would be nice to have some clarification from @tekezo: will karabiner-elements ever support more complex remapping, or would it make more sense to uninstall it and wait for Karabiner to officially support Sierra?

I can't talk for @tekezo, but I think that this is a ground-up rewrite of Karabiner to fit within the new limitations in Sierra.

As a matter of fact, he said the reason to rewrite the whole app is because Sierra changes the driver of the keyboard big ways. Even Karabiner-Elements is trying to build from simple key swapping not to mention no functionality of hyper key till now. So, I’ll be blessed to see karabiner being restored all the functionality back to Sierra.

On Sep 27, 2016, at 11:01, alanshutko [email protected] wrote:

I can't talk for @tekezo https://github.com/tekezo, but I think that this is a ground-up rewrite of Karabiner to fit within the new limitations in Sierra.


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub https://github.com/tekezo/Karabiner-Elements/issues/16#issuecomment-249754412, or mute the thread https://github.com/notifications/unsubscribe-auth/ADKNgke-raPCc9tTeCHDpGczecryRHFBks5quIcWgaJpZM4J-nDt.

Partial fix (for the most common usecase: hyper key): https://github.com/tekezo/Karabiner-Elements/pull/170

I got back some of my Hyper key functionality using Karabiner-Elements and Hammerspoon.

Check it out here: https://github.com/lodestone/hyper-hacks

Maybe this helps someone...

The main reason I needed this was so I could modify the home and end keys to their pc counterparts. I just came across this and figured it might be useful for a few more of you as well. https://damieng.com/blog/2015/04/24/make-home-end-keys-behave-like-windows-on-mac-os-x Here is another one with a few more examples http://osxnotes.net/keybindings.html

Update: no.

Well, I'm downgrading to El Cap so I can use Karabiner. Good luck everybody.

@prohtex Have you tried using Karabiner-Elements with Hammerspoon? If you see my above comments edit, you'll see it's possible to use Capslock as a hyper key now with that combo. I'm sure you can configure it to do what you need with that combo of software. It's much like having to use Seil with Karabiner before macOS Sierra. Anyway, I'll quote my edit here for easier reference:

EDIT: Thanks to the combined efforts of @lodestone @prenagha @dalemanthei (https://gist.github.com/ttscoff/cce98a711b5476166792d5e6f1ac5907#gistcomment-1886969) @ttscoff, I've got my caps lock hyper key back in macOS Sierra!! Thanks everyone! Also, Hammerspoon is hella sick! Learning LUA lately to interface with Renoise and Pico-8, so having another LUA powered tool in my arsenal is really great fun.

If someone uses Phoenix, you can get hyper key functionality through it as well. I implemented it (f19 as hyper key) a while back in my personal config.

EDIT: Although I realise it's not as universal as the Hammerspoon implementation, so I'm sorry if this just adds to the noise!

I am assuming that this issue is required to get the "programmer" settings from old karabiner. Swapping shift taps for parens in particular.

Mostly commenting to stay in the loop :-)

@todkon My application for Karabiner requires it to work on the lock screen (not the login screen, the lock screen). Hammerspoon doesn't work on the lock screen. [https://github.com/Hammerspoon/hammerspoon/issues/993]

@mafredri Can Phoenix be used to simulate a keypress? I've read through the API and I see you can bind various events to keypresses, but I don't see keys as an event. Could you say remap the "h" key to the "p" key? If so, do you know what syntax you'd use? [https://github.com/kasper/phoenix/blob/master/API.md#12-key]

Guys, this post may of topic, recently, there are news on the e-ink display and lcd display keyboard(you can search unbox therapy for the unboxing of the keyboard), Apple is trying to discuss with the startup with the e-ink keyboard technology. Basically, the keyboard could adapt to the application user is using, so when press one key without holding a modifier key/keys, a specific shortcut is performed, yet the key displays the function it is using.

Since Sierra has changed the keyboard and mouse drivers, I thought this may be related to the such kind of keyboard design in the future keyboard design on the new MacBooks(Just my hypothesis).

As for our power users who uses karabiner, maybe we could be able to utilize such kind of features even without the new display keyboards. One can program the keys to specified functions when switching applications. Thus at least we could save some combo keystrokes since one key could be able to get things done.(apps like Gmail has adopt this kind of single key shortcut)

On Oct 15, 2016, at 02:55, prohtex [email protected] wrote:

@mafredri https://github.com/mafredri Can Phoenix be used to simulate a keypress? I've read through the API and I see you can bind various events to keypresses, but I don't see keys as an event. Could you say remap the "h" key to the "p" key? If so, do you know what syntax you'd use? [https://github.com/kasper/phoenix/blob/master/API.md#12-key https://github.com/kasper/phoenix/blob/master/API.md#12-key]


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub https://github.com/tekezo/Karabiner-Elements/issues/16#issuecomment-253890569, or mute the thread https://github.com/notifications/unsubscribe-auth/ADKNguLOzF7rCmoqVkMzzU_QdxBQJILwks5qz9AegaJpZM4J-nDt.

@prohtex it's possible, but only by executing an external command, (e.g. osascript). This is what I meant by the Phoenix solution not being as universal as the Hammerspoon one.

Stealing some ideas from this thread I finally managed to have PC style Home/End keys again, using hammerspoon. (Default behavior is driving me crazy!)

Mapping "Home" to "F17", "End" to "F18" in karabiner-elements, then add following code to 'init.lua' of hammerspoon:

-- PC Style Home/End Key Behavior
-- Set "Home" to "F17" and "End" to "F18" via karabiner-elements
HomeKey = function()
hs.eventtap.keyStroke({'ctrl'}, 'a')
end

ShiftHomeKey = function()
hs.eventtap.keyStroke({'ctrl', 'shift'}, 'a')
end

EndKey = function()
hs.eventtap.keyStroke({'ctrl'}, 'e')
end

ShiftEndKey = function()
hs.eventtap.keyStroke({'ctrl', 'shift'}, 'e')
end

hs.hotkey.bind({}, "F17", HomeKey, {}, {})
hs.hotkey.bind({'shift'}, "F17", ShiftHomeKey, {}, {})
hs.hotkey.bind({}, "F18", EndKey, {}, {})
hs.hotkey.bind({'shift'}, "F18", ShiftEndKey, {}, {})

Will work for "Home", "End", "Shift+Home", "Shift+End". Maybe not elegant, but seems to work quite well.

Can anybody explain what exactly is the problem why this doesn't work at the moment? And how it can be solved by having this feature be in karabiner elements?

My myself had my capslock be linked to ctrl alt shift command

This should be solved with a Pull Request not?

@dimitrieh @prohtex if you read through the backlog here macOS Sierra completely changed the keyboard driver and interface at the OS level. So the changes that have been needed, and are needed, are not tiny.

Since this is a complete rewrite of Karabiner to accommodate the OS changes. Plus this is not the authors day job... so yeah. It could be a while but the progress has been really impressive so far.

Thanks @designfrontier, that's a really helpful summary for project context & expectations. Appreciate it!

It looks like @clayreimann has a proposed syntax here:
[https://github.com/tekezo/Karabiner-Elements/pull/294]

Similarly to this, I'd love to have the "PC Application Key as meta key" from the old Karabiner thing in Karabiner-Elements, where the "PC Application Key" was actually the "old" ctrl key mapped with Seil.

I had a pretty specific case where I wanted to map the caps lock key to Ctrl-b as my tmux prefix in iTerm. Here's the process I used to get it using Karabiner-Elements: http://superuser.com/questions/1142577/bind-caps-lock-key-to-tmux-prefix-on-macos-sierra/1142578#1142578

I've hardcoded the fn + hjkl arrow mappings for now: https://github.com/watsoncj/Karabiner-Elements/commit/5531032a309fe99e7e153cb725b9f44a19da69c0

cc: @wmalloc @dtcristo @jrolfs

Yessssss, thank you!

El día 4 de noviembre de 2016 a las 11:27:46 PM, Casey Watson (
[email protected]) escrito:

I've hardcoded the fn + hjkl arrow mappings for now: watsoncj@5531032
https://github.com/watsoncj/Karabiner-Elements/commit/5531032a309fe99e7e153cb725b9f44a19da69c0

cc: @wmalloc https://github.com/wmalloc @dtcristo
https://github.com/dtcristo @jrolfs https://github.com/jrolfs


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/tekezo/Karabiner-Elements/issues/16#issuecomment-258594294,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AARloM0MyGRdjr4lzHtCK0595qc2ICDOks5q7CHigaJpZM4J-nDt
.

It would be awesome to have any sort of update from the author as to when we might expect this to be supported?

I agree, that would be nice to know, however I really want to give props to @tekezo for how much progress has been made after macOS kinda pulled the rug out from under the original project. Thanks!

+1
Any information about the state of development would be really nice.
Anyway, thanks for the developer's work

The official thread for this issue now seems to be [https://github.com/tekezo/Karabiner-Elements/issues/369]

This probably also allows mapping Up + (Left or Right) => PageUp and Down + (Left or Right) => PageDown

I finally got a weekend to upgrade to MacOS Sierra and implement some basic vim style bindings for Karabiner-Elements and Hammerspoon. I am not a Lua programmer, but after staring at some examples cockeyed it doesn't look radically different from javascript. Hammerspoon is really powerful and I'm very happy to have been forced into using it.

I would welcome any feedback as I intend to keep hacking away at the Hammerspoon keybindings with an eye towards implementing more vim style functionality.

https://gist.github.com/RichardForrester/fe1a6bb0fe1672ee2272bbc5d9d4eb19

Based on @RichardForrester 's answer, finally got back the complex key binding function in OSX Sierra. As Richard wrote, you should use hammerspoon to do this (http://www.hammerspoon.org/).
After the installation, the ~/.hammerspoon/init.lua file created (or if not, you have to create it), and you can do the keybindings in Lua.

Here's a part of my init.lua file:

hs.hotkey.bind({"cmd"}, "é", function()
  hs.eventtap.keyStroke({"alt"}, "4")
end)

hs.hotkey.bind({"cmd"}, "í", function()
  hs.eventtap.keyStroke({"shift","alt"}, "y")
end)

hs.hotkey.bind({"cmd"}, "y", function()
  hs.eventtap.keyStroke({"shift","alt"}, "x")
end)
... 

Don't forget to reload config after you edited the file.

Richard, thank you for that clue, helped a lot.

@RichardForrester @RobbeR What would be the config for remapping Caps Lock to Escape when hit by itself, and Ctrl when hit with another key?

Thanks in advance.

@sotojuan that's what #8 refers to; I think it's still unsupported, but there's a fork available.

@sotojuan I can't speak to other implementations, but as far as the hammerspoon setup I've been hacking on, it works by doing a check for the property ".triggered" when Caps Lock is released.

  if not cMode.triggered then
    hs.eventtap.keyStroke({}, 'ESCAPE')
  end

The implication is that every binding for which you do not want Caps Lock to send escape on key release must set the ".triggered" property to true.

I hope that make sense.

I have the caps lock/escape in my init.lua for hammerspoon. It's not my original work but something I derived from Bret Terpstra originally... check the hattip links for other options.

So if I understood correctly, when #16 is fixed, you can map...
CAPS_LOCK to " (double quotes, which is SHIFT+single-quotes
... right?

(currently I can map CAPS-to-singleQuote --> SHIFT-CAPS is now double-quotes)

So far, this issue is not fix by end of 2016.

I used to rely on Karabiner's Emacs like keymaping on Preview.app on Mac.
Now I am successfully using Hammerspoon with following init.lua config to make emacs ctrl + n and ctrl + p work on Preview.app.

loggerInfo = hs.logger.new('My Settings', 'info')

local function keyCode(key, modifiers)
  modifiers = modifiers or {}

  return function()
    if hs.application.frontmostApplication():path() == '/Applications/Preview.app' then
      hs.eventtap.event.newKeyEvent(modifiers, string.lower(key), true):post()
      hs.timer.usleep(1000)
      hs.eventtap.event.newKeyEvent(modifiers, string.lower(key), false):post()
    end
  end
end

-- For preview movement
hs.hotkey.bind({'ctrl'}, 'n', keyCode('down'), nil, keyCode('down'))
hs.hotkey.bind({'ctrl'}, 'p', keyCode('up'), nil, keyCode('up'))

I'm employing this Hammerspoon script to map option + hjkl to the corresponding arrow keys as in VIM.

hs.hotkey.bind({"alt"}, "j", function()
  hs.eventtap.keyStroke({""}, "down")
end)
hs.hotkey.bind({"alt"}, "h", function()
  hs.eventtap.keyStroke({""}, "left")
end)
hs.hotkey.bind({"alt"}, "k", function()
  hs.eventtap.keyStroke({""}, "up")
end)
hs.hotkey.bind({"alt"}, "l", function()
  hs.eventtap.keyStroke({""}, "right")
end)

Same here, I want to switch : to ;, looks like it's the only way.

@briansoule Thanks for your script, it works, but I am still missing the repeat key stroke when holding down these keys. For now it's good enough while waiting for Karabiner's fix.

If you want the repeat keys to work too, you can add a nil for the 4th argument and the funtion() boyd end again for the 5th, like this:

hs.hotkey.bind({"alt"}, "l", function()
  hs.eventtap.keyStroke({""}, "right")
end, nil, function()
  hs.eventtap.keyStroke({""}, "right")
end)

This, however, still has the drawback of being a registered hotkey instead of a key remap, which is what Karabiner does, so other applications can react to it as well. For example, I had registered ⌘⌥D, but this also toggles the dock by default.

Fortunately I found a solution. It's not perfect, again, but at least it will remap instead of register hotkeys. I wanted to specifically remap the right command key + esdf to the arrow keys, but not with the left (that would, for example, break ⌘S to save a file). The Karabiner remap looks like this:

  <item>
    <name>Command_R+ESDF to Up/Down/Left/Right</name>
    <identifier>remap.diamond_cursor_commandr_esdf</identifier>
    <autogen>--KeyToKey-- KeyCode::E, ModifierFlag::COMMAND_R, KeyCode::CURSOR_UP</autogen>
    <autogen>--KeyToKey-- KeyCode::D, ModifierFlag::COMMAND_R, KeyCode::CURSOR_DOWN</autogen>
    <autogen>--KeyToKey-- KeyCode::S, ModifierFlag::COMMAND_R, KeyCode::CURSOR_LEFT</autogen>
    <autogen>--KeyToKey-- KeyCode::F, ModifierFlag::COMMAND_R, KeyCode::CURSOR_RIGHT</autogen>
  </item>

This is my Hammerspoon code to achieve (almost) the same.

local tap = hs.eventtap.new({ hs.eventtap.event.types.keyDown, hs.eventtap.event.types.keyUp }, function(event)

  --[[
    If the right command button is pressed, we want to remap ESDF to up, left,
    down, right. We also want to retain the other modifiers, which includes
    keeping the command modifier if the left command button is also pressed.

    Hammerspoon by default does not allow us to check if the left or right
    modifier is pressed so we need to check the raw event flags property, which
    does contain this information.

    While we can modify the event and replace the keycodes for esdf with those
    of the arrow keys we do not have fine grained control over the modifiers
    because we cannot modify the actual flags but only toggle modifiers as a
    "whole". This means that when we remove the command modifier from the event,
    we also lose the detailed information on other modfiers (left or right
    shift, for example) which might be present. This might cause incompatibility
    issues with your specific setup if it depends on that information.

    KeyCodes for e, s, d, f: 14, 1, 2, 3
    KeyCodes for up, left, down, right: 126, 123, 125, 124
    Command bitmask: 0x100000 (bit 21)
    Cmd Left: 0x8 (bit 4)
    Cmd Right: 0x16 (bit 5)
  ]]--

  local flags = event:getRawEventData().CGEventData.flags

  local cmd = flags & 0x100000 > 0
  local cmdLeft = cmd and flags & 0x8 > 0
  local cmdRight = cmd and flags & 0x10 > 0

  local keyCode = event:getKeyCode()

  -- if right command && (e, s, d or f)
  if (cmdRight and (keyCode == 14 or keyCode == 1 or keyCode == 2 or keyCode == 3)) then

    if (not cmdLeft) then
      -- strip command modifier
      -- this also (presumably) loses the detailed information on the other
      -- modifiers
      local flags = event:getFlags()
      flags["cmd"] = false
      event:setFlags(flags)
    end

    -- remap esdf to arrows
    if (keyCode == 14) then event:setKeyCode(126) end -- up
    if (keyCode == 1) then event:setKeyCode(123) end -- left
    if (keyCode == 2) then event:setKeyCode(125) end -- down
    if (keyCode == 3) then event:setKeyCode(124) end -- right

  end

  return false
end):start()

Good luck!

I really loved the numpad integration in Karabiner. Does anyone have an idea on when this might reoccur?

Hi. I've used Karabiner for a long time, for one single purpose: to remap § to #

I never use the § key, but I use # a lot, so swapping them around is a huge timesaver for me.

Any news on a Karabiner fix for Sierra? Or a workaround that will allow me to do this with Karabiner Elements (pref without having to install & config a tonne of other tools)?

@quiffboy You can do that very easily with Karabiner-Elements. KE has been supporting this type of conversion since first release.

@talha131 I don't think that's correct.

It takes a combination of Option-L and 3 to produce a # symbol, but as I understand it, KE can't map one key to multiple keys (that's what this whole thread is about).

I would love it if I were wrong, so if you have any examples of how to set up the json file to achieve this would be much appreciated. Thanks.

@quiffboy I think you can do that with a custom keyboard layout, like the ones created with ukelele?
I don't know if it is still possible with sierra, but with el capitan you could. I downgraded, so I can't test.
Also, that is a native osx feature, so you wouldn't have to keep a process running.

@quiffboy If you're comfortable with an unofficial build, I implemented a temp way to achieve that.
Check out #247
You can use

            "one_to_many_mappings": {
                "non_us_backslash": ["left_shift", "3"]
            }

But I don't have a keyboard with that key so I cannot test~

Thanks @marchbnr. You could do it on El Capitan using Karabiner out of the box, but Elements doesn't support it (yet).

@wwwjfy's solution looks interesting though - I'll give that a go, thank you 👍

@wwwjfy Installed your version and added this to the json file: (it's the left alt/ctrl key not the left shift key btw)

           "one_to_many_mappings": {
                "non_us_backslash": ["left_control", "3"]
           },

But it doesn't seem to do anything.

Apologies, should be left_option

@quiffboy on my keyboard, it's left_shift + 3, never seen other layouts.
Please try to do it in Karabiner-EventViewer, so we can see what's wrong.
There are too many reasons it cannot work~

Thanks @wwwjfy Might be different for UK keyboards? With my UK keyboard (and Karabiner not enabled) I hit this combo and it produces a # symbol:

capturfiles-11-47-2017_10 47 49

Nonetheless, neither of these combos seem to work:

"one_to_many_mappings": { "non_us_backslash": ["left_shift","3"] }

or

"one_to_many_mappings": { "non_us_backslash": ["left_option","3"] }

Event viewer still registers the original § click:

capturfiles-11-50-2017_10 50 25

Thanks for following this up btw :)

@quiffboy
Do you see anything interesting in logs?
Could you try other keys? So we can make sure it's because of the key or the installation failure.

Maybe we should communicate via email, so no spams in this thread.

Thanks for all your help @wwwjfy :)

Just to confirm I've managed to get this working now.

Uninstalled KE, rebooted, reinstalled _Karabiner-Elements-0.90.75.dmg_ from @wwwjfy's link, rebooted again then edited the json file to add this mapping (for my UK keyboard):

            "one_to_many_mappings": {
                "non_us_backslash": [
                    "left_option",
                    "3"
                ]
            },

I can confirm that works for me.

Hi,

I have wired Apple Keyboard with Numeric Keypad.
I would like to remap:
CMD+C to right_CTRL+Fn (copy)
CMD+V to right_SHIFT+Fn (paste)
using Karabiner-Elements.
Can someone help me?

I did everything I could, but the following (attempt at Home & End) doesn't work for me:

            "one_to_many_mappings": {
                "end": [ "right_command", "right_arrow" ],
                "home": [ "right_command", "left_arrow" ]
            },

I used latest .83 build and Apple keyboard.

EDIT: Never mind me! I got it to work and can confirm it's doing fine. I think my issue was not saving the json in the right directory (however idiotic this sounds). You don't even know how happy your commit makes me in my work @wwwjfy, thanks a lot!

@Senthe Haven't got an Apple keyboard with home or end keys. Could you locate the problem?
Is it that home/end cannot be recognized, one_to_many_mappings doesn't work for any key, or the right_command + xxx won't trigger?

@wwwjfy I explained everything in a somewhat late edit above. It turned out to work fine, sorry for the trouble. : )

So is karabiner-element support __SimultaneousKeyPresses__ now?
I'm considering buy the new macbook pro with the touch bar, obviously can't downgrade to 10.11.

I am trying to get left_shift to equal ( and right_shift to equal ) with no luck. Anyone having luck with that or have ideas?

@wwwjfy do you think you can generate a PR to try to get your one-to-many feature included in the official releases?

@wwwjfy or @quiffboy I am looking for the karabiner.json file but can not find it... could you point me in the right direction? I am on a Mac and installed this forked version of KE. However, I am stuck at the point where I like to add my own configuration to the one_to_many_mappings part...

@pimhooghiemstra The standard location is ~/.config/karabiner/karabiner.json. Open Finder, ⌘+G enter ~/.config/karabiner/karabiner.json.

@sonyamamurin found it, great! Thx for the fast reply

I got my hyper+hjkl mapping to left down up right working. Thank you all for sharing your scripts.

However, do you also feel that hammerspoon is much much slower than pre-sierra Karabiner? Now when I press hyper+j, I can feel a long latency.

Also, in karabiner, I can hold hyper+h, to get repeating left strokes.
But with hammerspoon, no repeating. Any ideas to solve this?

Yes, hammerspoon is extremely slow, and does not repeat.
On Fri, Mar 10, 2017 at 11:11 AM Tianxiang Chen notifications@github.com
wrote:

I got my hyper+hjkl mapping to left down up right working. Thank you all
for sharing your scripts.

However, do you also feel that hammerspoon is much much slower than
pre-sierra Karabiner? Now when I press hyper+j, I can feel a long latency.


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/tekezo/Karabiner-Elements/issues/16#issuecomment-285757685,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ABhbF7cPPAtjzry93KvwWpp7M8NmaOfyks5rkaBagaJpZM4J-nDt
.

I am new to Karabiner and it looks to be very helpful. However, I have an specific use case which I think is not covered here.

I want to be able to "sequentially input multiple keys when I press one key". For ex: If I press "K" on the keyboard, "ASD" should be registered sequentially.
This works fine using "one_to_many_mappings" and the sequential keys are different. But it doesn't work when I want to input the same key multiple times. Ex: If I press "J", "EEE" (3 sequential Es) should be inputed.

While looking at the even viewer, I think the reason this doesn't work is because the 2nd KeyDown event happens before the first KeyUp event happens. Hence, the 2nd KeyDown even is not registered as a separate input. Is there a way we can fix this?

Following these two consecutive steps worked for me:

Steps in comment 1: https://github.com/tekezo/Karabiner-Elements/issues/16#issuecomment-271907994
Steps in comment 2: https://github.com/tekezo/Karabiner-Elements/issues/16#issuecomment-283658337

To make a hyper key, my config looks like:

            "one_to_many_mappings": {
                "fn": [ "left_command", "left_option", "left_control", "left_shift" ]
            },

@leoj3n , thanks, trying this right now!

Does anyone please know if the fork makes it possible to do one-to-many mappings with Caps Lock yet? I had Caps mapped to left_control, left_option + left_command and I really miss it since moving to Sierra :(

+100 on missing one to many mappings.
On Thu, Mar 16, 2017 at 7:46 PM brunorsini notifications@github.com wrote:

@leoj3n https://github.com/leoj3n , thanks, trying this right now!

Does anyone please know if the fork makes it possible to do one-to-many
mappings with Caps Lock yet? I had Caps mapped to left_control, left_option

  • left_command and I really miss it since moving to Sierra :(


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/tekezo/Karabiner-Elements/issues/16#issuecomment-287252086,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ABhbF8T0fuZX0U1-AYUEVaapfYUE3cuMks5rmfP-gaJpZM4J-nDt
.

Apparently it has been solved, provided you use the forked version! I just
want to know whether it's possible to do that with Caps...

On Thu, Mar 16, 2017 at 8:17 PM, Brian Soule notifications@github.com
wrote:

+100 on missing one to many mappings.
On Thu, Mar 16, 2017 at 7:46 PM brunorsini notifications@github.com
wrote:

@leoj3n https://github.com/leoj3n , thanks, trying this right now!

Does anyone please know if the fork makes it possible to do one-to-many
mappings with Caps Lock yet? I had Caps mapped to left_control,
left_option

  • left_command and I really miss it since moving to Sierra :(


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
issuecomment-287252086>,
or mute the thread
AYUEVaapfYUE3cuMks5rmfP-gaJpZM4J-nDt>
.

>


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/tekezo/Karabiner-Elements/issues/16#issuecomment-287256110,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AFwYRivosxo1BnKhqgIBWAsyx8sWfwjOks5rmftdgaJpZM4J-nDt
.

If somebody looks for shifts-to-parens like key mappings - chek my custom build of @wwwjfy's branch out.

The build supports many key sequences for standalone_keys.
To map left and right shifts to open and close parens respectively add the following to config:

"standalone_keys": {
   "left_shift": [
                    "left_shift",
                    "9"
                ],
   "right_shift": [
                    "right_shift",
                    "0"
                ]
}

Same mapping may be done for any modifier or other keys.

@IvanRublev This just got me back to where I was before sierra and no need for hammerspoon. Thanks!

Is this issue also covering the other way around? I want to map a few things on fn+characters, to match mappings of my 60% at home. So pressing multiple keys to get one.

I'm also curious about @pietdevries94's question as I have the exact same use case. @pietdevries94 FYI I've been using builds from my fork with the keys I need hard-coded for some time now: https://github.com/jrolfs/Karabiner-Elements/tree/fn-hjkl-arrows (I've been rebasing back onto master as updates come in upstream, I'll push a more up-to-date version as soon as I've tested the most recent rebase).

@jrolfs Thanks a lot for that fork! While I personally prefer ijkl as arrows, this is a great thing for between builds!

There's an ijkl fork too, I just haven't rebased it in a while. Let me
know if you need a build.

El día 12 de abril de 2017 a las 1:19:09 AM, Piet de Vries (
[email protected]) escrito:

@jrolfs https://github.com/jrolfs Thanks a lot for that fork! While I
personally prefer ijkl as arrows, this is a great thing for between builds!


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/tekezo/Karabiner-Elements/issues/16#issuecomment-293507249,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AARloHsoqFrIXaH4eJ4MOWCv8f2RAZj8ks5rvIj9gaJpZM4J-nDt
.

@jrolfs I would love to use that version. I don't know much work it'll be for you to rebase that. I don't want to give you a lot of hassle, but I would be really grateful!

I've been waiting for many keys to one support just to map shit + delete => forward delete. @jrolfs, your fork gave me the context/inspiration to hardcode what I needed: https://github.com/dndrsn/Karabiner-Elements. Thanks!

As tbMBP user I strongly need to have fn+num keys work as F1-12 keys, because touchbar is counterproductive for me.

@dndrsn and @jrolfs I'm eagerly waiting for modifier+key -> another key, sounds like you have shift+delete -> forward delete, can you show me its syntax inside karabiner.json? Thanks

Exactly my need as well.
Also modification of F13-F18 (My Matias keyboard has no F19, as such, rather something I don't recognize or understand - underlined upward arrow)

@aoenth, AFAIK there is no support yet for modifier+key -> another key via karabiner.json. I (badly) wanted support specifically for shift+delete -> forward delete, so I just put it directly into the code (following a similar approach to @jrolfs) as a solution until actual configurable support is added. What I did is not flexible in any way, but the same approach could be followed for other key setups.

Is there any mention of that particular support? I want caps +jkli to arrow keys !!

On May 7, 2017 at 09:00:03, Dan Anderson ([email protected](mailto:[email protected])) wrote:

@aoenth(https://github.com/aoenth), AFAIK there is no support yet for modifier+key -> another key via karabiner.json. I (badly) wanted support specifically for shift+delete -> forward delete, so I just put it directly into the code (following a similar approach to @jrolfs(https://github.com/jrolfs)) as a solution until actual configurable support is added. What I did is not flexible in any way, but the same approach could be followed for other key setups.


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub(https://github.com/tekezo/Karabiner-Elements/issues/16#issuecomment-299715617), or mute the thread(https://github.com/notifications/unsubscribe-auth/ANExv4jDWKUQKRH68iu8WKdmMgFoX3cIks5r3eqDgaJpZM4J-nDt).

Anybody found a solution for Fn+jkluioè!ç to numpad?

Or could anybody explain how they did a modifier + key to key?

Regards
Peter

On 7 May 2017, at 23:18, Mark Steel notifications@github.com wrote:

Is there any mention of that particular support? I want caps +jkli to arrow keys !!

On May 7, 2017 at 09:00:03, Dan Anderson ([email protected](mailto:[email protected])) wrote:

@aoenth(https://github.com/aoenth), AFAIK there is no support yet for modifier+key -> another key via karabiner.json. I (badly) wanted support specifically for shift+delete -> forward delete, so I just put it directly into the code (following a similar approach to @jrolfs(https://github.com/jrolfs)) as a solution until actual configurable support is added. What I did is not flexible in any way, but the same approach could be followed for other key setups.


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub(https://github.com/tekezo/Karabiner-Elements/issues/16#issuecomment-299715617), or mute the thread(https://github.com/notifications/unsubscribe-auth/ANExv4jDWKUQKRH68iu8WKdmMgFoX3cIks5r3eqDgaJpZM4J-nDt).


You are receiving this because you commented.
Reply to this email directly, view it on GitHub https://github.com/tekezo/Karabiner-Elements/issues/16#issuecomment-299735614, or mute the thread https://github.com/notifications/unsubscribe-auth/AX3yU7apNlhxdZ5MmbmdmsK8XBFcaLuSks5r3jUQgaJpZM4J-nDt.

+1 to this ask. I am used to having "shift + capslock" for "capslock". I miss it.

Just upgraded to Sierra for latest version of XCode. Lost Karabiner & Seil. Very unfortunate. *Can't tell how grateful I am to the creator of Karabiner Elements. *

Reaaaaaaaaaaaaally miss shift+capslock too : /

On Fri, May 12, 2017 at 10:01 AM, abhaywit notifications@github.com wrote:

+1 to this ask. I am used to having "shift + capslock" for "capslock". I
miss it.

Just upgraded to Sierra for latest version of XCode. Lost Karabiner &
Seil. Very unfortunate. *Can't tell how grateful I am to the creator of
Karabiner Elements. *


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/tekezo/Karabiner-Elements/issues/16#issuecomment-301131248,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AFwYRt2ghwnGtBDR8a2dicJQfyvGLhxkks5r5JB0gaJpZM4J-nDt
.

Hi guys, is it a way to auto swap fn to a hyper key when not combo the fn key with f1-f12 key (key real estate shortage).

On May 8, 2017, at 15:18, pvandewalle notifications@github.com> wrote:

Anybody found a solution for Fn+jkluioè!ç to numpad?

Or could anybody explain how they did a modifier + key to key?

Regards
Peter

On 7 May 2017, at 23:18, Mark Steel notifications@github.com> wrote:

Is there any mention of that particular support? I want caps +jkli to arrow keys !!

On May 7, 2017 at 09:00:03, Dan Anderson ([email protected] notifications@github.com(mailto:[email protected] notifications@github.com)) wrote:

@aoenth(https://github.com/aoenth https://github.com/aoenth), AFAIK there is no support yet for modifier+key -> another key via karabiner.json. I (badly) wanted support specifically for shift+delete -> forward delete, so I just put it directly into the code (following a similar approach to @jrolfs(https://github.com/jrolfs https://github.com/jrolfs)) as a solution until actual configurable support is added. What I did is not flexible in any way, but the same approach could be followed for other key setups.


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub(https://github.com/tekezo/Karabiner-Elements/issues/16#issuecomment-299715617 https://github.com/tekezo/Karabiner-Elements/issues/16#issuecomment-299715617), or mute the thread(https://github.com/notifications/unsubscribe-auth/ANExv4jDWKUQKRH68iu8WKdmMgFoX3cIks5r3eqDgaJpZM4J-nDt https://github.com/notifications/unsubscribe-auth/ANExv4jDWKUQKRH68iu8WKdmMgFoX3cIks5r3eqDgaJpZM4J-nDt).


You are receiving this because you commented.
Reply to this email directly, view it on GitHub https://github.com/tekezo/Karabiner-Elements/issues/16#issuecomment-299735614>, or mute the thread https://github.com/notifications/unsubscribe-auth/AX3yU7apNlhxdZ5MmbmdmsK8XBFcaLuSks5r3jUQgaJpZM4J-nDt>.


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub https://github.com/tekezo/Karabiner-Elements/issues/16#issuecomment-299791601, or mute the thread https://github.com/notifications/unsubscribe-auth/ADKNgsBs8Pzwn-2YbmEDZyv-5eJUOvO8ks5r3sHUgaJpZM4J-nDt.

https://cloud.githubusercontent.com/assets/143418/17495839/a5054eac-5d88-11e6-95fc-7290892c7bb5.png https://cloud.githubusercontent.com/assets/143418/15842166/7c72db34-2c0b-11e6-9aed-b52498112777.png https://github.com/tekezo/Karabiner-Elements u003cnotifications@github.com notifications@github.com notifications@github.com https://github.com/aoenth https://github.com/jrolfs https://github.com/tekezo/Karabiner-Elements/issues/16#issuecomment-299715617 https://github.com/notifications/unsubscribe-auth/ANExv4jDWKUQKRH68iu8WKdmMgFoX3cIks5r3eqDgaJpZM4J-nDt https://github.com/tekezo/Karabiner-Elements/issues/16#issuecomment-299791601

@wxmtech Same thing I wish for.

I want to redefine CapsLock to Shift+Ctrl+Alt+Cmd which I use to define many shortcut with BetterTouch. This worked so nicely in the good old times of Seil & Karabiner.

And thanks for all this great work to bring usability to macOS.

The latest beta version now supports complex key mappings!!! (you can select Check for Beta Updates in the app)

Example configs here: https://github.com/tekezo/Karabiner-Elements/blob/70fcaa177d4d0b409e77c6166505a34780316848/examples/emacs_key_bindings.json

Going to donate now, this is working amazingly well!

@arjunlall you may not know this but does this addition allow the use case of short press shift to paren + long press shift to shift like the old karabiner? I looked through the commits that add complex modifications but I can not find anything about long press vs short.

@westlywright

maybe this is what you need:

https://github.com/tekezo/Karabiner-Elements/commit/70fcaa177d4d0b409e77c6166505a34780316848#diff-74d8bf0370a1e54c839e011ec1441acf

Great progress. Turned off Hammerspoon (was using as a work-around) and trying to get my vi-style cursor movement commands implemented. So for example CapsLock+h mapping to the left-arrow. I added the below. Which does work for one move, but if I keep CapsLock depressed and type hhhh I expect that to trigger left_arrow 4 times. However it instead triggers left_arrow once followed by 3 of the letter h

Ideas or pointers welcome.

{   "description": "VI CapsLock-h to Left Arrow",
    "from": {"key_code": "h", "modifiers": {"mandatory": ["caps_lock"]}},
    "to": [{"key_code": "left_arrow"}],
    "type": "basic"}

My HyperKey binding, which I never use repeat on, works great. Thanks.

@prenagha you can try this:

{
  "description": "Change right_option + hjkl to arrow key",
  "from": {
    "key_code": "j",
    "modifiers": {
      "mandatory": [
        "right_option"
      ],
      "optional": [
        "any"
      ]
    }
  },
  "to": [
    {
      "key_code": "down_arrow"
    }
  ],
  "type": "basic"
}

this is my complete config:
https://gist.github.com/luosky/c45781fede700968cbcda7ee45a976c8

Fixed. I think I had hyper stepping on the VI commands. Here is my complete config with vi movement and hyper keys which so far is working great. Thanks again.

https://gist.github.com/prenagha/3b1a0b18f09c1df91d7c2a376f27a4eb

Wow, this is great news!!

Has anyone figured out if/how it’s possible to replicate the home row functionality from Karabiner? ie. Holding down the space bar allows you to change what most home row and other keys do.

That’s the one I’ve been waiting for before upgrading to Sierra

@sinewave This is what you need, just change it to whatever modifier you want to use instead of left shift. https://github.com/tekezo/Karabiner-Elements/blob/70fcaa177d4d0b409e77c6166505a34780316848/examples/spacebar_to_shift.json

Thx for the sharing this Arjun!

The original home row mode is pretty sophisticated allowing for some
complex combinations.

https://github.com/tekezo/Karabiner/blob/master/src/core/server/Resources/include/checkbox/homerow_mode.xml

--
Tony P

Does anyone please know whether it's now possible to map ctrl+alt+command
to Caps Lock? Thanks a bunch.

On Wed, Jun 14, 2017 at 10:18 PM, sinewave notifications@github.com wrote:

Thx for the sharing this Arjun!

The original home row mode is pretty sophisticated allowing for some
complex combinations.

https://github.com/tekezo/Karabiner/blob/master/src/core/
server/Resources/include/checkbox/homerow_mode.xml

--
Tony P


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/tekezo/Karabiner-Elements/issues/16#issuecomment-308631234,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AFwYRjMa45L7mFPXB5y2tzS0aogXTEtKks5sEL6hgaJpZM4J-nDt
.

@brunorsini This config works for me for mapping Caps-lock to ctrl-alt-command.

I'm on version 0.91.4.

"complex_modifications": {
    "rules": [
        {
            "manipulators": [
                {
                    "description": "Change caps_lock to command+control+option.",
                    "from": {
                        "key_code": "caps_lock",
                        "modifiers": {
                            "optional": [
                                "any"
                            ]
                        }
                    },
                    "to": [
                        {
                            "key_code": "left_command",
                            "modifiers": [
                                "left_control",
                                "left_option"
                            ]
                        }
                    ],
                    "type": "basic"
                }
            ]
        }
    ]
}

Is it possible to use standard keys as modifier keys for complex configurations? I'm trying to get vi emulation using s+hjkl like in the old Karabiner. I tried this:

      "complex_modifications": {
          "rules": [
              {
                  "manipulators": [
                      {
                          "description": "Vi s+h to arrow key left",
                          "from": {
                              "key_code": "h",
                              "modifiers": {
                                  "mandatory": ["s"]
                              }
                          },
                          "to": [
                              {"key_code": "left_arrow"}
                          ],
                          "type": "basic"
                      }
                  ]
              }
          ]
      },

But that just mapped the h to left arrow, no matter if the s key was held down or not.

+1 on this, would be great if this could make it's way into the readme as
well.

On Tue, Jun 27, 2017 at 3:47 PM, Jay Thompson notifications@github.com
wrote:

Is it possible to use standard keys as modifier keys for complex
configurations? I'm trying to get vi emulation using s+hjkl like in the old
Karabiner. I tried this:

  "complex_modifications": {
      "rules": [
          {
              "manipulators": [
                  {
                      "description": "Vi s+h to arrow key left",
                      "from": {
                          "key_code": "h",
                          "modifiers": {
                              "mandatory": ["s"]
                          }
                      },
                      "to": [
                          {"key_code": "left_arrow"}
                      ],
                      "type": "basic"
                  }
              ]
          }
      ]
  },

But that just mapped the h to left arrow, no matter if the s key was held
down or not.


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/tekezo/Karabiner-Elements/issues/16#issuecomment-311507441,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ABhbFwIPEFOvihBGog_teOoCScqvvKjFks5sIYaDgaJpZM4J-nDt
.

--
BrianSoule.com http://briansoule.com/
512-964-0048
@BrianSoule https://twitter.com/BrianSoule

The latest update add exactly what I described above. I'm super happy!

Is double key press supported? Like: CMD+CMD = Ctrl+Shift+A ?

Is there any way to modify space bar to be CMD when combined with other keys, but insert space otherwise? I have RSI and the modification would help me.

I tried using the built-in modification for "Change Spacebar to left_shift" and then modifying the
.json by subsitutting left_shift for left_command, as follows:

"profiles": [
        {
            "complex_modifications": {
                "parameters": {
                    "basic.to_if_alone_timeout_milliseconds": 1000
                },
                "rules": [
                    {
                        "description": "Change spacebar to left_shift. (Post spacebar if pressed alone)",
                        "manipulators": [
                            {
                                "from": {
                                    "key_code": "spacebar",
                                    "modifiers": {
                                        "optional": [
                                            "any"
                                        ]
                                    }
                                },
                                "to": [
                                    {
                                        "key_code": "left_command"
                                    }
                                ],
                                "to_if_alone": [
                                    {
                                        "key_code": "spacebar"
                                    }
                                ],
                                "type": "basic"
                            }
                        ]
                    },
                    {

However, that didn't work. When I press spacebar + A on this page, for example, it scrolls instead of select all.

Any ideas?

I have a similar rule, the only difference seems to be that in the to if alone clause I have some details on the modifier there as well. this works well for me. Also, double check you have the latest beta version installed.

{

                            "description": "Change right_command to delete when on own, otherwise map to fn",
                            "from": {
                                "key_code": "right_command",
                                "modifiers": {
                                    "optional": [
                                        "any"
                                    ]
                                }
                            },
                            "to": [
                                {
                                    "key_code": "fn"
                                }
                            ],
                            "to_if_alone": [
                                {
                                    "key_code": "delete_or_backspace",
                                    "modifiers": {
                                        "optional": [
                                            "any"
                                        ]
                                    }
                                }
                            ],
                            "type": "basic"
                        }

Hurray!! Finally I'm able to convert my CapsLock to double-quotes again!

                    "manipulators": [
                        {
                            "description": "Change caps_lock to double-quotes.",
                            "from": {
                                "key_code": "caps_lock",
                                "modifiers": {
                                    "optional": [
                                        "any"
                                    ]
                                }
                            },
                            "to": [
                                {
                                    "key_code": "quote",
                                    "modifiers": [
                                        "left_shift"
                                    ]
                                }
                            ],
                            "type": "basic"
                        }
                    ]

Just wanted to post a hint for anyone in the future who runs into the issue I had with caps_lock as Hyper key.

Situation:
Attemtping to have Caps Lock act as Hyper key when used with another key, and act normally as Caps toggle otherwise.

Issue:
Using Brett Terpstra's instructions, I wasn't able to have Caps function as normal when not used with a modifier key. That is, modifying the "to_if_alone" value in the JSON to "caps_lock" did not preserve the toggle.

Solution:
Karabiner Elements settings -> Virtual Keyboard -> Caps Lock Delay to 0 ms.

I also disabled caps lock in System Preferences per Brett's instructions, but that did not have any effect.

Please, help here: I'm trying to use the "one to many mapping" to bind button3 to spacebar+button1 but cannot understand how to use it...
My last try was:

                            {
                                "conditions": [
                                    {
                                        "bundle_identifiers": [
                                            "com\\.adobe\\.illustrator"
                                        ],
                                        "type": "frontmost_application_if"
                                    }
                                ],
                                "from": {
                                    "modifiers": {
                                        "optional": [
                                            "any"
                                        ]
                                    },
                                    "pointing_button": "button3"
                                },
                                "to": [
                                    {
                                        "key_code": "spacebar",
                                        "pointing_button": "button1"
                                    }
                                ],
                                "type": "basic"
                            }

Could anyone help?

Thanks!

Anyone know if "Multiple key strokes as one" feature got added and where I might find an example of the config? Thanks!

@jenjwong It is added and I believe it ships with an example in Complex Modifications > Add rule, you can find more through the Import more rules... button.

Does anyone know how I could make left control + left click = left click? This used to be an option in karabiner, but it's not in KE and I really need it. If you know how to add this somehow, please let me know how

@Shnez unfortunately here is no such option afaik because in MacOS it leads to left_button system wide.
I've to swap Ctrl and Cmd and then tune my Intellij Idea hot keys

Can I map "button3 -> space+button1"?

I would also like to do something similar but or it's not possible or I'm
not being help about how to do it...
If you solve it let me know, please.

Don't know if this will come in handy, but I could not find a mention of the fact that you can use multiple key_codes:

{
                "description": "'b' -> 'bar'",
                "from": {
                  "key_code": "b"
                },
                "to": [
                  {
                    "key_code": "b"
                  },
                  {
                    "key_code": "a"
                  },
                  {
                    "key_code": "r"
                  }
                ],
                "type": "basic"
}

This is useful for performing basic actions in succession.

Hi guys, there has been a long time since this thread has been posted. Basically the modifier hyper key can be tackled using the KM. But it is still not that compelling comparing with the karabiner before El Cap which provides tons of customizations inside the app.

Thus I want to share a tool that I’m using for sometime, there is one tool that I’m using that can extend lots of functionalities based on the hyper keys using KM. It is called "khd", https://github.com/koekeishiya/khd https://github.com/koekeishiya/khd.

It can have multiple modes that assigns keys for different meanings, like Vim has different modes too. (While sometimes I found it difficult to config some rules in json, the config in khd is easier with less lines of codes.)

In addition, you guys can also try the window manager named "chunkwm" from the same developer that can manage you windows layout using just the keyboard.

Both can be installed via brew for easier update purpose.

On Jan 19, 2018, at 02:41, Panagis Alisandratos <[email protected] notifications@github.com> wrote:

Don't know if this will come in handy, but no one has mentioned the fact that you can use multiple key_codes:

{
"description": "'b' -> 'bar'",
"from": {
"key_code": "b"
},
"to": [
{
"key_code": "b"
},
{
"key_code": "a"
},
{
"key_code": "r"
}
],
"type": "basic"
}
This is useful for performing actions in succession.


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub https://github.com/tekezo/Karabiner-Elements/issues/16#issuecomment-358741679, or mute the thread https://github.com/notifications/unsubscribe-auth/ADKNgjz7MmwzYcx4k-nGfrF0rodXH0S-ks5tL5BKgaJpZM4J-nDt.

https://cloud.githubusercontent.com/assets/143418/17495839/a5054eac-5d88-11e6-95fc-7290892c7bb5.png https://cloud.githubusercontent.com/assets/143418/15842166/7c72db34-2c0b-11e6-9aed-b52498112777.png https://github.com/tekezo/Karabiner-Elements https://github.com/tekezo/Karabiner-Elements/issues/16#issuecomment-358741679

Is double key press supported? Like: CMD+CMD = Ctrl+Shift+A ?

@0x3333 Also wondering about this. Did you get it to work?

@prohtex I didn't . In the end I changed my workflow. But still interested.

An example of changing right_shift x2 to mission_control.
https://pqrs.org/osx/karabiner/json.html#typical-complex_modifications-examples-change-right-shift-x2-to-mission-control

Did the one_to_many_mappings feature from @wwwjfy ever get added back into the main codebase? I was using it on an old build but have just got a new Mac (running High Sierra) and need to recreate this:

"one_to_many_mappings": { "non_us_backslash": [ "left_option", "3" ] }

If it wasn't added, is there a comparable feature in the latest build to map left_option+3 to the § key?

EDIT: apologies, just spotted this issue was closed on 12 March :-/

Was this page helpful?
0 / 5 - 0 ratings