Live data from Hacker News

Ask HN: Does anyone use keyboard/mouse extra buttons for coding?

news.ycombinator.com

1–10 of 160 posts

Ask HN: Does anyone use keyboard/mouse extra buttons for coding?

#1
Usually gaming mice have a few extra buttons that can be mapped and some gaming keyboards have extra keys for mapping/chaining functions to them in games. Of course there is also the world of people that build custom keyboards. Has anyone used these extra buttons/keys for programming uses? Is it helpful and what are the details?

Re: Ask HN: Does anyone use keyboard/mouse extra buttons for coding?

#2
Sometimes I get frustrated with the button combinations that I have to press over and over again.

I don't do it every day, but creating a macro can help a lot in that situation.

I have a lot of Razer gear and also a few pieces of Cooler Master gear.

The real frustrations I have though involve disabling or changing buttons in deeper ways. For instance, I love the alacritty terminal, but it uses ctrl+shift+c and ctrl+shift+v to cut-and-paste. One of those buttons opens the dev tools on my browser, which I could tolerate if it didn't also scroll the browser to the top, losing my place. So disabling keys or remapping them in applications helps.

Another pet peeve is that I fat finger the "insert" button on a laptop keyboard about once per minute so it is a candidate for disabling. Tools from the likes of Razer and Cooler Master only work with their gear, even Alienware's tools only work on the extra buttons and not on your existing buttons. So you need something like

https://github.com/microsoft/PowerToys

As for the mouse the value of remapping buttons is more limited IMHO since the act of pressing a button will usually cause a little bit of motion and screw up the alignment of what you were doing.

Re: Ask HN: Does anyone use keyboard/mouse extra buttons for coding?

#3
I have an Ergodox Moonlander on which I have a few of the macro keys mapped to specific functions within PyCharm like auto-formatting, linting and type checking.

It’s helpful because I don’t have to remember key combinations and it means much faster feedback (and fewer broken builds).

Re: Ask HN: Does anyone use keyboard/mouse extra buttons for coding?

#4
I have a Dygma Raise which is a ~60% keyboard and uses layers. My layer 2 is full of useful macros. I need macros even for the keyboard arrows because my Keyboard doesn't have arrows (arrows are layer2+hjkl or layer2+esdf). I also make heavy use of custom mappings in Vim and Bash aliases.

I have a macro for ctrl+shift+v on my Keyboard since it's the Evolution (Linux mail app) shortcut for moving emails. I also have macros for ctrl+alt+left and ctrl+alt+right to switch desktops more easily.

I have a vim macro "ji" that does ":e src/dir/i-always/go/to/prefix_" and "jv" that does ":e src/other/common/dir/filename_prefix_". Also "r" types "Reviewed-by: dyingkneepad ".

I also sometimes think about implementing a keyboard macro that does a BnB combo in Skullgirls :). Maybe one day lol, but that's cheating and I wouldn't do it online (also I'd get screwed on whiff or block). Maybe I could use just Xautomation for that (that uses libXtest).

But the most useful of all, by far: alias s='cd ..'

Re: Ask HN: Does anyone use keyboard/mouse extra buttons for coding?

#5
I’ve really taken to hyper key idea on the Mac. It’s basically a shift-Control-command-option combo bound to caps lock, together with the escape key. Tapping on caps lock generates esc for all your Vim/evil needs, while holding caps and another key results in a pretty unique key combo that I’ve never had clash with anything else.

Super handy.

https://brettterpstra.com/2016/09/29/a-better-hyper-key-hack...

Re: Ask HN: Does anyone use keyboard/mouse extra buttons for coding?

#6
I map the forward/back buttons to "Go Back" and "Go Forward" in Visual Studio Code. If I cmd+click a method or variable, I can press back to go back to where I was.

Technically I used the logictech software to map those buttons to "ctrl+-" and "ctrl+shift+-" which are the keybindings for those actions.

Re: Ask HN: Does anyone use keyboard/mouse extra buttons for coding?

#9
I'm doing web development on a Mac. Here are some tools I've found useful.

----

1. Universal keyboard shortcuts

I was using an application called ControllerMate with my Microsoft Natural Ergonomic Keyboard 4000.

I set up a bunch of hotkeys and such, and basically used the software as a translation layer. My best example follows. When I pushed the 'calculator' button on the keyboard, it would check which application was running (Chrome, Safari, Firefox, Vivaldi, etc, or Visual Studio Code) and send the appropriate keyboard shortcut to it to open the JavaScript console (or the Terminal in VS Code). I might've even set it up to start an actual Terminal and switch to it if none of those applications were running.

Likewise, I had a button to go directly to Search in relevant applications, and used the 'Zoom' keys to zoom in or out (again, ControllerMate would intercept the special key, and then change it to the appropriate shortcut for the running application).

This was great. I gladly paid for it. It doesn't work with the most recent versions of macOS :-(

----

2. Switching between applications

I use an application called Contexts to let me switch between applications quickly. For example, I'll set one browser window up as being accessible using Command-1, and an editor window that can be brought up using Command-2.

I often have dozens of windows up, and when I start doing this, I'll usually use about four shortcuts for different applications, and it can be darn handy.

----

3. Window management

I use an application called BetterSnapTool. I've got it set up so that if I press the left Command key and a number or symbol on my numeric keypad, that it'll move and size windows. This lets me put two windows side-by-side almost instantly, for example, or, indeed, four windows in different quadrants of the screen, or one taking up one third of the display and another taking up two thirds.

(I am usually using multiple monitors, where this is less useful, but I do usually remember that I love it if I'm screen sharing and limited to one display).

Re: Ask HN: Does anyone use keyboard/mouse extra buttons for coding?

#10
I use a mouse with 3 extra buttons.

2 are for copying and pasting, and 1 is for activating a programmable tooltip.

Here are the apps to achieve above (I built them):

1. Mouse config tool for Mac https://github.com/tanin47/noo

2. Programmable tooltip for Mac https://github.com/tanin47/tip

This makes me very productive mechanically.

Post reply on HN