News for hackers. Stuff that matters.
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()