TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Understanding Keyboard Events Better

68 pointsby kugurerdemover 1 year ago

6 comments

dbolgheroniover 1 year ago
This is common knowledge already, but the Esc key to change modes was chosen because it made sense when used in ADM-3A[1], which was the terminal used to develop the initial vi version.<p>Although many people today use Caps Lock for this, the Esc in these terminals was originally in Tab&#x27;s position.<p>[1] <a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;ADM-3A" rel="nofollow noreferrer">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;ADM-3A</a>
评论 #38532600 未加载
评论 #38531269 未加载
评论 #38533200 未加载
sesmover 1 year ago
That&#x27;s one of the reasons why custom keyboards are in demand: you can do all the remapping on firmware level (QMK, etc) and they will work in any application and any OS.
评论 #38530484 未加载
评论 #38530256 未加载
评论 #38530675 未加载
crq-ymlover 1 year ago
When it&#x27;s an input event in Linux, and you want direct control over what it does, it ultimately ends in writing a daemon with libevdev to get the device event. At least, that is what happened to me last time.
评论 #38529583 未加载
评论 #38530537 未加载
emoIIover 1 year ago
I’ve recently spent some time working with terminal emulators in raw mode on macOS. While I chose to handle key events using escape codes, and found it seriously difficult (even gave up) to process the shift modifier key. However, I came across xquartz [1], which seems to do similar things as mentioned in the article. Would detecting shift key state have been trivial using such a library?<p>[1] <a href="https:&#x2F;&#x2F;github.com&#x2F;XQuartz&#x2F;XQuartz">https:&#x2F;&#x2F;github.com&#x2F;XQuartz&#x2F;XQuartz</a>
评论 #38528347 未加载
_hyttioaoa_over 1 year ago
I wrote a more elaborate remapping a while ago and loved having more modifiers that allowed me to have arrow keys and ctrl+shift on my homerow. But the way the keyboard is handled is a bit of a mess in linux, especially now that Wayland is used for some applications. Like my terminal would not use the modified keyboard config.<p>I also regularly switch between keyboard layouts and when I switch from eg. Chrome to the terminal the keyboard layout changes.
kugurerdemover 1 year ago
I&#x27;ve just finished writing an essay where I talk about my recent experiments with X and managing keyboard events. If you&#x27;ve had similar experiences or have any thoughts to share that could help clarify things even more, I&#x27;d really like to hear your thoughts.
评论 #38530546 未加载