i2c_puppet-Linux/LINUX.md

104 lines
3.8 KiB
Markdown
Raw Permalink Normal View History

# I2C Puppet mods for Linux systems
2022-07-12 15:20:17 +02:00
This is a modification to the <a href="https:README.md" target="_blank">standard firmware</a>
The original version lacked certain characters, such as <ESCAPE>, and the characters "<>{}[]^&%=\"
which made it difficult to use on Linux systems
This version of the firmware has been modified to support Linux systems.
The following changes have been made
2022-07-10 17:12:49 +02:00
- The backspace key works during the GUI login
2022-07-12 14:54:17 +02:00
- The Sym key now acts as a Control key, so SYM+C is Control-C
2022-07-10 17:12:49 +02:00
- The four top button keys are now used to provide the missing characters.
2022-07-12 14:54:17 +02:00
The original definiton of the keys were this. I'm including the
spacebar, newline/enter, backspace, Microphone and Spkeaer keys
because they provide characters not indicated on the key. For
2022-07-12 15:20:17 +02:00
instance, ALT + spacebar provides TAB, and ALT+NewLine is the pipe character.
2022-07-12 14:54:17 +02:00
2022-07-12 14:43:49 +02:00
| | L1 | L2 | R1 | R2 | SPKR | Mic| BS | NL | SPACE |
2022-07-12 15:20:17 +02:00
| ------|-------|-------|-------|-------|------|----|---|----|---------|
| none | | | | | $ | ~ | \b| \n | SPACE |
| Alt | | | | | \` | 0 | | \| | TAB |
| Shift | | | | | $ | | | | |
| Sym | | | | | $ | | | | |
2022-07-10 17:12:49 +02:00
This firmware adds the following mappings
2022-07-12 14:54:17 +02:00
2022-07-12 15:20:17 +02:00
| | L1 | L2 | R1 | R2 | SPKR | Mic| BS| NL | SPACE |
| ------|--------|-------|-------|-------|------|----|---|----|---------|
| none | ESCAPE | % | = | \\ | $ | ~ | \b| \n | SPACE |
| Alt | > | ] | } | & | \` | 0 | | \| | TAB |
| Shift | < | [ | { | ^ | $ | ~ | \b| | |
| Sym | x | x | x | x | $ | ~ | \b| | |
I tried to make the bracket characters easierr to remember by using
Shift+ to indicate the left-pointing brackets, and Alt+ corresponds to
the same right-pointing bracket. You can redefine these keys if you
prefer a different arraingment.
Currently, SYM+<top button keys> produces an 'x' to indicate some value can be inserted.
I'm considering mapping these to the 4 arrow keys
2022-07-10 17:12:49 +02:00
## Linux Debug tips
2022-07-12 14:54:17 +02:00
The keyboard has two "outputs" - one is the USB HID interface, the
other is the serial port. Any printf() command goes to the serial
port, but not the USB HID keyboard. For instance, when using an
Arduino sketch, print() goes to the serial port.
2022-07-12 14:54:17 +02:00
When the keyboard is plugged into a Linux system, a new TTY interface
will appear. I usually use
2022-07-12 14:54:17 +02:00
ls -lt /dev/tty* | head"
to learn the name, as the newest port will appear first. On my system,
it's /dev/ttyACM0
So on one terminal window, I type
2022-07-10 17:12:49 +02:00
cat -v </dev/ttyACM0
while on a second terminal window, I type
2022-07-10 17:12:49 +02:00
cat -v
2022-07-12 14:54:17 +02:00
The first one will print all of the printf output, and the second will
show you how the keyboard works normally and what gets sent to the USB
keyboard when a key is pressed..
2022-07-10 17:12:49 +02:00
## Compiling firmware on Linux
2022-07-12 15:20:17 +02:00
I edit the files in <GIT>/ic2_puppet/all/ using emacs.
I have the keystroke combination
2022-07-12 14:54:17 +02:00
"Control-C M" bound to compile, using
2022-07-10 17:12:49 +02:00
(global-set-key "\C-cm" 'compile)
2022-07-12 15:20:17 +02:00
And when I press "Control-c M", emacs saves all files, and recompiles the
code. I have a small hub with switchable on/off ports, and restart the
keyboard into boot mode, and then do a "make install" to load the new
2022-07-12 15:20:17 +02:00
firmware. But you can also use vim. The makefile assumes the compiled version is in ../build.
2022-07-12 14:54:17 +02:00
## GUI Login
I found that I had to handle the backspace differently, as arturo did
for enter. This was necessary so that the backspace key would delete
the username or password characters.
2022-07-10 17:12:49 +02:00
## TODO
Currently - the SYM+Button keys are defined as the character "x" to indicate it's not been specified.
I'l like to make these keys to the 4 arrow keys.
Also - it might be possible to create key combinations by combining the modified keys, like SYM+Alt+key