News for hackers. Stuff that matters.
Re:New 13-inch MacBook Pro by swang on Monday May 04, 2020 @02:57PM (#23071882)
Everyone keeps talking about vi/emacs stuff. While that was annoying, the more annoying aspect was when macOS softlocked and I was unable to hit the chord (cmd+opt+esc) to get the kill task window because the touchbar froze as well.

Having a virtual ESC key in software that can be frozen, where part of your keyboard chord to kill apps includes the ESC key is really, really, stupid and caused me lots of wasted time that could have been saved had there just been a hard ESC key.

Re:New 13-inch MacBook Pro by geoelectric on Monday May 04, 2020 @03:20PM (#23072168)
Mapping the Caps Lock key to Esc in the modifier remap interface is how I handled this situation (and others with essential ESC). Figured that probably wasn't coincidence that they added Esc to it when the new keyboard was introduced--was as much of a nod to mitigating a bad idea as we got.

But yeah, it was stupid, especially given that software developers are a very visible market for them in the Bay Area. As soon as the 16" came out with an Esc, I ordered one at work and bought one at home so I guess they won, but it's another step towards getting me on a Linux or Windows PC a generation or two down the line.

Re:New 13-inch MacBook Pro by bashinator on Monday May 04, 2020 @08:04PM (#23074844)
This didn't work for those of us who map Caps Lock to Control, like god intended. IIRC, it wasn't possible to map the left Control key to ESC for some reason.
Re:New 13-inch MacBook Pro by geoelectric on Monday May 04, 2020 @08:20PM (#23074946)
I actually use Karabiner now to do Ctrl if held, Esc if tapped. It’s a little tougher to walk people through though:

1) install karabiner elements

2) select complex modifications

3) add rule

4) import more from internet

5) import change caps lock key v4

6) add rule change caps_lock to control if pressed with other keys, to escape if pressed alone

...is my actual current setup, along with a bunch of other key mapping. But I started with what I posted above, which everyone with Mojave+ on a MBP has available already.

Re:New 13-inch MacBook Pro by rrdharan on Monday May 04, 2020 @08:50PM (#23075147)
Is karabiner going to stop working in 10.16? Because of the kext lockdown/deprecation?

I'm very afraid of getting too used to it and then having it stop working.

https://github.com/pqrs-org/Karabiner-Elements/issues/2149

Re:New 13-inch MacBook Pro by geoelectric on Monday May 04, 2020 @08:56PM (#23075191)
I hadn't seen that before, but figures. More and more, a nice Lenovo, Dell, or System76 laptop running Linux is starting to sound really good. Hell, it's got better gaming support than Mac now, with Vulkan.

As far as the immediate concern goes, Karabiner is such a popular thing that I suspect there'll be some way to support it. If not, I won't upgrade. I just bought this MacBook Pro, and it'll probably continue to be usable on 10.15.x for its lifetime. I'm not too interested in my gaming keyboard and 10 key pad becoming unusable, at any rate.

If they actually completely kill software support for this, I guess next best thing would be a USB intermediary to process the key codes. Possible it's doable with a Raspberry PI or something, and there are enough mechanical keyboard enthusiasts on Mac someone would be motivated to do it. Won't help for the internal keyboard though.

Re:New 13-inch MacBook Pro by Wubdidu on Tuesday May 05, 2020 @09:11AM (#23079625)
The USB thingy already exists, I actually own one for macros with dumb keyboards. Its a very small USB-device with a USB port where you can attach standard USB keyboards. It runs QMK and essentially acts as a proxy, allowing you to program macros and what-not directly in QMK. A neat, little gadget.

See https://geekhack.org/index.php?topic=69169.0

Edit: Correction: It actually runs TMK, but I flashed QMK on it.

Re:New 13-inch MacBook Pro by geoelectric on Tuesday May 05, 2020 @03:05PM (#23083579)
Sweet! Thanks for pointing me at that. I have applications where I might be able to use that anyway (PS4 comes to mind).
Re:New 13-inch MacBook Pro by geoelectric on Monday May 04, 2020 @09:07PM (#23075275)
btw, this issue has some "system-supported" ways to do the simple modifications. That at least would let me do a workaround for some of what I'd need to replace (swapping modifier keys, mapping my ten-keypad to arrow keys, etc.)

https://github.com/pqrs-org/Karabiner-Elements/issues/2196

Re:New 13-inch MacBook Pro by gumby on Monday May 04, 2020 @09:34PM (#23075437)
Karabiner also lets you disable the Touch Bar escape so you don’t accidentally trigger it.
Re:New 13-inch MacBook Pro by geoelectric on Monday May 04, 2020 @08:26PM (#23074992)
Re left ctrl, btw, it’s possible now to map ctrl to esc. It’ll map both keys though—-the apple interface doesn’t do left/right.

It’s a “simple modification” (specific type) in Karabiner though, if you use that. I use PC mechanical keyboards so most of my typing devices a) have swapped around mod keys and b) map right ctrl to fn so I can do Mac device hotkeys from pc keyboard.

Re:New 13-inch MacBook Pro by chrischen on Monday May 04, 2020 @03:24PM (#23072219)
Real Vi/emac users don’t use the esc key. It’s way too far frome home row.
Re:New 13-inch MacBook Pro by mellavora on Monday May 04, 2020 @03:53PM (#23072529)
Right! Real vi users have a foot pedal for escape.

:__)

*yes, fingers pointing at me

Re:New 13-inch MacBook Pro by chrischen on Monday May 04, 2020 @05:27PM (#23073507)
I think most people actually remap to the ~ key, or if they're extreme they'll use tab. On my keyboard Escape already came as the ~ key and you have to use fn to access ~ or `.

The ergonomics of moving it closer far outweigh any benefits from it being physical vs touchscreen.

Re:New 13-inch MacBook Pro by tcoff91 on Monday May 04, 2020 @06:46PM (#23074267)
Remap caps-lock to escape and you're good to go! Or remap capslock to control and use Ctrl-[. Or use karabiner and remap capslock to control-when-held and escape-when-pressed-quickly.
Re:New 13-inch MacBook Pro by thedirt0115 on Monday May 04, 2020 @07:19PM (#23074521)
AutoHotkey can do this "caps lock as both escape and control" thing too. I use this, from http://vim.wikia.com/wiki/Map_caps_lock_to_escape_in_Windows :

  ; Author: fwompner gmail com
  #InstallKeybdHook
  SetCapsLockState, alwaysoff
  Capslock::
  Send {LControl Down}
  KeyWait, CapsLock
  Send {LControl Up}
  if ( A_PriorKey = "CapsLock" )
  {
      Send {Esc}
  }
  return
Re:New 13-inch MacBook Pro by dhosek on Monday May 04, 2020 @11:41PM (#23076259)
When I first started using Emacs, I used to joke that with all the various modifiers and prefix keys for escapes that it was just a generation away from needing foot pedals.
Re:New 13-inch MacBook Pro by 1337shadow on Tuesday May 05, 2020 @04:59AM (#23077955)
Or they use ctrl+c
Re:New 13-inch MacBook Pro by elliotlarson on Tuesday May 05, 2020 @11:42AM (#23081229)
Right. I've been a long time vim user and I don't really use the escape key while vim-ing. I use ctrl+c.
Re:New 13-inch MacBook Pro by m463 on Wednesday May 06, 2020 @06:42PM (#23097260)
don't you mean toe pedal?
Re:New 13-inch MacBook Pro by liamdiprose on Monday May 04, 2020 @05:26PM (#23073498)
Mapping the sequence 'jk' to Esc supercharged vim for me. Faster, but also helps me stay in the flow longer.

Run `:inoremap jk <Esc>` to try it out.

Re:New 13-inch MacBook Pro by weaksauce on Monday May 04, 2020 @05:52PM (#23073765)
add in kj too and you can just press both keys at the same time and it will work like it was just one key press. the added benefit is that it's basically a no-op from the standpoint of vim too just in case you were already in normal mode.
Re:New 13-inch MacBook Pro by chrischen on Monday May 04, 2020 @05:28PM (#23073514)
I wonder if any people remap hjkl to jkl;. Having to shift my hands one key over always annoyed me.
Re:New 13-inch MacBook Pro by NoodleIncident on Monday May 04, 2020 @08:44PM (#23075108)
'jk' are on the strongest two fingers on the right hand home row, since that's what you'll be doing the most. 'h' can be hit once or twice with no real effort, but there are better ways to move left and right within a line, such as `bBeEfFwWIA`. I also remap `H` and 'L' to move all the way to either end of the line, but I might be doing it wrong
Re:New 13-inch MacBook Pro by liamdiprose on Monday May 04, 2020 @06:05PM (#23073896)
I just use my index finger for both j and h. Are you used to the arrow keys? I noticed with jkl;, my fingers line up with the arrow-key directions.
Re:New 13-inch MacBook Pro by derefr on Monday May 04, 2020 @06:07PM (#23073914)
On the keyboards vi was designed for, Escape was positioned where the Caps Lock key is now on modern US-101 keyboards. May as well just map it there.
Re:New 13-inch MacBook Pro by PhantomGremlin on Monday May 04, 2020 @11:31PM (#23076190)
I'm puzzled by this claim.

The keyboard for the ADM-3A shows a Ctrl key to the left of A. https://en.wikipedia.org/wiki/ADM-3A#Hardware

The VT100 shows CAPS LOCK to the left of A. https://vt100.net/docs/vt100-ug/chapter1.html#S1.1

So on which visual terminal was ESC to the left of A? Or are you perhaps referring to ex, an antecedent of vi, which was designed for hardcopy terminals? If so, which hardcopy terminal had ESC to the left of A? I've looked at the images for some and can't find that.

Re:New 13-inch MacBook Pro by projektfu on Monday May 04, 2020 @11:45PM (#23076277)
You’re right. Next to Q is correct, still more reachable than it is now. Now Tab is in that position and we’re used to that.
Re:New 13-inch MacBook Pro by james-mcelwain on Monday May 04, 2020 @03:57PM (#23072562)
Some of us just have big hands. :3
Re:New 13-inch MacBook Pro by buttsu_ on Monday May 04, 2020 @03:46PM (#23072453)
i am a real vi user its not too far I use esc
Re:New 13-inch MacBook Pro by pfranz on Monday May 04, 2020 @04:50PM (#23073081)
I think the parent was a bit tongue-in-cheek. It's in reference to the keyboard layout vi was developed with and the fact many vi users are obsessed with keeping their fingers on/near the home row (much like, "a /real/ vi user doesn't use the mouse"). Ctrl-[ is an equivalent to ESC on American English keyboards.

https://dave.cheney.net/2017/08/21/the-here-is-key

https://vim.fandom.com/wiki/Avoid_the_escape_key#Avoiding_th...

Re:New 13-inch MacBook Pro by dillonmckay on Monday May 04, 2020 @05:20PM (#23073415)
This happened to me last week.

I did not notice at first, but I could not reduce the volume, since its control was gone.

Then I tried to restart finder, but the escape key was ‘gone’.

I have an even better story about the one that replaced this (same model).