pqrs-org / Karabiner-Elements

Karabiner-Elements is a powerful utility for keyboard customization on macOS Sierra (10.12) or later.
https://pqrs.org/osx/karabiner/
The Unlicense
18.59k stars 835 forks source link

Feature Request: Simulate "holding down" a key #1298

Closed mtwomey closed 6 years ago

mtwomey commented 6 years ago

I'd like to setup a definition which allows me to type "shift-w", which will in turn send the w KeyDown event (but not the KeyUp event). Then when I next hit "shift-w", the w KeyUp event will be sent.

Is this possible?

devvythelopper commented 6 years ago

I would change your question to a feature request:

please add "key_up" and "key_down" in the "to" specification.

I especially need this for caps_lock which might be even trickier than for normal keys...

mtwomey commented 6 years ago

I updated the title.

isadon commented 6 years ago

I am also having a similar issue. I remapped Caps to Escape via this post http://brettterpstra.com/2017/06/15/a-hyper-key-with-karabiner-elements-full-instructions/ but karabiner only processes the caps to escape when I let go of the caps key. This is different than OSX where when remapping Caps to Esc it gets activated on key down and then repeats the escape code. Karabiner also does this if you do a simple remapping of Caps to Esc but In my case I want it to work as a hyper key as well.

Does anyone know how to do this?

stale[bot] commented 6 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

macintacos commented 6 years ago

I would like this as well; would be handy to be able to have my HHKB FN-key mapped so that I can have it "pressed down" until I press the key again.

harrisliupsn commented 5 years ago

This issue is closed? I seem not to see a replay which says this feature is currently considered or anything. If I remember right, we had this feature back in the days when we are using Karabiner. I hope this feature can be realized in Karabiner-Element too, because keep pressing down a modifier key is just so annoying.

Gxraphan commented 5 years ago

This seems to be a key feature. Is there any hack around this at this moment?

oit63 commented 5 years ago

shell_command: osascript key_down 'x', seems the only option

JSpenced commented 5 years ago

@tenhow Can that be used with shift keys too? I was going to try to figure out how to implement mark set mode like was in the previous karabiner.

blza commented 1 year ago

@tenhow Can that be used with shift keys too? I was going to try to figure out how to implement mark set mode like was in the previous karabiner.

This can be done with simple edit of queue.hpp.

Just comment out the call and build. Got my mark mode working.

The idea here is to use Sticky modifiers functionality, but without clearing Sticky state after single keypress. PM me if you need more details on setting up complex modifications.

index b2c70b9..f9874db 100644
--- a/src/share/event_queue/queue.hpp
+++ b/src/share/event_queue/queue.hpp
@@ -77,7 +77,7 @@ public:
       if (event_type == event_type::key_down &&
           validity == validity::valid &&
           !e->modifier_flag()) {
-        modifier_flag_manager_.erase_all_sticky_modifier_flags();
+        //modifier_flag_manager_.erase_all_sticky_modifier_flags();
       }
eytanhanig commented 1 year ago

Can we reopen this?

slezica commented 5 months ago

Given all the other functionality, there's no way to toggle simulating a key being held down when pressing another key (similar to making a key stick)?