3 ms·
And no CapsLock at all. Bug or feature?
by JKCalhoun 3y ago
And no CapsLock at all. Bug or feature?
- smodo 3y agoIf you need capslock that’s easy to emulate in software nowadays. For instance KDE has a default option to toggle capslock by pressing both shift keys.
- o11c 3y agoI use that, but unfortunately it's not that easy (also I'm pretty sure it's not KDE-specific - most keyboard stuff even works in the console!). Let's use `xev`'s `state` field for reference: First, `state & 0x10` is NumLock which is the only modifier that's often set. Software knows to mask out this and a couple other modifiers when dispatching keyboard shortcuts. Second, `state & 0x02` is CapsLock. Software that detects CapsLock as a modifier will work correctly with double-shift-as-capslock. Unfortunately, `state & 0x01` is Shift. Software that reads CapsLock as a keysym (often e.g. games that use it as a "turbo" toggle) will often fail, because when double-shift is pressed, the shift modifier has been set. And it's generally considered a bug to ignore modifiers when dispatching keyboard events. Unfortunately, there is no event for just "`state` changed", it is only dispatched alongside some other mouse/keyboard event. If you press just `shift` you'll see that it doesn't update yet for the just-pressed key (and fundamentally cannot due to how it has to work to switch between keycode->keysym mappings).
- zdw 3y agoDefinitely a feature. All the "lock" keys are bugs.
- madphilosopher 3y agoIn my entire computing career, I have never locked my Caps or unlocked my Num! That's how I roll.
- JKCalhoun 3y agoOnly hit caps lock on accident. I used to pry the CAPSLOCK keycap off my keyboards at work.
- ris58h 3y agoI've had CapsLock mapped to Esc for years and haven't looked back. I'm OK with holding Shift.