[HN Gopher] Tell HN: Have just discovered that I can use any key... ___________________________________________________________________ Tell HN: Have just discovered that I can use any key as Ctrl on my keyboard\ Sorry if this is silly but today I have discovered that my (pricey, I know) Ergodox-ez keyboard (but I assume any other "programmable" keyboard should work likewise) allows for any key to be programmed either for "press" or "hold". And after more than a year using an uncomfortable configuration for my wrist (I use emacs a LOT), I have set 'j' to behave as CTRL when hold. And then my mind has blown up. No more weird thumb positions, or elongated pinkies. I had done this with one of the large thumb keys for space when pressed, Meta when hold, but I had never imagined using 'j' (or, say 'f') for that. Author : pfortuny Score : 45 points Date : 2022-04-24 17:17 UTC (5 hours ago) | tlb wrote: | Interesting. Where did you move the J key? Was it hard to relearn | typing prose with Js? | jacobmischka wrote: | I think pressing J is unchanged, only when holding does it | behave as ctrl. That's probably unnoticeable (as an emacs user | and not a vim user :) ). | sph wrote: | That means that 'j' is entered upon key release, while all | other keys are activated upon key press. That slightly | different behaviour on just one key would make me go crazy. | thaumasiotes wrote: | You could easily configure all of your keys to behave that | way with no loss in functionality. The whole concept of | "key press" versus "key hold" assumes that a "press" is | released instantaneously. | tlb wrote: | No loss in functionality, but it adds tens of | milliseconds of delay when typing. | | Also, when using Emacs I often press and release the ctrl | key without completing a control sequence, like when I'm | thinking about scrolling but change my mind. I'd be | splattering Js all through my source files. | thaumasiotes wrote: | > No loss in functionality, but it adds tens of | milliseconds of delay when typing. | | Well, no, it would add zero milliseconds -- and zero | nanoseconds -- of delay. The difference between key press | and key release does not affect typing at all. You're not | waiting to see what happens after you press T before you | go on to pressing I (or whatever letter you're following | it with). | sph wrote: | I disagree. Input-on-key-release feels very bad if you're | used to it being on key press like all computers do. It | feels like the keys are sticky and unresponsive. It's | hard to explain unless you try it. | tlb wrote: | When I'm typing normally, keys are down for around 60 mS | each. Having the software respond at the end of that 60 | mS instead of the beginning adds about 60 mS of delay. | pfortuny wrote: | You only notice the difference when holding a key for auto | repeat, which I almost never do, much less with alphabet | keys. | toast0 wrote: | You may also notice if you're typing a word; say 'jeans' | and you press the e before you release the j. On a | typewritter, you must release the first key before you | press another, or you get a jam. On a computer, you don't | usually have to, but with this configuration, it gets | tricky. If j becomes control when held, you've got to | start buffering key presses when j is pressed, and only | once j is released (or held long enough) can you send the | key presses on. I hope you're not playing a game which | uses j, because your inputs now have jitter. | pfortuny wrote: | No: you use j as always. Only if you hold it pressed, it | becomes ctrl. Astounding. | throwawayboise wrote: | Most operating sytems allow remapping of keys, and at least for | the common modifier keys (shift, ctrl, alt) make it pretty easy. | You don't need an expensive programmable keyboard. | | I remap caps-lock to ctrl on all my computers. Even my Chromebook | allows this. Make Emacs much nicer to use. | pfortuny wrote: | Oh no, this is totally different (I also have an old kinesys at | work and program caps etc. as I wish): here you can turn any | other key into that... Even keys which are usually not part of | a combination. | | The fact that it is expensive has nothing to do with it (I | bought it for my rsi). | rgoulter wrote: | Even for the tap-hold functionality, there is kmonad. | | However, I think expensive keyboards (like the moonlander or | the planck) are worth it for things like "symmetrical" and | "thumb can use more keys than just the spacebar". | pseudosavant wrote: | For those on Windows I have to plug | [PowerToys](https://github.com/microsoft/PowerToys). In addition | to the excellent "Video Conference Mute" it has the best | key/shortcut remapper I've used on Windows. Fully open-source, | but can be downloaded from the MS Store (gets auto-updated) too. | | edit: fixed link | igetspam wrote: | I read the subject and thought "duh" but when I got to the | content... I never would have thought of hold vs press. So | obvious but so not obvious too. | pfortuny wrote: | Exactly what happened to me this afternoon. There is no going | back from this for me... | Terry_Roll wrote: | Its all in the milliseconds, but I think Windows, Settings, | Ease of Access, Keyboard offers more options even though its | designed and intended for less able people to use, it has its | own customisable potential most people overlook. | saidajigumi wrote: | As a software rather than keyboard hack, I've been using and | loving the following setup on macOS: * Remap Caps Lock to Ctrl * | Then use Hammerspoon[1] to map Ctrl(hold) / Esc (momentary press) | | This essentially puts both Ctrl and Esc in a comfortable position | on the home row, probably my favorite "ergo hack" ever. | | [1] http://www.hammerspoon.org/ | bombcar wrote: | https://xkcd.com/1172/ | | CPU-based could be easier. | yewenjie wrote: | Take a look at the ultra compact layouts like Miryouku - it has | six layers and home row modifiers (Shift, Ctrl, Alt, Super all as | tap dance keys on home rows). | | https://github.com/manna-harbour/miryoku | | Before QMK, I used Kmonad and Keyd for getting these advanced | features on any keyboard. | | https://github.com/kmonad/kmonad | | https://github.com/rvaiya/keyd | pfortuny wrote: | Shall take a look, thanks! | eitau_1 wrote: | You can do all kind of weird stuff with xkb on Linux, eg remap | Tab to Hyper but keep Alt+Tab/Ctrl+Tab untouched. | | Also, fuck RMLVO, let live KcCGST. | adamgordonbell wrote: | I did this. Had holds on home row left hand do, ctrl,alt,shift | and Function key and mirrored this with the right hand. | | It became so natural that normal keyboards became hard to use. | canadaduane wrote: | Here is a rundown of Linux key remapping software that I wrote a | few months ago: https://medium.com/@canadaduane/key-remapping-in- | linux-2021-... | | My favorite is keyd, which allows the sort of hold vs press | configuration spoken of. | pfortuny wrote: | Thanks. Someone else has suggested it too. I shall have to take | a look for my work keyboard. | mxmilkiib wrote: | https://precondition.github.io/home-row-mods | pfortuny wrote: | THANKS! | | I am going to try this with my kinesys at work. The ergodox I | have is for home. | cleaver wrote: | I have a keyboard with GMK firmware. This is fairly easy to do. | In combination with layers, my hands don't have to move around | as much. Easier on the tendons and possibly faster. | simion314 wrote: | If you use KDE there is a nice GUI to setup things like this. I | don't use Alt almost ever so I make | | Left Alt -> Ctrl | | Meta ->Alt | | Cpas Lock ->Esc | cameronperot wrote: | I use caps2esc [1] in Linux to remap capslock to ctrl on hold and | esc on tap. It's such a simple yet insanely useful remapping! It | really shines in modal editing (e.g. vim). I assume it's possible | to use the underlying interception tools [2] to do that for any | key without needing a particular programmable keyboard. | | [1] https://gitlab.com/interception/linux/plugins/caps2esc | | [2] https://gitlab.com/interception/linux/tools | adamomada wrote: | I searched for a way to do this on Mac and Windows as well. I'm | going to give it a go. | | [0] | https://gist.github.com/ivyxjc/0ee9b1f37a5abdfbcd8f31db3c10f... | pfortuny wrote: | Yes probably right. | | But the ergodox has such a nice programming interface that it | makes the OS-level configuration pale in comparison. | Galxeagle wrote: | One of the first things I do on new computers is download a macro | software (i.e AutoHotkey(1)) to remap troublesome keys on normal | keyboards. The quick list I have going on this particular laptop: | a) numlock always off(on?) b) remap right alt to be 'function' | key for the f keys that double as volume up/down/mute c) remap | '%' to be ctrl+`, as I use it quite often for autocomplete in a | DB front-end | | (1) https://www.autohotkey.com/ | shrimp_emoji wrote: | > _download a macro software (i.e AutoHotkey(1)) to remap | troublesome keys on normal keyboards_ | | And, on Linux, this is combining `xdotool` with the native | "shortcut" functionality in your desktop environment. ;) | asd88 wrote: | This is part of the fun of customizing a small keyboard. You | experiment with different key layouts until you find the perfect | one for you and learn it, making small adjustments along the way. | I currently use a 36-key Draculad and the most fun customization | was making Cmd+Tab ergonomic (there's no physical Tab key). | AlbertoGP wrote: | On a different programmable keyboard, with a more traditional | staggered layout (the ErgoDox has a columnar layout where where | keys are aligned horizontally) I used that same function but on | Caps-Lock, left of A: press it combined with another key, it is | CTRL; press it alone, it is ESC. | | Programmable keyboards offer so many improvements, it's | incredible. | | Some of that can be done with xinput on Linux, but as far as I | know the different-key-when-held functionality is not available | there. [Edit: yewenjie's comment mentions keyd which apparently | does have that feature! | https://news.ycombinator.com/item?id=31146572] While I waited for | this one to be delivered (was a crowdfunding campaign) I used | that to simulate some of its features and surprised myself when I | found out that I stopped using the dedicated cursor keys even if | all my keyboards had them. | | I had never thought of using J for CTRL. You lose the ability to | enter Line Feed (Return) with CTRL+J which I do use from time to | time, but it sounds intriguing. I might try it out one of these | days. | pfortuny wrote: | I chose j just because I could. | | Why do you lose ctrl-j? There is another ctrl on the left side | of the keyboard. Uh? | AlbertoGP wrote: | > _Why do you lose ctrl-j? There is another ctrl on the left | side of the keyboard. Uh?_ | | :-D Yes indeed, you are absolutely right. I had assumed that | those keys would be used for something else but nothing stops | you from having several CTRL keys. | brhsagain wrote: | Here's my setup on a standard Apple Magic Keyboard: | caps lock -> ctrl tilde -> escape left ctrl | -> tilde | | I borrowed this from the Happy Hacking Keyboard layout and | haven't looked back since. I can now press escape with my left | ring finger (right next to '1'), ctrl with my left pinky (right | next to 'a'), and when I do need to type a tilde or backtick (not | often) it's right under shift. On some keyboards I also map | backslash to backspace and vice versa, to bring backspace closer. | No more finger stretching! | jbverschoor wrote: | That's where the ESC used to be on the MSX.. | https://www.msx.org/wiki/images/6/6b/Nms8245a.jpg | chrononaut wrote: | I haven't used a Happy Hacking Keyboard, but why not left ctrl | -> escape and tilde remains tilde? Perhaps it's just my hands | but I feel reaching left ctrl is easier than reaching the tilde | key, and I imagine hitting escape is more frequent than tilde | (?) | pxx wrote: | I don't know about remapping ESC at all. You can get it by | typing ^[ instead. | brhsagain wrote: | Hmm, it's the opposite for me, somehow reaching my ring | finger toward tilde just feels easier than curling my left | pinky downward toward left ctrl. Plus my muscle memory is | used to moving up and to the left to find escape. | yodsanklai wrote: | I don't get it. There's already a ctrl on the left reachable | with left pinky. What is missing is right-ctrl which you often | need (tmux, vim, emacs...). | dreen wrote: | I became an unwilling victim of such feature in my Razer gaming | keyboard. | | One day a friends child was visiting and I put some games on for | her. The little bastard somehow reprogrammed the 'r' key to empty | macro, it took me weeks to find out what it was. | ZaneD wrote: | This is a great tip. I've had semicolon mapped to Ctrl when | 'held' for the past year or two and it's worked well for me. | | I don't have a fancy keyboard so I have to do it in software. | | My AutoHotkey script for Windows (modification of something I | found online): | https://gist.github.com/zanemayo/f4ff05a83630b70ea32116e761c... | | My Karabiner Elements config for Mac OS: | https://gist.github.com/zanemayo/04690de0a6f9783dad5a98aad5b... | pfortuny wrote: | All: thanks for the great feedback. | | I have also used all the linux/mac tools for other keyboards but | honestly, everything pales in comparison with ergodox's | configuration tool and with being able to program ordinary keys | and see it work BANG like that. I just wanted to share this | because honestly it blew up my mind. | TacticalCoder wrote: | I'm using a very custom keyboard configuration and I'm doing all | my config using Linux's xkb (X Keyboard Extension). | | I'm for example using "modifier + ijkl" to send actual arrow key | codes so I don't need to move to the arrows key cluster. It's not | unlike gamers using wasd or esdf: ijkl mimics the arrows keys | cluster. It just "makes sense". The modifier is always under my | left thumb (I'm using a japanese keyboard, so the space bar is | very narrow and I'm using the key at the left of the spacebar as | the modifier for ijkl (and for other shortcuts). This is sweet | because as actual arrows key code are sent, this works in every | single program as if the arrow keys were actually pressed. I'm | sure it can be even better: say by doing it at the keyboard | controller level, bypassing the OS entirely but what I have works | well enough for me. | | Another trick: a modifier dedicated only to my window manager. | Anything I need to do that is related to the WM gets done using a | dedicated modifier. Never clashes with any single program. Bliss. | | I do other cute things: OP mentioned using Emacs a lot... I | configured things I use in Emacs all the time, like ivy / avy, to | never require the pinkies (I removed the keys supposed to be | pressed by pinkies from the list of available candidates). | | Stuff like that. I spend countless hours on my keyboard setup | and, to me, it's perfect. I did that years ago and since then I'm | a happy camper. | | > And then my mind has blown up. | | Then I have one for you: you can use something else than ctrl to | do ctrl-x in Emacs, using ctl-x-map. I'm using "key at the left | of my tiny space bar + ." to do what ctrl-x does. No pinky and | both hands are used (instead of doing left hand for ctrl and left | hand for x). | | > No more weird thumb positions, or elongated pinkies. | | I don't really understand how you can get weird thumb positions | on an ergodox though... | hsbauauvhabzb wrote: | I use Dvorak and work on a diverse range of systems (rdp, | Citrix, vms, etc). The biggest technical problem is random | software not respecting your host OS key map. I also get bad | knots in my back from unsplit keyboards. | | Buying a dygma raise after two failed ergodox attempts (meaning | my split keyboard attempts are probably close to $1500aud) was | absolutely worth it. It solved both issues, the former by | supporting programmability. I can also move the keyboard to | random computers without issues. | | Please consider buying a programmable keyboard instead of X11 | hacks, i say this as someone who put up with the problems for a | decade. | hsbauauvhabzb wrote: | Is there any applications for Linux which allow remapping | keybindings on a per-application basis? I'd kill to remap | chrome/FF keys, but afaict both browsers don't allow this. ___________________________________________________________________ (page generated 2022-04-24 23:01 UTC) |