News for hackers. Stuff that matters.
Re:Toward a More Useful Keyboard by notbeuller on Wednesday June 14, 2023 @02:46AM (#36322306)
Remapping the non-locking caps lock to control is a no brainer - and if you train yourself to use control-[ to get ESC, then you don’t have to leave the home row. (us keyboard - not sure how that works out in other locales, but caps lock should be eliminated everywhere. Or at least require turning two simultaneous icbm style launch keys to engage.)
Re:Toward a More Useful Keyboard by tincholio on Wednesday June 14, 2023 @02:59AM (#36322409)
I've been using the CAPS LOCK as both Control (on hold) and Escape (tap) for years now, and it's just wonderful. I even kept a similar setup when I built my Dactyl Manuform (one of the large thumb keys is both Control and Escape).
Re:Toward a More Useful Keyboard by grimborg on Wednesday June 14, 2023 @05:24AM (#36323425)
I did something similar, but I mapped it (on hold) to cmd + control + option + shift so it effectively becomes a new modifier key that I use to define shortcuts that will never clash with any existing shortcuts. I use it to launch / switch to specific apps, move windows, etc.
Re:Toward a More Useful Keyboard by lylejantzi3rd on Wednesday June 14, 2023 @06:18AM (#36323769)
If I were ever to design a keyboard with a thumb cluster, I would separate out ctrl and esc to separate keys. When typing quickly, I occasionally get an esc when I wanted ctrl. I've tried fiddling with the delays, but I've never gotten it to work quite right 100% of the time. I suspect my timing (how long I hold the caps lock button) varies depending on what I'm doing and how fast I'm typing.
Re:Toward a More Useful Keyboard by Woeps on Wednesday June 14, 2023 @10:57AM (#36326971)
Oh my.... I never thought of this. but then again, I use the side of my palm for holding control.
Re:Toward a More Useful Keyboard by EsportToys on Wednesday June 14, 2023 @03:07AM (#36322470)
With the TPMouse script, I implemented the activation shortcut as [LShift][RShift][C (trackball mode) / G (grid mode) / Q (quit)], which I felt had a nice balance between deliberateness and easy-to-reach (since you are using it with your hands on homerow).

Though because some keyboards have key rollover issues with using both Shifts, [Capslock][<modekey>] is also allowed as an alternative activation shortcut.

[0] https://github.com/EsportToys/TPMouse

Re:Toward a More Useful Keyboard by rgoulter on Wednesday June 14, 2023 @04:22AM (#36323040)
> caps lock should be eliminated everywhere

Caps Lock can be a useful feature. e.g. developers may want to type CONSTANTS_LIKE_THIS; and it's useful to be able to have a "shifted mode" which avoids the need for either alternating shift keys, or holding shift key with a pinky finger.

I saw a feature "Caps Word", which automatically returns to the unshifted state as soon as a non-letter key (like space) was pressed. That seems a good idea.

That said, yeah, Caps Lock isn't so useful that it's worth putting where it is on typical keyboards.

Re:Toward a More Useful Keyboard by orthoxerox on Wednesday June 14, 2023 @05:28AM (#36323463)
You still need to press Shift to type the underscores, unless the editor is smart enough to recognize you're in CONSTANT_TYPING_MODE.
Re:Toward a More Useful Keyboard by rgoulter on Wednesday June 14, 2023 @06:06AM (#36323687)
With CapsLock? Yeah.

Though, with using fancy keyboard-remapping software, then "dashes as underscores" can be done automatically. e.g. QMK does it with: https://docs.qmk.fm/#/feature_caps_word

Re:Toward a More Useful Keyboard by bbor on Wednesday June 14, 2023 @09:23AM (#36325529)
Shoutout to vim - select the text then shift+U. Especially nice cause you can use multi select to do it in many places at once. I bet eMacs can’t do that ;)
Re:Toward a More Useful Keyboard by ngai_aku on Wednesday June 14, 2023 @09:48AM (#36325885)
Careful now —- probably even easier with emacs!

https://www.gnu.org/software/emacs/manual/html_node/emacs/Ca...

(Though I use emacs with vim keybindings — evil mode — so I do the same as you)

Re:Toward a More Useful Keyboard by bbor on Wednesday June 14, 2023 @10:16AM (#36326334)
Very glad you responded kindly, I realized after I posted that that the sarcasm might not be clear. I feel like we’re two soldiers from some long forgotten war, finally shaking hands… ;)
Re:Toward a More Useful Keyboard by deathanatos on Wednesday June 14, 2023 @09:34AM (#36325671)
Someone always objects to the removal of caps lock with this complaint on these threads.

Two-shift caps lock is a feature whereby tapping both shift keys, simultaneously, toggles caps lock.

You don't need the caps lock key, and its place on the home row is absurd.

Re:Toward a More Useful Keyboard by MSFT_Edging on Wednesday June 14, 2023 @09:41AM (#36325784)
I did the two-shift mapping on my old chromebook and it was very useful. I didn't want to lose the caps-lock as super functionality.
Re:Toward a More Useful Keyboard by rgoulter on Wednesday June 14, 2023 @09:46AM (#36325860)
Ah, I'm not saying Caps Lock key is in a good spot. I'm just saying that CapsLock is sometimes a useful mode to use. -- e.g. as you say, if you can activate it some other way, it can still be useful; and there are other features which are similar and useful.

I do think "replace caps lock with ctrl" isn't the best, though. -- Especially if you've got a mind for staying on home row, then I'd instead suggest putting the modifiers Shift/Ctrl/Gui/Alt as tap-hold keys underneath the home row keys.

Re:Toward a More Useful Keyboard by mrandish on Wednesday June 14, 2023 @02:58PM (#36330851)
> Caps Lock can be a useful feature.

Being a Windows user I have an AHK script I run on every PC I work on regularly. It remaps Caps Lock into a special modifier key but does so in a conditionally timed way which keeps Caps Lock working as it normally does as an on/off toggle - but only when pressed and released by itself. If I use Caps Lock like a modifier key by holding it down and hitting another key simultaneously then Caps Lock works like a modifier - which I use to remap other home row keys like arrows etc.

This works transparently while giving me another very useful modifier key right on the home row without giving anything up. It's especially useful on laptops where I don't have extra modifier keys like my custom desktop keyboards but I now use it everywhere. Here's the relevant chunk of AHK script:

  CapsLock::
   KeyWait, CapsLock                      ; wait for Capslock to be released
   KeyWait, CapsLock, D T0.2              ; and pressed again within 0.2 seconds
   if ErrorLevel
   return
    else
   if (A_PriorKey = "CapsLock")
      SetCapsLockState, % GetKeyState("CapsLock","T") ? "Off" : "On" 
  return

  *CapsLock::
  return

  #If, GetKeyState("CapsLock", "P")   ;Your CapsLock hotkeys go below
   i::Send {Up}
   j::Send {Left}
   k::Send {Down}
   l::Send {Right}
   m::Send {End}
   u::Send {Home}
   y::Send {PgUp}
   n::Send {PgDn}
   h::Send {BS}
   `;::Send {Delete}
   -::Send {–} ; Alt+Minus = En dash
   =::Send {—} ; Shift+Alt+Minus = Em dash
   a::^a
   Space::Enter
   q::PrintScreen
   r::F5
   s::Browser_Back
   d::Browser_Forward 

  Capslock & LButton::WindowMouseDragMove()
  Capslock & RButton::WindowMouseDragResize()
Re:Toward a More Useful Keyboard by l-p on Wednesday June 14, 2023 @04:51AM (#36323216)
> caps lock should be eliminated everywhere

Caps Lock is a necessary feature.

I need my ÉÈÀÇ and I never could get a compose key working in all inputs, Caps Lock is the only reasonable alternative.

Re:Toward a More Useful Keyboard by teroshan on Wednesday June 14, 2023 @05:25AM (#36323440)
If you're in need of AZERTY-specific keys and you're on a QWERTY layout, take a look at https://github.com/qwerty-fr/qwerty-fr.

It's a strict superset of QWERTY, and it enables entering e.g. è and È with altgr+e and shift+altgr+e respectively.

Re:Toward a More Useful Keyboard by piaste on Wednesday June 14, 2023 @06:13AM (#36323731)
US-intl can do that just fine, though some people can't stand dead keys.
Re:Toward a More Useful Keyboard by Symbiote on Wednesday June 14, 2023 @12:03PM (#36327969)
Whether dead keys are acceptable or not depends heavily on how frequent they are in the language.

The Danish keyboard layout has ¨, ^, ´ and ` on dead keys — those are used in foreign names and a few loanwords — but Æ, Ø, Å are real keys.

Having Å, Ø and Æ as dead keys would make as much sense as having V, K and J as dead keys in English.

Re:Toward a More Useful Keyboard by piaste on Wednesday June 14, 2023 @01:22PM (#36329264)
I use it to type in Danish and Italian, as it happens (plus Swedish and French every now and then).

Æ, Ø, Å aren't dead keys, they're available via AltGr + Z, L, and W respectively. However, Italian and French accented letters (as well as Swedish/German Ä/Ö) are available via either AltGr or dead keys - and I find myself almost always using dead keys, perhaps because they are more "logical" so I learned them faster.

And of course, typing any kind of quote is a dead key in every language (quote followed by spacebar).

By now, after so many years, dead keys are well in muscle memory so they feel barely any slower to type than regular two-key combos (like uppercase letters).

Re:Toward a More Useful Keyboard by awesome_dude on Wednesday June 14, 2023 @04:56AM (#36323244)
> caps lock should be eliminated everywhere

BUT HOW CAN I ARGUE ON THE INTERNET WITHOUT IT????????

Re:Toward a More Useful Keyboard by bbor on Wednesday June 14, 2023 @09:25AM (#36325565)
I find it honestly hilarious that “don’t use caps lock for emphasis” is one of the otherwise very-abstract Hacker News Guidelines. A relic from the great flame wars of the past, I think…
Re:Toward a More Useful Keyboard by thomastjeffery on Wednesday June 14, 2023 @09:55AM (#36326001)
Put the shift key where it belongs: under your thumb.
Re:Toward a More Useful Keyboard by bjoli on Wednesday June 14, 2023 @11:21AM (#36327341)
I know it is a joke, but: In Linux it is easy make pressing both shifts into capslock.
Re:Toward a More Useful Keyboard by destructionator on Wednesday June 14, 2023 @09:16AM (#36325440)
Caps lock is great when you are typing one-handed.
Re:Toward a More Useful Keyboard by ricardobeat on Wednesday June 14, 2023 @10:04AM (#36326139)
Not a pianist, but I also don't get the obession with the home row. I can snipe the ESC key with my left ring finger faster than pressing that key combo.

My wrist barely moves for that action, and I haven't had RSI yet after 20 years. I do play the guitar though so maybe that gives me some extra dexterity?

Re:Toward a More Useful Keyboard by koprulusector on Wednesday June 14, 2023 @10:12AM (#36326274)
I don’t use <CTRL> very often, if I think about it, maybe to open and close tabs in a browser or something. But I really liked “tap caps locks for <ESC>, hold for <CTRL>.”
Re:Toward a More Useful Keyboard by vaccarium on Wednesday June 14, 2023 @03:26PM (#36331239)
Caps Lock makes for a wonderful layout switcher key.
Re:Toward a More Useful Keyboard by throw10920 on Wednesday June 14, 2023 @08:50PM (#36335005)
inoremap jk <esc> is even more optimal - it's extremely easy to type (in QWERTY, it's under the two strongest fingers you own aside from your thumbs), very fast, and minimally invasive (unless you frequently type the string "jk").