Touchcursor using QMK/VIA

i just received one of these Keychron QMK/VIA beasts. I’ve opted for the Keychron K9 Pro, for reasons i’ll likely go into in too much depth about. i couldn’t find a guide on setting QMK up to act like Touchcursor, hence this guide on setting up your QMK keyboard via VIA (why not give VIA an un-googleable name), to have a TouchCursor-like keymapping.

Background

I’ve been using the Keychron K7 65% ultraslim wireless keyboard for maybe 2 years now, it’s been very handy for switching between macbook & dell windows machine. at the same time i came across touchcursor, presumably that’s why you are on this page, but to summarise, touchcursor allows you to keep your fingers in the home position while typing. it uses the space bar as an extra modifier key when held with another key. you can set the arrow keys on I,J,K,L which which allows you to controls the cursor position without moving. it fucking rules, i’m sure there are other exotic configurations that also rule, but this has been a real typing speed up for me as i make a lot of mistakes.

Software TouchCursor

  • windows you can just install the old TouchCursor binary, and it will have the main functionality.
  • Macos proved slightly more difficult, but possible using Karabinar keymapper + the “complex modification” TouchCursor. this is ok, but due to the nature of how the space bar is turned into a modifier key, there are some unexpected results during combinations. Mainly, space needs to be held before any other key is depressed, but i’ve lived with this for a couple of yeas now.
  • Linux well it’s an incredibly unpolished experience, but we’re used to that in linux right? meh. you can build touchcursor-linux from source. i had a pain in the ass, with keeping it working when bluetooth connected and disconnected, sort of usable by creating shortcuts to restart the daemon.

Enter QMK / VIA… Hardware TouchCursor

So with hardware key remapping using QMK, your keyboard is programmable and holds the TouchCursor remaps. you can connect your keyboard to any device and touchcursor will just work, even on phones or BIOS screens! how awesome is that?

keychron k9 pro

VIA is just a way of communicating with QMK in a user friendly way. there were a couple of annoying parts to discover in order to get my k9 connected:

  1. the via app (https://usevia.app) only works on Chrome browser.
  2. the keyboard isn’t recognized yet (might be when you read this) so i needed to manually load the keymap file from the product page.

How to emulate TouchCursor

OMG. so much preamble. glad you just skipped straight to this section.

So i’m going to do this in 2 steps.

Step 1 create a layer with the TouchCursor layout

the K9 uses 5 layers:

  1. main mac qwerty layout (switch on back)
  2. main windows layout (switch on back)
  3. mac media keys (fn key in mac mode)
  4. windows media keys (fn key in windows mode)
  5. Function keys (fn1 key in both modes)

so the Function key layer is basically empty. it just has a row of function keys for the number, and a battery key. i filled some of the keys up like this for our TouchCursor layout:

work in progress

this is a work in progress, as you can see i haven’t quite decided on the Esc key placement, and might do something with the left hand, but this is all now accessible by holding the fn1 aka MO(4) key on the K9. this is our touchcursor layer. we could just use this as is with the fn1 key, but that key is not in our finger/hand “home position”, also:

wtf!? i wanted the space key as modifier you asshole. calm down and read step 2…

Step 2. set up the space bar as a modifier key

this took a bit of research, but essentially you want to use a layer tap to use the space key as normal (single tap) and as a modifier (hold). as far as i can deduce this is done with a timer on the space bar press time, but we dont have to worry about that, just configure the built in stuff! Here’s how you do it:

  1. in VIA, select the space key in your OSes main qwerty layout layer
  2. go to “special” and attach it to “any”
  3. at this point you should have a text box open looking for custom codes, type in LT(4,KC_SPC)

what the hell was that? LT means it’s a layer tap. so it’s switching between layers. 4 is the layer we want to hold, and we want a space character for taps KC_SPC.

well that was easy now wasn’t it? aren’t you lucky i did all the hard work for you?

Further work…

Hold speed for layer tap

so i’ve noticed the later tap can be a little slow to kick in for me. AFAICT this cannot be adjusted via VIA, so we would likely need to go deeper and start compiling our own QMK firmware i guess? i’m gonna put this on the long finger for now unless it becomes too annoying.

Fix Home/End actions on macos

Home and End dont actually work properly on Macos. they default to top and bottom of the page, which seems bizarre to me, but i guess this is a Mac thing? next step would be to fix that in the OS i think, the default keys are CMD+Left/Right, but setting that up in VIA would:
a) be annoying to do
b) break Windows shortcuts

you could use the separate mac/win layers, but you’ll need to edit some default mappings there. and again, CMD+left/right are not “basic keys” which means you can’t do this using VIA and will need to get into compiling QMK firmware again… so OS level key remapping will likely do here

Latest edit to my TouchCursor layer map

i just added mouse support for the left hand. includes mouse movement, left/right buttons, up/down scrolling so far. this was inspired by the constant interruption to editing this WP article in their new editor. pretty awesome if no longer needed to use the mouse!