Remapping keys?


(Philip J) #1

Is there an easy way to remap keys on the Model 01? I just received my PVT model, and right now the choices for the thumb keys are driving me to frustration. I’d like to move around where shift, cmd, etc are placed.


(Jesse) #2

Right now, the way to change the keymapping on the device is to reflash the firmware after tweaking the keymap.

Alternatively, on a Mac, Karabiner is a low-effort solution for remapping.


(Philip J) #3

Thanks for the speedy reply! I must admit I have FUD around flashing the firmware with changes, even though I think that’s probably what I want to do long-term. I’ll give Karabiner a go, since I’m Mac-based.


(Jesse) #4

Flashing firmware ought to be safe and easy. We’ve got a bunch of safeguards to protect you from hurting yourself.

Also, I happen to know that you’re local, so if you were to run into trouble, I could lay hands on :wink:


(Philip J) #5

Is the correct way forward to change the values in this block and reflash? https://github.com/keyboardio/Model01-Firmware/blob/master/Model01-Firmware.ino#L68


(@TheBaronHimself) #6

Hey @phildini. I’m currently working on our GUI keymap editor for Kaleidoscope. I can’t yet say when it will be usable, but we’re certainly aiming to release a solid version until the mass produced units ship.


(Jesse) #7

Yes! That’s it exactly.


(ArleyM) #8

Is it going to be possible to make “layers”? I was thinking I’d use the “any” and “butterfly” keys to raise and lower.


(James Cash) #9

I’ve been looking at @algernon’s layout to figure out the more advanced stuff like layers.


(Philip J) #10

Yeah I downloaded and built Chrysalis but didn’t see any options for key remapping. Did I miss something?


(Philip J) #11

When I try to run the make script I get

Makefile:12: /Users/phildini/Arduino/hardware/keyboardio/avr/libraries/Kaleidoscope-Plugin/build/*.mk: No such file or directory
make: *** No rule to make target `/Users/phildini/Arduino/hardware/keyboardio/avr/libraries/Kaleidoscope-Plugin/build/*.mk'.  Stop.

It looks like the Makefile isn’t correctly picking up the Darwin nature of my mac, and if I change the path in the makefile there’s a child Makefile that tries to pull in the linux version of arduino… is there a install pre-req?


(@TheBaronHimself) #12

No, you didn’t miss anything. The keymap editor is not in there, yet. I’m currently working on that. We are going to move to another frontend framework and I’m not entirely sure whether that will influence how quickly the keymap editor is going to be usable. Probably not, though.


(Jesse) #13

That’s weird. Can you try running the OS check in the makefile by hand?


(Philip J) #14

Here’s me trying to figure it out.

SensitiveDependence:Kaleidoscope phildini$ UNAME_S := $(shell uname -s)
-bash: shell: command not found
-bash: UNAME_S: command not found
SensitiveDependence:Kaleidoscope phildini$ $(shell uname -s)
-bash: shell: command not found
SensitiveDependence:Kaleidoscope phildini$ uname -s
Darwin

(Jesse) #15

…I think I see it.

Can you try changing

BOARD_HARDWARE_PATH ?= $(HOME)/Arduino/hardware
ifeq ($(UNAME_S),Darwin)
BOARD_HARDWARE_PATH ?= $(HOME)/Library/Arduino/hardware
endif

To:

BOARD_HARDWARE_PATH ?= $(HOME)/Arduino/hardware
ifeq ($(UNAME_S),Darwin)
BOARD_HARDWARE_PATH = $(HOME)/Library/Arduino/hardware
endif


(Philip J) #16

So I think there’s a number of things wrong as it stands, two that I know about.

  1. The guide on https://github.com/keyboardio/Kaleidoscope says to link to ~/Documents/Arduino, but the script says ~/Library/Arduino
  2. The Makefile seems to not be detecting that I’m on a Darwin system.

I tried your changes, and I’m getting the same error.


(Philip J) #17

Although once I made your change and changed the path to Documents, it seems to be running. Will update here with progress.


(Jesse) #18

Documents is correct.

I think the issue is that the Makefile is just not correctly setting the env variable.

Ack. So sorry.

If you just replace the whole file with:

MAKEFILE_PREFIX=keyboardio/avr/libraries/Kaleidoscope-Plugin/build
UNAME_S := $(shell uname -s)

BOARD_HARDWARE_PATH = $(HOME)/Documents/Arduino/hardware
include $(BOARD_HARDWARE_PATH)/$(MAKEFILE_PREFIX)/*.mk

do things behave?


(Philip J) #19

hey I got closer! Now when i try to upload the .ino via the arduino app I get:

Arduino: 1.8.3 (Mac OS X), Board: "Keyboardio Model 01"

Bootloader file specified but missing: /Users/phildini/Documents/Arduino/hardware/keyboardio/avr/bootloaders/caterina/Caterina.hex
Sketch uses 17642 bytes (61%) of program storage space. Maximum is 28672 bytes.
Global variables use 1501 bytes (58%) of dynamic memory, leaving 1059 bytes for local variables. Maximum is 2560 bytes.

avrdude: butterfly_recv(): programmer is not responding
avrdude: butterfly_recv(): programmer is not responding
avrdude: butterfly_recv(): programmer is not responding
avrdude: butterfly_recv(): programmer is not responding
avrdude: butterfly_recv(): programmer is not responding
Found programmer: Id = "��"; type = �
    Software Version = .; Hardware Version = �.
avrdude: butterfly_recv(): programmer is not responding
avrdude: butterfly_recv(): programmer is not responding
avrdude: error: buffered memory access not supported. Maybe it isn't
a butterfly/AVR109 but a AVR910 device?
avrdude: initialization failed, rc=-1
         Double check connections and try again, or use -F to override
         this check.

avrdude: butterfly_recv(): programmer is not responding
avrdude: error: programmer did not respond to command: leave prog mode
avrdude: butterfly_recv(): programmer is not responding
avrdude: error: programmer did not respond to command: exit bootloader
avrdude: error: programmer did not respond to command: exit bootloader

Invalid library found in /Users/phildini/Documents/Arduino/hardware/keyboardio/avr/libraries/Kaleidoscope-Plugin: /Users/phildini/Documents/Arduino/hardware/keyboardio/avr/libraries/Kaleidoscope-Plugin
Invalid library found in /Users/phildini/Documents/Arduino/hardware/keyboardio/avr/libraries/Kaleidoscope-Plugin: /Users/phildini/Documents/Arduino/hardware/keyboardio/avr/libraries/Kaleidoscope-Plugin

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

(Jesse) #20

Oh. If you were using the Arduino app, you didn’t have to go through any of that craziness. If you were doing commandline builds, you should be able to just “make flash” instead.

When you were doing the flashing, did you hold down the “Prog” button during the process? That’s…supposed to be documented, but I’ve clearly got some work to do. It acts as a hardware interlock to prevent a hostile party from maliciously flashing your keyboard if they have control of a device you’ve plugged into.