Remapping keys?

@merlin - I’m hoping to do something exactly like what you describe. And like you, I could try and dust of my C knowledge (which I’ve done nothing with for far too many years), learn Arduino programming, and learn about key codes and the like, and maybe get something working in a few months time… or I could ask (and sponsor) a Subject Matter Expert like @algernon to do the work. I’d be happy to join you, and any others that would like to join us, in sponsoring a plugin, say via algernon’s Patreon page, that would allow “legacy-shifted characters” (let’s call them) on a non-shifted key/level, and a different character (legacy-shifted or not) on the shifted layer of that key. Basically, to visualize the ideas you’ve discussed, things like this:

┏━━━┓  ┏━━━┓  
┃ { ┃  ┃ } ┃ 
┃ ( ┃  ┃ ) ┃ 
┗━━━┛  ┗━━━┛  
┏━━━┓  ┏━━━┓ 
┃ 9 ┃  ┃ ? ┃ 
┃ | ┃  ┃ " ┃ 
┗━━━┛  ┗━━━┛
4 Likes

You make that sound easy but what is tweaking and reflashing? I learned how to reprogram my Ergodox, so I’m sure I can manage this once i figure it out but i need a left space key. I just need to know where to start I guess

IMPORTANT: The promise I’ve made to backers is that if the GUI tools aren’t available and you can’t figure out how to remap using the current stuff, I will be your ‘coding concierge’ - You tell me what you want and I’ll make the changes, build the firmware and walk you through getting it onto your keyboard, up to and including screen-sharing if you need it.

It ought not to be something complex you need to figure out. And that’s entirely my fault. @jenigma has been doing heroic work writing docs to make this less opaque.

  1. The first step is getting the Arduino tools installed.

For MacOS: Install Arduino support on a Mac · keyboardio/Kaleidoscope Wiki · GitHub
For Windows 10: Install Arduino support on Windows · keyboardio/Kaleidoscope Wiki · GitHub
For Linux: Install Arduino support on Linux · keyboardio/Kaleidoscope Wiki · GitHub

  1. Change the keymap. The example turns ‘Prog’ into ‘Esc’, but the idea is the same.
2 Likes

Okay, a bit more work than the Erogodox but I see how it works, I don’t see the Model 01 there though in Examples. I love the feel of this keyboard.

1 Like

Okay, I think I see. I have a bit more to do here.

if we typo or get something wrong, will we brick our kbm01? or will the flash not take and keep the current configuration?

1 Like

If the firmware does not compile, it won’t flash, and you’ll keep your previous one. If it does compile, but for some odd reason it crashes, you still didn’t brick your keyboard, as you can always re-flash the factory firmware. See this explanation, and the rest of the thread for details.

As you’re working through it, keep an eye on places where you feel like we could improve the documentation or automate some of the steps for you.

I know we still have a lot of work to do to make this a simple, friendly experience. We are, however, committed to doing that work.

2 Likes

If you can’t flash your keyboard for whatever reason (for the moment), but absolutely need that space on the left side, you can do it like me and use AutoHotkey (a super useful software for triggering actions when shortcuts are pressed, or “reprogram” the behavior of keys etc.).

I switched the backspace key with space using this script (run autohotkey, right click the tray icon in your windows taskbar (if you use windows, that is), and click “edit this script” and put this in:

$Space::
SendInput, {Backspace}
return

$Backspace::
SendInput, {Space}
return
1 Like

Of course.I never thought of that. I’ve used that before. I figured out how to do it.I hadn’t loaded the firmware into Arduino. I will just take a bit of figuring out what I want where.

I keep getting a message that the keyboard can’t connect to the programmer and there’s no driver. Did I miss something?

@Gaye, what OS and version are you on? (I’m going to bet Windows 7 or Window 8, as those are the two that are giving me and @rumpel driver headaches this week)

Ha, it’s Windows 7. I’ve made a fair bit of progress and I found some drivers in Arduino, but it’s still not working. This is interesting. Never hurts to learn something new.

1 Like

The specific issue here is that Windows 7 needs per-device USB driver “.inf” file mappings. In our case, that means mapping USB Vendor ID 0x1209, Product ID 0x2300 and Vendor ID 0x1209, Product ID 0x2301 to the built-in WinUSB driver. I sent @rumpel my first pass at that the other night, but he said it was still no-go for him.

The Arduino Drivers should be correct, except for the VID/PID used as a key to identify the device. I’m going to try again tonight and will post them on the forum if I get anything workable.

Windows 8 has the same issue, but with the added wrinkle that all the drivers need to be digitally signed.

Windows 10…just works fine without installing a special driver, since the Windows team finally decided to automatically load the serial port driver for serial devices.

This stuff is all new for me. I’ve never dealt with Windows device drivers before. Learning something new is hurting a little bit, but it’ll be good for me in the end :wink:

[admin: I am going to move this part of the thread talking about windows device drivers over to the thread on that topic in a little while, just to keep everything easy for folks to find]

1 Like

It’s interesting though, @Gaye’s error message is different from mine. His Arduino complains about a non responding programmer, while mine complains about a missing COM port.

I’ve had both, always after flubs.

  1. I had the non responding when I’ve not held down prog when the uploading start (funny: I experimented with putting Enter on prog, then when pressed during upload it was creating a lot of new lines in my sketch! haha)

  2. I had the missing COM port after some change, I just needed to go in the Arduino IDE app to Tools > Port and pick the USB one!

What operating system are you running? If you are running Win7/8, what driver did Windows install for the keyboard? Is it registered under COM&LPT or USB Controller (see device manager)?

Edit @arley: never mind, I’ve seen your unboxing video, you are the guy with a Mac who smells his keyboards :grin: (you made me smell mine too out of curiosity)

5 Likes

haha, yes, Mac. USB! I hope it’s not too different

29 AM

Here’s another vote for arbitrary symbols attached to shifted/unshifted keys. I don’t even have a keyboard yet, I ordered it a week ago :slight_smile:.

I suppose I could hack that effect in with a “shifted keys” layer, and not using a literal shift key in my layout. If I want to hold down shift, that’s what a special gaming layer would be for.

That is, the current state of things is actually really powerful depending on how hacky you think it is to have several layers inter-mingling with each-other. I’m thinking a lot of edge cases would be major headaches, and I’d hate to run into a couple that only bother me slightly so that I never do anything about them, if you know what I mean.

Anyways, I’ve got some pretty strong ideas of exactly how I want my keyboard to work when I get it, starting with a custom layout, which I posted about here, though I’ve made a couple more changes since that post.

I’ve got this idea of a sort of meta-layer, or group of layers associated with each-other. So, I’d be able to switch between my custom layout, with all its various layer-based “modifiers”, and the stock qwerty, with its default function layers. I don’t know if the community has already given the concept a name, but I’m calling them “modes”. It should be pretty easy to implement if I use yet another layer as my “mode switching layer”. I’m thinking of naming my modes things like “red 3” and “blue 0”. Each row of keys under the numbers would be one of three colors, the physical number keys would be indicative column headers, and only the actually assigned modes would be lit up.

What I really want, that I need help with, is the ability to change the lighting based on the current layer. If there isn’t already a generalized plugin, I’m sure I’ll be able to tear the “numpad” plugin apart to make one.

But how do I detect if (the OS’s) num lock is on or off? I’d like to base the lighting on that, as well. I decided to use a num pad for both numbers and arrow keys, the way actual traditional keyboards do. If I map a key to the literal “num lock” key, it will affect the OS’s interpretation of the “num pad” keys, right? I’m gleaning from the thread that any usually-shifted mappable key is actually implemented as a shifted key under the hood, and I’m assuming the numpad + num lock work in an analogous way.

Sorry if this post is long and rambly, let me sum up what I’m hoping to get help with. Are there already conventions for the concept of “modes”—switching between groups of related layers? Is there already a plugin for custom-lighting every layer, with provision for other arbitrary conditions, e.g. the state of num-lock?

The Colormap plugin does exactly that. It’s… not the easiest thing to use currently (it stores the palette & colormaps in EEPROM, which you will have to put there one way or the other).

If everything worked well, the following would get you the numlock state:

bool numState = !!(kaleidoscope::hid::getKeyboardLEDs() & LED_NUM_LOCK);

It doesn’t work reliably yet, but I hope we can fix that. Once we do, we might provide a better API, something like kaleidoscope::hid::getKeyboardLEDState(Key_NumLock) or somesuch.