News for hackers. Stuff that matters.
Re:In Praise of AutoHotKey by airstrike on Tuesday May 12, 2020 @11:18PM (#23163106)
Having used both Hammerspoon and AHK, the latter is somehow both terser and more ergonomic. I miss it dearly when I'm not on Windows.

And I actually use caps lock as a "fn" key for hjkl/arrows. Who needs caps lock, really?

I've actually gone kind of crazy with this idea and made my left ctrl, shift and alt behave as fn+ctrl, fn+shift and fn+alt, so that e.g. left ctrl+h actually does ctrl+left. Then I made fn+[ = pgup, fn+] = pgdn, fn+; = home, fn+' = end and fn+\ = delete, with the same augmented fn+LHS modifiers.

Took me about a week for the muscle memory to catch up and allow me to correctly hit ctrl+L with the right hand when I want to go to the address bar, but now I'm ridiculously fast moving around in Excel without having to touch the arrow keys.

Only downside is I have a relatively problematic left wrist and this set up added to the already LHS stress to the already very imbalanced qwerty layout, so it forced me off mechanical keyboards to a low profile logitech right around the time COVID-19 hit.

If only Excel had vim bindings!!

Re:In Praise of AutoHotKey by konfekt on Wednesday May 13, 2020 @05:10AM (#23164988)
For Excel on Microsoft Windows, there is vim_ahk [1] to add Vim key bindings (after adding EXCEL.EXE to VimGroup) using AutoHotKey. For LibreOffice, especially its spreadsheet calculator Calc, there is the vibreoffice [2] extension.

[1] https://github.com/rcmdnk/vim_ahk#applications [2] https://github.com/yamsu/vibreoffice

Re:In Praise of AutoHotKey by lstamour on Wednesday May 13, 2020 @04:23AM (#23164750)
You can use Quick Actions (formerly Services) to trigger Mac automations, with customized Keyboard Shortcuts and text input replacements but it’s all scattered across a dozen apps and it’s kind of clunky to piece a workflow together from all these parts. But if you know the ins and outs, there’s a lot you can accomplish from a Mac, particularly as macOS has historically had better app support for AppleScript and somewhat better accessibility tooling. http://www.macosxautomation.com/automator/services/extension...

Recent attempts to lock down the system point to how it’s “not the default” to customize your Mac outside the App Store. And I find the share sheet is still more useful on iOS than on macOS (for now?) just as Finder is more useful on macOS than Files app is on iOS.

That said, Windows Terminal and WSL highlight that Microsoft isn’t slowing down here and Apple might actually need to play catch-up at some point and evaluate new approaches to developer and power user pain points. (AppleCare-supported upgradable storage is on my wish list but that’s not technically the software’s fault... just a policy Apple used to have and then later removed from their website as they moved to proprietary SSD controllers)

Re:In Praise of AutoHotKey by slightwinder on Wednesday May 13, 2020 @04:30AM (#23164797)
> And I actually use caps lock as a "fn" key for hjkl/arrows. Who needs caps lock, really?

Caps Lock is quite useful, because it's the perfect location for remapping the Ctrl- and ESC-Keys. Which is no surprise, as they originally where located there.

Under linux there is a nice tool for overloading keys, so they behave one way when pressed short, and another way when holded longer. With programmable keyboards you even have it OS-independant.

Re:In Praise of AutoHotKey by manishjhawar on Wednesday May 13, 2020 @05:11AM (#23164995)
> Under linux there is a nice tool for overloading keys...

Name please (TIA)

Re:In Praise of AutoHotKey by slightwinder on Wednesday May 13, 2020 @05:34AM (#23165117)
Oh, right. I knew I forgot something.

I use https://github.com/alols/xcape for some while now. It's old, reliable and straight forward, just does it's job. Only downside is that it seems to be limted to X11. Not sure how well it will play with wayland.

There are now also some alternative tools, with more ability, which allow overloading just on the side. I have them on my list for a while now, but not done much yet with them.

- https://github.com/david-janssen/kmonad

- https://github.com/mooz/xkeysnail

- https://github.com/snyball/Hawck

Oh, and for rermapping capslock there are also options with X11. I use

   setxkbmap -option ctrl:nocaps
to map ctrl to capslock, then overload it with

    xcape -e "Control_L=Escape;"
to add ESC ontop.
Re:In Praise of AutoHotKey by valerij on Wednesday May 13, 2020 @07:10AM (#23165672)
oh yeah. i remapped it to f15 and use it all the time now