ntrysii · 2022-08-29 21:56
Hi guys, hope you all doing fine. I was wondering about a way that makes emacs recognize a key hold,
so can i for example create a program that for example when the space bar is pressed and hold then i press another key with it, it would send some Unicode character that i dont use or such a program is impossible.
I'm sorry i have no idea about the topic so excuse my ignorance
i use ubuntu 20.04 by the way.
aptmnt_ · 2022-08-29 22:52
Would be nice, could implement hold ctrl and press tab for cycling through buffers.
arthurno1 · 2022-08-29 23:15
> Would be nice, could implement hold ctrl and press tab for cycling through buffers.
(define-key global-map [C-tab] #'next-buffer)
But it's a bad idea. Minor modes might redefine the tab (for example Yasnippet) and they will have precedence over global tab so it won't work that well.
aptmnt_ · 2022-08-29 23:16
Can't hold down and repeat press to cycle (like in intellij idea) and release to select.
arthurno1 · 2022-08-29 23:25
> Can't hold down and repeat press to cycle
Have you tried? You can keep Ctrl pressed with pinky and press as many different keys as you prefer. When I press C-x C-f I don't move my pinky off the Ctrl key. Same with C-tab. Press Ctrl and keep it pressed, while you press tab repeatedly. But I wouldn't use it, as said, it will clash with some minor modes and might be confusing.
> (like in intellij idea) and release to select
I have never used intellij so I have no idea what you are talking about there.
ieure · 2022-08-30 00:14
No. Emacs only recognizes key chords if they use one of the built-in modifiers -- shift, control, meta, alt, super, or hyper. You can't chord two arbitrary keys. You could use lower-level X11 key mapping to change a key to one of the less-used modifiers, and bind ex. Alt-Space to do what you want.
You could also get a mechanical keyboard which runs QMK, which opens up a lot of possibilities for macros and chording.
thetemp_ · 2022-08-30 02:46
You want https://github.com/kmonad/kmonad.
agg_sig_me · 2022-08-30 06:52
Makes me think of this: https://xkcd.com/1172/
arredi · 2022-08-31 00:11
You could either use the mouse because it recognizes a press as opposed to a click, or use timers to detect if another key in a window has been pressed this used to detect key cords, an example might be which key.