Code Monkey home page Code Monkey logo

neo-keyboard-adapter's Introduction

Neo Layout Hardware Adapter

This project implements a hardware driver for the Neo-Layout. It works by using an Arduino Mirco. The Arduino registers as BootKeyboard Human Interface Device to the Host using the HID-Project Library on the one side. On the other side, we attach a USB Host Shield to the Arduino to make it act as a USB Host for a BootKeyboard itself, using the BootKeyboard Library from the USB Host Shield Project. Then we run the inputs through a transformation Matrix to map it to the according to Input on the normal German Keyboard layout.

Why all this? For Linux, the Linux build-in Layout works well what I can tell from my experience, but for Windows, there are countless issues with both the software drives. One reason being additional modifiers added and lock Keys (Num-lock, CAPS-Lock) having a non-standard implementation. That confuses windows, so we have not always the behavior we want in all apps. Key-Combinations do not work and Remote-Desktop applications and Screen sharing behave differently every time. With this hardware solution, our layout stays transparent for Windows and when we press Mod3-J, we just send Shift-8 to the host for an open left bracket. No application will ever know we modified our layout. Especially with desktop sharing and VPN connections, that puts a lot of relief in productional use. You can even have two keyboards connected to the PC, where you are using neo-layout and the other person is using the german layout (not sure if this is real use case)

This project can also be modified for other Keyboard-transforming applications, like passing through everything, but playing macro sequences for some key-presses or having any layout you want.

Setup Project

Setup Hardware

  • Arduino Pro Micro 3.3V (not 5V) Ebay
  • Arduino Micro Host Shield Ebay

Arduino Pro Micro:

  • Download Arduino IDE https://www.arduino.cc/en/software
  • Do not attempt to flash a sketch by selecting the "Arduino Pro Micro" in the List. It will work, but soft-brick the device for further programming.
  • Use the Entry "Lily Pad USB" instead. Although this is not a Lily Pad, it shares the relevant specifications

Mirco USB Host Shield:

  • USB runs with 5V, but the board is 3.3V only and therefore has a design flaw and has to be fixed
  • Furthermore, the reset pin of the shield (Not the reset pin of the Arduino) has to be connected to 3.3V. Unfortunately, this pin is GND in Arduino, so we cannot just set the Pin to HIGH. I went straight after following setup: https://geekhack.org/index.php?topic=80421.0 which i documented also under here

Software

  • The USB Host Shield Library has to be installed in the Arduino Library Manager
  • The HID-Project Library has to be installed in the Arduino Library Manager, standard Keyboard Library is insufficient.
  • After uploading the example to the board I can see the board working in the serial port monitor.

Controlling the driver

The Left Windows-Key is configured to interact with the driver. Following (under windows anyhow unused combinations) are therefore used to interact with the driver and are not passed to the Host-PC. To reach this behavior, the left Windows-Key behaves differently in that way. Therefore it does not appear in a pressed-State to the Host before another non-used combination is pressed or the Key is released without pressing a key. In practical use, you will not notice this difference. Please note, that only the left Windows-Key is configured for this use, not the right one. The settings are not stored to EEPROM and therefore reset after each power-reset from the Arduino. This behavior is intended.

Combinations:

Toggle Mapping:

  • WIN + F12: Toggle between Neo-Mapping and transparent pass-through mode. (Default: Neo-Layout)

Toggle Unicode Input:

  • WIN + F1: Opens the browser with this repository.
  • WIN + F9: Unicode will be entered in decimal for Windows. (Default)
  • WIN + F10: Unicode will be entered in hexadecimal for Windows. (Requires setup)
  • WIN + SHIFT + F10: The registry entry for hexadecimal input in Windows is created. (Requires reboot)
  • WIN + F11: Unicode will be entered in hexadecimal for Linux.

General note for Unicode on Windows: The decimal method only works in some apps (mainly MS Office) for all Unicode characters. For non-supported apps, only some of the Unicode Keys work. Hexadecimal setup does not require admin rights, but a reboot. It works with most apps, but apparently not with those where the decimal input is fully supported. So you have to toggle the Unicode method in respective to the app you are using. Linux is according to the specification I found, but untested.

To make life easier, I included a small ahk-tool which makes the Default method in windows work universally.

Media Keys:

Additionally to the Neo Layout, I mapped custom combinations for Media Keys to Layer 4. This is a workaround for the not yet working media keys on the keyboard on the one hand and also spice up standard keyboards.

  • L4 + Page Up: Volume Up
  • L4 + Page Down: Volume Down
  • L4 + Insert: Mute
  • L4 + Delete: Play/Pause
  • L4 + Home: Previous Track
  • L4 + End: Next Track

Deviations:

As we have full control over the LEDs without changing the actual Locking state reported to the host, I decided to have the NUM-Lock LED switched off in the case of M4-Lock. Furthermore, all LEDs are lit, when the keyboard is in compose-State.

Limitations:

  • No universal Unicode input method which works in all applications and does not require additional software available for Windows.
  • As we are using HID-Boot Protocol, only the “normal” keys on your keyboard are supported. Media Keys Readin or whatever else you have on your keyboard is not supported. However, I mapped the most important Media Keys to L4 Layer, and you can map like many other as you want if you edit the source code ☺.
  • Because of storage limitations, only compose sequences leading to a 2-Byte Unicode-Character could be considered. The goal is to have a almost complete version as in Neo-Layout. For further storage reasons, letters with diacrical marks can only be accessed by the most common and intuitive way, using the corresponing dead key. You can compile your own compose sequences by adding them in a *.module file and compile it to C++-Code with the included Python-Script

Hits

neo-keyboard-adapter's People

Contributors

jonas-commits avatar manuel-91 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

neo-keyboard-adapter's Issues

Pricing

When I started the Project the USB host shield was €4+shipping and the Arduino Micro around €7. While the Arduino Micro just grew as expected within the current taxes-lockdown-shortage situation, I see the prices for the USB host shield now start around €20 at ebay. If somebody has better sources please post them here.

Compatibility with other Arduino boards?

First off, thank you very much for your work! I really appreciate anyone that lessens the pain of using an obscure keyboard layout on Windows machines. ;)

I’m wondering whether there’s a technical reason you chose the Pro Micro, or whether that’s simply what you happened to have available. Would it be a bad idea to use e.g. an Uno (with compatible shield of course) instead?

Also, am I understanding the "Limitations" section correctly in that all layers (or layers 1–4) are already supported? Because that would be amazing!

Doku Detailfragen

Hey Jonas,

vielen Dank für das Repo und die ausführliche Dokumentation. Da hast du echt viel Mühe reingesteckt. Ich habe die Hardware erfolgreich aufgebaut (danke für die Bilder mit Markierungen!). Dabei kamen mir ein paar Fragen auf:

  1. Was hat es mit dem 'fix' auf sich?
  2. Was mache ich mit der boards.txt? Ich habe sie nicht gebraucht. Ist die für AVR-dude?
  3. Bei mir geht das Uploaden nur wenn ich vorher den Reset auf GND hole und glück beim Timing habe (das Board hat ja leider keinen Reset Button). Ist das nur bei mir so? Falls nicht, würde ich gerne noch eine Zeile in der README.md ergänzen evtl mit Verweis auf die Fehlermeldung.

...ich bin mal so frei und schreibe die Anfrage auf deutsch, da vermutlich alle Neo User Deutsch sprechen...

Diesen Text habe ich mit deiner Firmware in Neo geschrieben! :-D, Grüße!

Possible use for external keyboards on iPad

I stumbled upon this project, while I was looking for a way to use the Neo layout on an external keyboard on my iPad.
Do you think this would work out of the box, or otherwise be possible to implement?
I would be happy to contribute, if you think this is feasible at all.
Thank you!

Ebene4: wortweises Springen per Strg funktioniert nicht

Ich nutze sehr gerne die Pfeiltasten der 4. Ebene. Diese für sich funktionieren sehr gut, jedoch funktioniert Strg dazu wie erwartet:

(Tastenbezeichnung im Quertz-Sprech)

Ohne Strg:

  • AltGr + F = Pfeil rechts ✔️
  • AltGr + Umschalt + F = Markieren rechts ✔️

Strg:

  • Strg + Echte Pfeiltaste = zum nächsten Wort springen ✔️
  • AltGr + Strg + F = zum nächsten Wort springen ⛔ stattdessen bewegt sich der Cursor nur nach rechts
  • AltGr + F (gedrückt halten) + Strg = zum nächsten Wort springen ✔️

Strg + Umschalt:

  • Strg + Umschalt + Echte Pfeiltaste = markiere nächstes Wort ✔️
  • AltGr + Umschalt + Strg + F= Markiere nächstes Wort ⛔ stattdessen wird nur das nächste Zeichen markiert
  • AltGr + Umschalt + F + Strg = Markiere nächstes Wort ✔️

Pfeil rechts ist hier stellvertredend, für Pfeil links, Pos1/Ende gilt das selbe.

Leider ist der "workaround" zuerst die Pfeiltaste zu erzeugen und dann Strg dazu zu drücken nicht praktikabel, da man dafür die Zeichenwiederholung des Betriebbsystems braucht. Ich habe es hier nur zum Fehler eingrenzen notiert.

Getestet auf Windows und Arch Linux.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.