Author Topic: Finding 12 unique scancodes to use for a macropad project  (Read 941 times)

0 Members and 1 Guest are viewing this topic.

Offline THX1138b

  • Thread Starter
  • Posts: 20
Finding 12 unique scancodes to use for a macropad project
« on: Sat, 06 January 2018, 10:43:53 »
I want to make a 12-key macropad to control some multi-monitor functions. I intend to use an Arduino to control this (with AutoHotKey receiving and acting on the signals) and was also planning on modifying this code from Github for the Arduino sketch. I need some help to find suitable unique scancodes for these functions and I was thinking maybe I could use three-byte scancodes because I figure there are over 16m combinations so there must be a few unused ones?

Online Tactile

  • Posts: 1037
  • Location: Portland, OR
Re: Finding 12 unique scancodes to use for a macropad project
« Reply #1 on: Sat, 06 January 2018, 10:57:12 »
There are quite a few unused (in Windows, anyway) scancodes in 122 key keyboards. You might be able to make use of some of them which would eliminate having to deal with multiple-byte codes.

Offline THX1138b

  • Thread Starter
  • Posts: 20
Re: Finding 12 unique scancodes to use for a macropad project
« Reply #2 on: Sat, 06 January 2018, 17:47:16 »
My dream is to one day get the as-yet unreleased version of the Geekhack-122 keyboard which I guess will already use those scancodes (and some others) so I'd rather use unique ones.

Online Tactile

  • Posts: 1037
  • Location: Portland, OR
Re: Finding 12 unique scancodes to use for a macropad project
« Reply #3 on: Sat, 06 January 2018, 18:40:10 »
There's a GH122 PCB for sale right here on GH.

Offline metalliqaz

  • * Maker
  • Posts: 4879
  • Location: the Making Stuff subforum
  • Leopold fanboy
Re: Finding 12 unique scancodes to use for a macropad project
« Reply #4 on: Sat, 06 January 2018, 19:59:26 »
You can't just pick random unused 3-byte scancodes.  You have to pick something that exists on an HID codepage.  You may as well use the regular normal keyboard code page 7.  There are many that aren't used by Windows.

You can see the table in Appendix C of this document: scancode.doc

I'd probably just use F13-F24.

Offline THX1138b

  • Thread Starter
  • Posts: 20
Re: Finding 12 unique scancodes to use for a macropad project
« Reply #5 on: Sun, 07 January 2018, 14:49:08 »
There's a GH122 PCB for sale right here on GH.

Thanks; I think the nascent version is meant to have some improvements which I'd like to benefit from, assuming it reaches completion.

You can't just pick random unused 3-byte scancodes.  You have to pick something that exists on an HID codepage.  You may as well use the regular normal keyboard code page 7.  There are many that aren't used by Windows.

You can see the table in Appendix C of this document: scancode.doc

I'd probably just use F13-F24.

Thanks. I'll look at that.

Offline JohanAR

  • Posts: 69
  • Location: Sweden
Re: Finding 12 unique scancodes to use for a macropad project
« Reply #6 on: Mon, 08 January 2018, 06:27:47 »
I'd probably just use F13-F24.

On Linux these are used by default so I think you'd have to manually set a keymap and not include symbols/inet. I had planned to use them for a macropad but I thought it was too annoying that they launched some program if I forgot to configure the keymap. Ended up using numpad 0-9 instead since I have a tkl anyway

@THX1138b have you considered binding the keys to Alt+Ctrl+Shift+something?

Offline Mazian

  • Posts: 8
Re: Finding 12 unique scancodes to use for a macropad project
« Reply #7 on: Wed, 10 January 2018, 12:45:32 »
I'd probably just use F13-F24.

On Linux these are used by default so I think you'd have to manually set a keymap and not include symbols/inet.

They shouldn't be - I had a numpad top row using F13-F16 for a while, without conflicts under Linux, in a couple different window managers.  It's certainly possible that some boards end up sending the media keys or whatnot in that range, though.

xev -event keyboard will show the actual codes being sent, or this trick to make xev's output easier to read.

Offline JohanAR

  • Posts: 69
  • Location: Sweden
Re: Finding 12 unique scancodes to use for a macropad project
« Reply #8 on: Thu, 11 January 2018, 09:40:41 »
They shouldn't be - I had a numpad top row using F13-F16 for a while, without conflicts under Linux, in a couple different window managers.  It's certainly possible that some boards end up sending the media keys or whatnot in that range, though.

If I do "setxkbmap -print" I can see that the symbols include inet(evdev) and reading /usr/share/X11/xkb/symbols/inet section evdev it definitely looks like for example FK13 is mapped to XF86Tools, FK14 is XF86Launch5 etc. Was your numpad USB btw? Were you using something else than Ubuntu? I got the same results in both Xubuntu and Ubuntu with i3

Offline Mazian

  • Posts: 8
Re: Finding 12 unique scancodes to use for a macropad project
« Reply #9 on: Fri, 12 January 2018, 18:45:36 »
USB, running QMK.

It's entirely possible it's window manager-specific, I was running KDE or Xfce under Debian at the time, and it does look like GNOME (still the Ubuntu default?) takes over the "XF86Tools" scancode from F13 to launch the settings app.  Might just reprogram my pad to re-check what scancodes QMK sends out....