diff --git a/.gitignore b/.gitignore index a082ea22e4d..76d09a6806a 100644 --- a/.gitignore +++ b/.gitignore @@ -3,7 +3,11 @@ keyboard/planck/dfu-programmer.exe *.o *.eep *.elf -*.hex +/*.hex +/keyboard/**/*.hex +/keyboard/**/keymaps/**/*.hex +!/keyboard/**/keymaps/**/compiled.hex +*.log *.lss *.lst *.map @@ -12,8 +16,11 @@ keyboard/planck/dfu-programmer.exe tags *~ build/ +.build/ *.bak .vagrant/ +.idea/ +CMakeLists.txt .DS_STORE # Eclipse/PyCharm/Other IDE Settings diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 00000000000..2e0714d713c --- /dev/null +++ b/.travis.yml @@ -0,0 +1,37 @@ +os: + - linux + +language: + - c + +compiler: + - avr-gcc + +env: + - KEYBOARD=alps64 + - KEYBOARD=arrow_pad + - KEYBOARD=atomic + - KEYBOARD=atreus + - KEYBOARD=bantam44 + - KEYBOARD=clueboard1 + - KEYBOARD=clueboard2 + - KEYBOARD=cluepad + - KEYBOARD=ergodox_ez + - KEYBOARD=gh60 + - KEYBOARD=hhkb + - KEYBOARD=jd45 + - KEYBOARD=kc60 + - KEYBOARD=planck + - KEYBOARD=preonic + - KEYBOARD=retro_refit + - KEYBOARD=sixkeyboard + +script: + - cd keyboard/$KEYBOARD && make all-keymaps + +addons: + apt: + packages: + - avr-libc + - gcc-avr + - dfu-programmer diff --git a/1-setup-path-win.bat b/1-setup-path-win.bat deleted file mode 100644 index f612d0f4a79..00000000000 --- a/1-setup-path-win.bat +++ /dev/null @@ -1,77 +0,0 @@ -@SETLOCAL ENABLEEXTENSIONS ENABLEDELAYEDEXPANSION -@ECHO OFF -SET CMDLINERUNSTR=%SystemRoot%\system32\cmd.exe - -SET NEWPATH1="C:\MinGW\msys\1.0\bin" -SET NEWPATH2="C:\MinGW\bin" - -:: Make sure we're running with administrator privileges -NET SESSION >nul 2>&1 -IF ERRORLEVEL 1 ( - ECHO FAILED. Run this script with administrator privileges. - GOTO ExitBatch -) - -:: Make sure the second path exists. The first path won't be created until the second script is run -IF NOT EXIST !NEWPATH2! (ECHO Path not found: %NEWPATH2% && GOTO ExitBatch) - -:: Add paths -CALL :AddPath %NEWPATH1% -CALL :AddPath %NEWPATH2% - -:: Branch to UpdateEnv if we need to update -IF DEFINED UPDATE (GOTO UpdateEnv) - -GOTO ExitBatch - -:: ----------------------------------------------------------------------------- - -:UpdateEnv -ECHO Making updated PATH go live . . . -REG delete HKCU\Environment /F /V TEMPVAR > nul 2>&1 -setx TEMPVAR 1 > nul 2>&1 -REG delete HKCU\Environment /F /V TEMPVAR > nul 2>&1 -IF NOT !cmdcmdline! == !CMDLINERUNSTR! (CALL :KillExplorer) -GOTO ExitBatch - -:: ----------------------------------------------------------------------------- - -:ExitBatch -ENDLOCAL -PAUSE -EXIT /b - -:: ----------------------------------------------------------------------------- - -:AddPath -ECHO %PATH% | FINDSTR /C:"%~1" > nul -IF ERRORLEVEL 1 ( - REG add "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment" /f /v PATH /t REG_SZ /d "%PATH%;%~1" > nul 2>&1 - IF ERRORLEVEL 0 ( - ECHO Adding %1 . . . Success! - SET "PATH=%PATH%;%~1" - SET UPDATE=1 - ) ELSE ( - ECHO Adding %1 . . . FAILED. Run this script with administrator privileges. - ) -) ELSE ( - ECHO Skipping %1 - Already in PATH - ) -EXIT /b - -:: ----------------------------------------------------------------------------- - -:KillExplorer - -ECHO Your desktop is being restarted, please wait. . . -ping -n 5 127.0.0.1 > NUL 2>&1 -ECHO Killing process Explorer.exe. . . -taskkill /f /im explorer.exe -ECHO. -ECHO Your desktop is now loading. . . -ping -n 5 127.0.0.1 > NUL 2>&1 -ECHO. -ping -n 5 127.0.0.1 > NUL 2>&1 -START explorer.exe -START explorer.exe %CD% -EXIT /b \ No newline at end of file diff --git a/BUILD_GUIDE.md b/BUILD_GUIDE.md deleted file mode 100644 index fd8b6202ff4..00000000000 --- a/BUILD_GUIDE.md +++ /dev/null @@ -1,60 +0,0 @@ -# Build Guide - -## Build Environment Setup - -### Windows -1. If you have ever installed WinAVR, uninstall it. -2. Install [MHV AVR Tools](https://infernoembedded.com/sites/default/files/project/MHV_AVR_Tools_20131101.exe). Disable smatch, but **be sure to leave the option to add the tools to the PATH checked**. -3. Install [MinGW](https://sourceforge.net/projects/mingw/files/Installer/mingw-get-setup.exe/download). During installation, uncheck the option to install a graphical user interface. **DO NOT change the default installation folder.** The scripts depend on the default location. -4. Clone this repository. [This link will download it as a zip file, which you'll need to extract.](https://github.com/jackhumbert/qmk_firmware/archive/master.zip) Open the extracted folder in Windows Explorer. -5. Right-click on the 1-setup-path-win batch script, select "Run as administrator", and accept the User Account Control prompt. Press the spacebar to dismiss the success message in the command prompt that pops up. -6. Right-click on the 2-setup-environment-win batch script, select "Run as administrator", and accept the User Account Control prompt. This part may take a couple of minutes, and you'll need to approve a driver installation, but once it finishes, your environment is complete! -7. Future build commands should be run from the standard Windows command prompt, which you can find by searching for "command prompt" from the start menu or start screen. Ignore the "MHV AVR Shell". - -### Mac -If you're using [homebrew,](http://brew.sh/) you can use the following commands: - - brew tap osx-cross/avr - brew install avr-libc - brew install dfu-programmer - -This is the recommended method. If you don't have homebrew, [install it!](http://brew.sh/) It's very much worth it for anyone who works in the command line. - -You can also try these instructions: - -1. Install Xcode from the App Store. -2. Install the Command Line Tools from `Xcode->Preferences->Downloads`. -3. Install [DFU-Programmer][dfu-prog]. - -### Linux -Install AVR GCC, AVR libc, and dfu-progammer with your favorite package manager. - -Debian/Ubuntu example: - - sudo apt-get update - sudo apt-get install gcc-avr avr-libc dfu-programmer - -### Vagrant -If you have any problems building the firmware, you can try using a tool called Vagrant. It will set up a virtual computer with a known configuration that's ready-to-go for firmware building. OLKB does NOT host the files for this virtual computer. Details on how to set up Vagrant are in the [VAGRANT_GUIDE file](VAGRANT_GUIDE.md). - -## Verify Your Installation -1. If you haven't already, obtain this repository ([https://github.com/jackhumbert/qmk_firmware](https://github.com/jackhumbert/qmk_firmware)). You can either download it as a zip file and extract it, or clone it using the command line tool git or the Github Desktop application. -2. Open up a terminal or command prompt and navigate to the qmk_firmware folder using the `cd` command. The command prompt will typically open to your home directory. If, for example, you cloned the repository to your Documents folder, then you would type `cd Documents/qmk_firmware`. If you extracted the file from a zip, then it may be named `qmk_firmware-master` instead. -3. To confirm that you're in the correct location, you can display the contents of your current folder using the `dir` command on Windows, or the `ls` command on Linux or Mac. You should see several files, including `README.md` and a `quantum` folder. From here, you need to navigate to the appropriate folder under `keyboard/`. For example, if you're building for a Planck, run `cd keyboard/planck`. -4. Once you're in the correct keyboard-specific folder, run the `make` command. This should output a lot of information about the build process. - -## Customizing, Building, and Deploying Your Firmware - -Note: Some keyboard folders have non-standard organizations, and may not even support specifying alternate keymaps. Until these get reorganized, you will need to edit their default keymaps directly. - -1. Running the `make` command from your keyboard's folder will generate a .hex file based on the default keymap. All keymaps for a particular keyboard live in the `keymaps` folder in that keyboard's folder. To create your own keymap, duplicate the folder `keymaps/default`, and rename it with your name, for example `jack`. Or, if you don't care about the ability to share your keymap with the community via GitHub, you can just modify the default keymap itself. Details on how to program keymap files can be found in other guides. -2. To build a keymap other than the default, type `KEYMAP=` after `make`. So if I've named my keymap `jack`, the full command would be `make KEYMAP=jack`. -3. How you deploy the firmware will depend on whether you are using a PCB or a Teensy. In both cases, you'll need to put the keyboard in bootloader mode, either by pressing a button on the PCB/Teensy or pressing the key with the `RESET` keycode. Then, if you're using a PCB, just run `make KEYMAP= dfu` to both build and deploy the firmware. If you're using a Teensy, you'll probably need to take the .hex file that make produces in the keyboard's folder, and deploy it using the [Teensy Loader.](https://www.pjrc.com/teensy/loader.html) - -## Helpful Tips -1. On Linux or OS X, you can run `sleep 5; make KEYMAP= dfu` to delay building/deploying the firmware until for 5 seconds, giving you a chance to put the firmware into bootloader mode. You can change the 5 to any number of seconds. - -## Troubleshooting -1. Try running `make clean` if the make command fails. - - WIP diff --git a/Makefile b/Makefile new file mode 100644 index 00000000000..024a57134b5 --- /dev/null +++ b/Makefile @@ -0,0 +1,112 @@ +ifndef VERBOSE +.SILENT: +endif + +starting_makefile := $(abspath $(firstword $(MAKEFILE_LIST))) +mkfile_path := $(abspath $(lastword $(MAKEFILE_LIST))) +tmk_root := $(patsubst %/,%,$(dir $(mkfile_path))) + +ifneq (,$(findstring /keyboard/,$(starting_makefile))) + possible_keyboard:=$(patsubst %/,%,$(dir $(patsubst $(tmk_root)/keyboard/%,%,$(starting_makefile)))) + ifneq (,$(findstring /keymaps/,$(possible_keyboard))) + KEYBOARD_DIR:=$(firstword $(subst /keymaps/, ,$(possible_keyboard))) + KEYMAP_DIR:=$(lastword $(subst /keymaps/, ,$(possible_keyboard))) + else + KEYBOARD_DIR:=$(possible_keyboard) + KEYMAP_DIR:=default + endif +endif + +# $(info $(KEYBOARD_DIR)) +# $(info $(KEYMAP_DIR)) + +# Directory common source filess exist +TOP_DIR = $(tmk_root) +TMK_DIR = tmk_core +TMK_PATH = $(TOP_DIR)/$(TMK_DIR) + +QUANTUM_DIR = quantum +QUANTUM_PATH = $(TOP_DIR)/$(QUANTUM_DIR) + +ifdef keyboard + KEYBOARD ?= $(keyboard) +endif +ifdef KEYBOARD_DIR + KEYBOARD ?= $(KEYBOARD_DIR) +endif +ifndef KEYBOARD + KEYBOARD=planck +endif +KEYBOARD_PATH = $(TOP_DIR)/keyboard/$(KEYBOARD) +ifneq ("$(wildcard $(KEYBOARD_PATH)/$(KEYBOARD).c)","") + KEYBOARD_FILE = keyboard/$(KEYBOARD)/$(KEYBOARD).c + ifndef ARCH + include $(KEYBOARD_PATH)/Makefile + endif +else +$(error "$(KEYBOARD_PATH)/$(KEYBOARD).c" does not exist) +endif + +ifdef keymap + KEYMAP ?= $(keymap) +endif +ifdef KEYMAP_DIR + KEYMAP ?= $(KEYMAP_DIR) +endif +ifndef KEYMAP + KEYMAP = default +endif +KEYMAP_PATH = $(KEYBOARD_PATH)/keymaps/$(KEYMAP) +ifneq ("$(wildcard $(KEYMAP_PATH)/keymap.c)","") + KEYMAP_FILE = keyboard/$(KEYBOARD)/keymaps/$(KEYMAP)/keymap.c + -include $(KEYMAP_PATH)/Makefile +else +$(error "$(KEYMAP_PATH)/keymap.c" does not exist) +endif + +TARGET = $(KEYBOARD)_$(KEYMAP) + +ifneq ("$(wildcard $(KEYMAP_PATH)/config.h)","") + CONFIG_H = $(KEYMAP_PATH)/config.h +else + CONFIG_H = $(KEYBOARD_PATH)/config.h +endif + +# # project specific files +SRC += $(KEYBOARD_FILE) \ + $(KEYMAP_FILE) \ + $(QUANTUM_DIR)/quantum.c \ + $(QUANTUM_DIR)/keymap_common.c \ + $(QUANTUM_DIR)/led.c + +ifndef CUSTOM_MATRIX + SRC += $(QUANTUM_DIR)/matrix.c +endif + +ifeq ($(strip $(AUDIO_ENABLE)), yes) + SRC += $(QUANTUM_DIR)/audio/audio.c + SRC += $(QUANTUM_DIR)/audio/voices.c + SRC += $(QUANTUM_DIR)/audio/luts.c +endif + +ifeq ($(strip $(RGBLIGHT_ENABLE)), yes) + SRC += $(QUANTUM_DIR)/light_ws2812.c + SRC += $(QUANTUM_DIR)/rgblight.c + OPT_DEFS += -DRGBLIGHT_ENABLE +endif + +# Optimize size but this may cause error "relocation truncated to fit" +#EXTRALDFLAGS = -Wl,--relax + +# Search Path +VPATH += $(KEYMAP_PATH) +VPATH += $(KEYBOARD_PATH) +VPATH += $(TOP_DIR) +VPATH += $(TMK_PATH) +VPATH += $(QUANTUM_PATH) +VPATH += $(QUANTUM_PATH)/keymap_extras +VPATH += $(QUANTUM_PATH)/audio + +include $(TMK_PATH)/protocol/lufa.mk +include $(TMK_PATH)/common.mk +include $(TMK_PATH)/rules.mk \ No newline at end of file diff --git a/README.md b/README.md index 4e53569a8e8..0990dd8341c 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,4 @@ +[![Build Status](https://travis-ci.org/jackhumbert/qmk_firmware.svg?branch=master)](https://travis-ci.org/jackhumbert/qmk_firmware) # Quantum Mechanical Keyboard Firmware This is a keyboard firmware based on the [tmk_keyboard firmware](http://github.com/tmk/tmk_keyboard) with some useful features for Atmel AVR controllers, and more specifically, the [OLKB product line](http://olkb.co), the [ErgoDox EZ](http://www.ergodox-ez.com) keyboard, and the [Clueboard product line](http://clueboard.co/). @@ -8,15 +9,23 @@ This documentation is edited and maintained by Erez Zukerman of ErgoDox EZ. If y The OLKB product firmwares are maintained by Jack, the Ergodox EZ by Erez, and the Clueboard by [Zach White](https://github.com/skullydazed). -## Important background info: TMK documentation +## Documentation roadmap -The documentation below explains QMK customizations and elaborates on some of the more useful features of TMK. To understand the base firmware, and especially what *layers* are and how they work, please see [TMK_README.md](/TMK_README.md). +This is not a tiny project. While this is the main Readme, there are many other files you might want to consult. Here are some points of interest: + +* The Readme for your own keyboard: This is found under `keyboards//`. So for the ErgoDox EZ, it's [here](keyboard/ergodox_ez/); for the Atomic, it's [here](keyboard/atomic/) and so on. +* The [build guide](doc/BUILD_GUIDE.md), also mentioned in the next section. This is how you put your development environment together so you can compile the firmware. +* The list of possible keycodes you can use in your keymap is actually spread out in a few different places: + * [tmk_core/common/keycode.h](tmk_core/common/keycode.h) - the base TMK keycodes. This is the actual source file. + * [doc/keycode.txt](doc/keycode.txt) - an explanation of those same keycodes. + * [quantum/keymap_common.h](quantum/keymap_common.h) - this is where the QMK-specific aliases are all set up. Things like the Hyper and Meh key, the Leader key, and all of the other QMK innovations. These are also explained and documented below, but `keymap_common.h` is where they're actually defined. +* The [TMK documentation](doc/TMK_README.md). QMK is based on TMK, and this explains how it works internally. ## Getting started -* [BUILD_GUIDE.md](BUILD_GUIDE.md) contains instructions to set up a build environment, build the firmware, and deploy it to a keyboard. Once your build environment has been set up, all `make` commands to actually build the firmware must be run from a folder in `keyboard/`. +* [BUILD_GUIDE.md](doc/BUILD_GUIDE.md) contains instructions to set up a build environment, build the firmware, and deploy it to a keyboard. Once your build environment has been set up, all `make` commands to actually build the firmware must be run from a folder in `keyboard/`. * If you're looking to customize a keyboard that currently runs QMK or TMK, find your keyboard's directory under `keyboard/` and run the make commands from there. -* If you're looking to apply this firmware to an entirely new hardware project (a new kind of keyboard), you can create your own Quantum-based project by using `./new_project.sh `, which will create `/keyboard/` with all the necessary components for a Quantum project. +* If you're looking to apply this firmware to an entirely new hardware project (a new kind of keyboard), you can create your own Quantum-based project by using `util/new_project.sh `, which will create `/keyboard/` with all the necessary components for a Quantum project. ### Makefile Options @@ -85,6 +94,7 @@ The following shortcuts automatically add `LSFT()` to keycodes to get commonly u KC_RPRN ) KC_UNDS _ KC_PLUS + + KC_DQUO " KC_LCBR { KC_RCBR } KC_LABK < @@ -118,6 +128,56 @@ We've added shortcuts to make common modifier/tap (mod-tap) mappings more compac * `LCAG_T(kc)` - is CtrlAltGui when held and *kc* when tapped * `MEH_T(kc)` - is like Hyper, but not as cool -- does not include the Cmd/Win key, so just sends Alt+Ctrl+Shift. +### Space Cadet Shift: The future, built in + +Steve Losh [described](http://stevelosh.com/blog/2012/10/a-modern-space-cadet/) the Space Cadet Shift quite well. Essentially, you hit the left Shift on its own, and you get an opening parenthesis; hit the right Shift on its own, and you get the closing one. When hit with other keys, the Shift key keeps working as it always does. Yes, it's as cool as it sounds. + +To use it, use `KC_LSPO` (Left Shift, Parens Open) for your left Shift on your keymap, and `KC_RSPC` (Right Shift, Parens Close) for your right Shift. + +The only other thing you're going to want to do is create a `makefile.mk` in your keymap directory and set the following: + +``` +COMMAND_ENABLE = no # Commands for debug and configuration +``` + +This is just to keep the keyboard from going into command mode when you hold both Shift keys at the same time. + +### The Leader key: A new kind of modifier + +If you've ever used Vim, you know what a Leader key is. If not, you're about to discover a wonderful concept. :) Instead of hitting Alt+Shift+W for example (holding down three keys at the same time), what if you could hit a _sequence_ of keys instead? So you'd hit our special modifier (the Leader key), followed by W and then C (just a rapid succession of keys), and something would happen. + +That's what `KC_LEAD` does. Here's an example: + +1. Pick a key on your keyboard you want to use as the Leader key. Assign it the keycode `KC_LEAD`. This key would be dedicated just for this -- it's a single action key, can't be used for anything else. +2. Include the line `#define LEADER_TIMEOUT 300` somewhere in your keymap.c file, probably near the top. The 300 there is 300ms -- that's how long you have for the sequence of keys following the leader. You can tweak this value for comfort, of course. +3. Within your `matrix_scan_user` function, do something like this: + +``` +void matrix_scan_user(void) { + LEADER_DICTIONARY() { + leading = false; + leader_end(); + + SEQ_ONE_KEY(KC_F) { + register_code(KC_S); + unregister_code(KC_S); + } + SEQ_TWO_KEYS(KC_A, KC_S) { + register_code(KC_H); + unregister_code(KC_H); + } + SEQ_THREE_KEYS(KC_A, KC_S, KC_D) { + register_code(KC_LGUI); + register_code(KC_S); + unregister_code(KC_S); + unregister_code(KC_LGUI); + } + } +} +``` + +As you can see, you have three function. you can use - `SEQ_ONE_KEY` for single-key sequences (Leader followed by just one key), and `SEQ_TWO_KEYS` and `SEQ_THREE_KEYS` for longer sequences. Each of these accepts one or more keycodes as arguments. This is an important point: You can use keycodes from **any layer on your keyboard**. That layer would need to be active for the leader macro to fire, obviously. + ### Temporarily setting the default layer `DF(layer)` - sets default layer to *layer*. The default layer is the one at the "bottom" of the layer stack - the ultimate fallback layer. This currently does not persist over power loss. When you plug the keyboard back in, layer 0 will always be the default. It is theoretically possible to work around that, but that's not what `DF` does. @@ -145,7 +205,7 @@ rounded up (5 bits per key). For example on Planck (48 keys) it uses ### Remember: These are just aliases -These functions work the same way that their `ACTION_*` functions do - they're just quick aliases. To dig into all of the tmk ACTION_* functions, please see the [TMK documentation](https://github.com/jackhumbert/qmk_firmware/blob/master/tmk_core/doc/keymap.md#2-action). +These functions work the same way that their `ACTION_*` functions do - they're just quick aliases. To dig into all of the tmk ACTION_* functions, please see the [TMK documentation](https://github.com/jackhumbert/qmk_firmware/blob/master/doc/keymap.md#2-action). Instead of using `FNx` when defining `ACTION_*` functions, you can use `F(x)` - the benefit here is being able to use more than 32 function actions (up to 4096), if you happen to need them. @@ -258,9 +318,9 @@ if (timer_elapsed(key_timer) < 100) { } ``` -It's best to declare the `static uint16_t key_timer;` outside of the macro block (top of file, etc). +It's best to declare the `static uint16_t key_timer;` outside of the macro block (top of file, etc). -#### Example 1: Single-key copy/paste (hold to copy, tap to paste) +#### Example: Single-key copy/paste (hold to copy, tap to paste) With QMK, it's easy to make one key do two things, as long as one of those things is being a modifier. :) So if you want a key to act as Ctrl when held and send the letter R when tapped, that's easy: `CTL_T(KC_R)`. But what do you do when you want that key to send Ctrl-V (paste) when tapped, and Ctrl-C (copy) when held? @@ -276,7 +336,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) case 0: { if (record->event.pressed) { key_timer = timer_read(); // if the key is being pressed, we start the timer. - } + } else { // this means the key was just released, so we can figure out how long it was pressed for (tap or "held down"). if (timer_elapsed(key_timer) > 150) { // 150 being 150ms, the threshhold we pick for counting something as a tap. return MACRO( D(LCTL), T(C), U(LCTL), END ); @@ -294,52 +354,6 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) And then, to assign this macro to a key on your keyboard layout, you just use `M(0)` on the key you want to press for copy/paste. -#### Example 2: Space Cadet Shift (making it easy to send opening and closing parentheses) - -In the [Modern Space Cadet Keyboard](http://stevelosh.com/blog/2012/10/a-modern-space-cadet/#shift-parentheses), one of cooler features is the Shift Parentheses. To quote Steve Losh: - - > When held while pressing other keys, act like Shift. - > When pressed and released on their own, type an opening or closing parenthesis (left and right shift respectively). - -``` -static uint16_t key_timer; - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - switch(id) { - case 0: { - if (record->event.pressed) { - key_timer = timer_read(); // if the key is being pressed, we start the timer. - register_code(KC_LSFT); // we're now holding down Shift. - } else { // this means the key was just released, so we can figure out how long it was pressed for (tap or "held down"). - if (timer_elapsed(key_timer) < 150) { // 150 being 150ms, the threshhold we pick for counting something as a tap. - register_code(KC_9); // sending 9 while Shift is held down gives us an opening paren - unregister_code(KC_9); // now let's let go of that key - } - unregister_code(KC_LSFT); // let's release the Shift key now. - } - break; - } - case 1: { - if (record->event.pressed) { - key_timer = timer_read(); // Now we're doing the same thing, only for the right shift/close paren key - register_code(KC_RSFT); - } else { - if (timer_elapsed(key_timer) < 150) { - register_code(KC_0); - unregister_code(KC_0); - } - unregister_code(KC_RSFT); - } - break; - } - } - return MACRO_NONE; -}; -``` - -And then, to assign this macro to a key on your keyboard layout, you just use `M(0)` on the key you want to press for left shift/opening parens, and `M(1)` for right shift/closing parens. - ## Additional keycode aliases for software-implemented layouts (Colemak, Dvorak, etc) Everything is assuming you're in Qwerty (in software) by default, but there is built-in support for using a Colemak or Dvorak layout by including this at the top of your keymap: @@ -510,4 +524,4 @@ what things are (and likely aren't) too risky. - EEPROM has around a 100000 write cycle. You shouldn't rewrite the firmware repeatedly and continually; that'll burn the EEPROM eventually. - + diff --git a/Vagrantfile b/Vagrantfile index 1abe8ff3b1d..a6c3afd385f 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -1,88 +1,98 @@ -# -*- mode: ruby -*- -# vi: set ft=ruby : - -Vagrant.configure(2) do |config| - # You can only have one config.vm.box uncommented at a time - - # Comment this and uncomment another if you don't want to use the minimal Arch box - config.vm.box = "dragon788/arch-ala-elasticdog" - - # VMware/Virtualbox 64 bit - # config.vm.box = "phusion/ubuntu-14.04-amd64" - # - # VMware/Virtualbox 64 bit - #config.vm.box = "puphpet/centos65-x64" - # - # The opensuse boxes don't have dfu-util in their default repositories - # - # The virtualbox version has tools issues - # VMware/Virtualbox 64 bit - #config.vm.box = "bento/opensuse-13.2-x86_64" - # - # Virtualbox only - #config.vm.box = "bento/opensuse-13.2-i386" - # config.vm.box = "" - # config.vm.box = "" - - # This section allows you to customize the Virtualbox VM - # settings, ie showing the GUI or upping the memory - # or cores if desired - config.vm.provider "virtualbox" do |vb| - # Hide the VirtualBox GUI when booting the machine - vb.gui = false - # Uncomment the below lines if you want to program - # your Teensy via the VM rather than your host OS - #vb.customize ['modifyvm', :id, '--usb', 'on'] - #vb.customize ['usbfilter', 'add', '0', - # '--target', :id, - # '--name', 'teensy', - # '--vendorid', '0x16c0', - # '--productid','0x0478' - # ] - # Customize the amount of memory on the VM: - vb.memory = "512" - end - - # This section allows you to customize the VMware VM - # settings, ie showing the GUI or upping the memory - # or cores if desired - config.vm.provider "vmware_workstation" do |vmw| - # Hide the VMware GUI when booting the machine - vmw.gui = false - - # Customize the amount of memory on the VM: - vmw.memory = "512" - end - - config.vm.provider "vmware_fusion" do |vmf| - # Hide the vmfare GUI when booting the machine - vmf.gui = false - - # Customize the amount of memory on the VM: - vmf.memory = "512" - end - - # This script ensures the required packages for AVR programming are installed - # It also ensures the system always gets the latest updates when powered on - # If this causes issues you can run a 'vagrant destroy' and then - # add a # before ,args: and run 'vagrant up' to get a working - # non-updated box and then attempt to troubleshoot or open a Github issue - - config.vm.provision "shell", run: "always", path: "avr_setup.sh", args: "-update" - - config.vm.post_up_message = """ - Log into the VM using 'vagrant ssh' on OSX or from Git Bash (Win) - or 'vagrant ssh-config' and Putty or Bitvise SSH or another SSH tool - - Change directory (cd) to the keyboard you wish to program - (Optionally) modify your layout, - then run 'make clean' - and then 'make' to compile the .eep and .hex files. - - Or you can copy and paste the example line below. - - cd /vagrant; cd keyboard; cd ergodox_ez; make clean; make - - - """ -end +# -*- mode: ruby -*- +# vi: set ft=ruby : + +Vagrant.configure(2) do |config| + # You can only have one config.vm.box uncommented at a time + + # Comment this and uncomment another if you don't want to use the minimal Arch box + config.vm.box = "dragon788/arch-ala-elasticdog" + + # VMware/Virtualbox 64 bit + # config.vm.box = "phusion/ubuntu-14.04-amd64" + # + # VMware/Virtualbox 64 bit + #config.vm.box = "puphpet/centos65-x64" + # + # The opensuse boxes don't have dfu-util in their default repositories + # + # The virtualbox version has tools issues + # VMware/Virtualbox 64 bit + #config.vm.box = "bento/opensuse-13.2-x86_64" + # + # Virtualbox only + #config.vm.box = "bento/opensuse-13.2-i386" + # config.vm.box = "" + # config.vm.box = "" + + # This section allows you to customize the Virtualbox VM + # settings, ie showing the GUI or upping the memory + # or cores if desired + config.vm.provider "virtualbox" do |vb| + # Hide the VirtualBox GUI when booting the machine + vb.gui = false + # Uncomment the below lines if you want to program + # your Teensy via the VM rather than your host OS + #vb.customize ['modifyvm', :id, '--usb', 'on'] + #vb.customize ['usbfilter', 'add', '0', + # '--target', :id, + # '--name', 'teensy', + # '--vendorid', '0x16c0', + # '--productid','0x0478' + # ] + # Customize the amount of memory on the VM: + vb.memory = "512" + end + + # This section allows you to customize the VMware VM + # settings, ie showing the GUI or upping the memory + # or cores if desired + config.vm.provider "vmware_workstation" do |vmw| + # Hide the VMware GUI when booting the machine + vmw.gui = false + + # Customize the amount of memory on the VM: + vmw.memory = "512" + end + + config.vm.provider "vmware_fusion" do |vmf| + # Hide the vmfare GUI when booting the machine + vmf.gui = false + + # Customize the amount of memory on the VM: + vmf.memory = "512" + end + + # Docker provider pulls from hub.docker.com respecting docker.image if + # config.vm.box is nil. Note that this bind-mounts from the current dir to + # /vagrant in the guest, so unless your UID is 1000 to match vagrant in the + # image, you'll need to: chmod -R a+rw . + config.vm.provider "docker" do |docker, override| + override.vm.box = nil + docker.image = "jesselang/debian-vagrant:jessie" + docker.has_ssh = true + end + + # This script ensures the required packages for AVR programming are installed + # It also ensures the system always gets the latest updates when powered on + # If this causes issues you can run a 'vagrant destroy' and then + # add a # before ,args: and run 'vagrant up' to get a working + # non-updated box and then attempt to troubleshoot or open a Github issue + + config.vm.provision "shell", run: "always", path: "./util/avr_setup.sh", args: "-update" + + config.vm.post_up_message = <<-EOT + Log into the VM using 'vagrant ssh' on OSX or from Git Bash (Win) + or 'vagrant ssh-config' and Putty or Bitvise SSH or another SSH tool + + Change directory (cd) to the keyboard you wish to program + (Optionally) modify your layout, + then run 'make clean' + and then 'make' to compile the .eep and .hex files. + + Or you can copy and paste the example line below. + + cd /vagrant; cd keyboard; cd ergodox_ez; make clean; make + + + EOT +end diff --git a/converter/adb_usb/Makefile.pjrc b/converter/adb_usb/Makefile.pjrc deleted file mode 100644 index c320c09d255..00000000000 --- a/converter/adb_usb/Makefile.pjrc +++ /dev/null @@ -1,73 +0,0 @@ -# Target file name (without extension). -TARGET = adb_usb_pjrc - -# Directory common source filess exist -TMK_DIR = ../../tmk_core - -# Directory keyboard dependent files exist -TARGET_DIR = . - -# keyboard dependent files -SRC = keymap_common.c \ - matrix.c \ - led.c \ - adb.c - -ifdef KEYMAP - SRC := keymap_$(KEYMAP).c $(SRC) -else - SRC := keymap_ansi.c $(SRC) -endif - -CONFIG_H = config.h - - -# MCU name, you MUST set this to match the board you are using -# type "make clean" after changing this, so all files will be rebuilt -#MCU = at90usb162 # Teensy 1.0 -MCU = atmega32u4 # Teensy 2.0 -#MCU = at90usb646 # Teensy++ 1.0 -#MCU = at90usb1286 # Teensy++ 2.0 - - -# Processor frequency. -# Normally the first thing your program should do is set the clock prescaler, -# so your program will run at the correct speed. You should also set this -# variable to same clock speed. The _delay_ms() macro uses this, and many -# examples use this variable to calculate timings. Do not add a "UL" here. -F_CPU = 16000000 - - -# Boot Section Size in *bytes* -# Teensy halfKay 512 -# Teensy++ halfKay 1024 -# Atmel DFU loader 4096 -# LUFA bootloader 4096 -# USBaspLoader 2048 -OPT_DEFS += -DBOOTLOADER_SIZE=4096 - - -# Build Options -# comment out to disable the options. -# -BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE = yes # Mouse keys(+5000) -EXTRAKEY_ENABLE = yes # Audio control and System control(+600) -CONSOLE_ENABLE = yes # Console for debug -COMMAND_ENABLE = yes # Commands for debug and configuration -#SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend -#NKRO_ENABLE = yes # USB Nkey Rollover(+500) -ADB_MOUSE_ENABLE = yes - -# ADB Mice need acceleration for todays much bigger screens. -OPT_DEFS += -DADB_MOUSE_MAXACC=8 - - -# Search Path -VPATH += $(TARGET_DIR) -VPATH += $(TMK_DIR) - -include $(TMK_DIR)/protocol/pjrc.mk -include $(TMK_DIR)/protocol.mk -include $(TMK_DIR)/common.mk -include $(TMK_DIR)/rules.mk diff --git a/converter/adb_usb/README.md b/converter/adb_usb/README.md deleted file mode 100644 index 46082ff67f9..00000000000 --- a/converter/adb_usb/README.md +++ /dev/null @@ -1,103 +0,0 @@ -ADB to USB keyboard converter -============================= -This firmware converts ADB keyboard protocol to USB. -You can use PJRC Teensy for this converter, though, other USB AVR(ATMega32U4, AT90USB64/128 or etc) should work. -But binary size is about 10KB or more it doesn't fit into 8K flash like ATMega8U2. - -Discuss: http://geekhack.org/showwiki.php?title=Island:14290 - - - -README FIRST ------------- -https://github.com/tmk/tmk_keyboard -https://github.com/tmk/tmk_keyboard/tree/master/converter/adb_usb - -Also check these when you are in trouble. - -https://github.com/tmk/tmk_keyboard/wiki -https://github.com/tmk/tmk_keyboard/labels/NOTE - - -Wiring ------- -Connect ADB pins to controller just by 3 lines(Vcc, GND, Data). By default Data line uses port PD0. - -ADB female socket from the front: - - ,--_--. - / o4 3o \ 1: DATA - | o2 1o | 2: Power SW - - === - 3: VCC - `-___-' 4: GND - -This converter uses AVR's internal pull-up, but it seems to be too weak, in particular when you want to use a long or coiled cable. The external pull-up resistor(1K-10K Ohm) on Data is strongly recommended.(It is almost must!) -https://github.com/tmk/tmk_keyboard/wiki/FAQ#pull-up-resistor - -Pull-up resister: - - Keyboard Conveter - ,------. - 5V------+------|VCC | - | | | - [R] | | - | | | - Signal--+------|PD0 | - | | - GND------------|GND | - `------' - R: 1K Ohm resistor - - -Define following macros for ADB connection in config.h if you use other than port PD0. - - ADB_PORT, ADB_PIN, ADB_DDR, ADB_DATA_BIT - - -Build ------ -See doc/build.md. In short, - - $ make clean - $ make - -You can select keymap(ansi is default) like this: - - $ make KEYMAP=[ansi|iso|hasu] - - -Keymap ------- -You can change a keymap by editing code of keymap_[ansi|iso|hasu|yours].c. -How to define the keymap is probably obvious. You can find key symbols in common/keycode.h. And see doc/keymap.md for more detail. - - -Magic command -------------- -To get help press `h` holding Magic key. Magic key is `Power key`. - - -Locking CapsLock ----------------- -Many of old ADB keyboards have mechanical push-lock switch for Capslock key and this converter supports the locking Capslock key by default. See README in top directory for more detail about this feature. -https://github.com/tmk/tmk_keyboard/blob/master/README.md#mechanical-locking-support - -Also you may want to remove locking pin from the push-lock switch to use capslock as a normal momentary switch. - - -Notes ------ -Not-extended ADB keyboards have no discrimination between right modifier and left one, -you will always see left control even if you press right control key. -Apple Extended Keyboard and Apple Extended Keyboard II can discriminate both side -modifiers except for GUI key(Windows/Command). - -And most ADB keyboard has no diodes in its matrix so they are not NKRO, -though ADB protocol itself supports it. See protocol/adb.c for more info. - -If keyboard has ISO layout you need to use ISO keymap with `make KEYMAP=iso`. With ANSI -keymap you will suffer from swapped keys problem. - -https://github.com/tmk/tmk_keyboard/issues/35 - -EOF diff --git a/converter/adb_usb/config.h b/converter/adb_usb/config.h deleted file mode 100644 index 5ce5c221594..00000000000 --- a/converter/adb_usb/config.h +++ /dev/null @@ -1,63 +0,0 @@ -/* -Copyright 2011 Jun Wako - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#ifndef CONFIG_H -#define CONFIG_H - - -#define VENDOR_ID 0xFEED -#define PRODUCT_ID 0x0ADB -#define DEVICE_VER 0x0101 -#define MANUFACTURER t.m.k. -#define PRODUCT ADB keyboard converter -#define DESCRIPTION convert ADB keyboard to USB - -/* matrix size */ -#define MATRIX_ROWS 16 // keycode bit: 3-0 -#define MATRIX_COLS 8 // keycode bit: 6-4 - -#define MATRIX_ROW(code) ((code)>>3&0x0F) -#define MATRIX_COL(code) ((code)&0x07) - - -/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ -#define LOCKING_SUPPORT_ENABLE -/* Locking resynchronize hack */ -#define LOCKING_RESYNC_ENABLE - - -/* legacy keymap support */ -#define USE_LEGACY_KEYMAP - - -/* ADB port setting */ -#define ADB_PORT PORTD -#define ADB_PIN PIND -#define ADB_DDR DDRD -#define ADB_DATA_BIT 0 -//#define ADB_PSW_BIT 1 // optional - -/* key combination for command */ -#ifndef __ASSEMBLER__ -#include "adb.h" -#include "matrix.h" -#define IS_COMMAND() ( \ - matrix_is_on(MATRIX_ROW(ADB_POWER), MATRIX_COL(ADB_POWER)) \ -) -#endif - -#endif diff --git a/converter/adb_usb/keymap_ansi.c b/converter/adb_usb/keymap_ansi.c deleted file mode 100644 index 4ea601be0a0..00000000000 --- a/converter/adb_usb/keymap_ansi.c +++ /dev/null @@ -1,16 +0,0 @@ -#include "keymap_common.h" - - -const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - KEYMAP_EXT_ANSI( - ESC, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, PSCR,SLCK,PAUS, NO, - GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, BSPC, INS, HOME,PGUP, NLCK,PEQL,PSLS,PAST, - TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC,RBRC,BSLS, DEL, END, PGDN, P7, P8, P9, PMNS, - LCAP,A, S, D, F, G, H, J, K, L, SCLN,QUOT, ENT, P4, P5, P6, PPLS, - LSFT,Z, X, C, V, B, N, M, COMM,DOT, SLSH, RSFT, UP, P1, P2, P3, - LCTL,LALT,LGUI, SPC, RALT,RCTL, LEFT,DOWN,RGHT, P0, PDOT,PENT - ), -}; - -const uint16_t PROGMEM fn_actions[] = { -}; diff --git a/converter/adb_usb/keymap_common.c b/converter/adb_usb/keymap_common.c deleted file mode 100644 index 55a13793cbb..00000000000 --- a/converter/adb_usb/keymap_common.c +++ /dev/null @@ -1,30 +0,0 @@ -/* -Copyright 2011,2012,2013 Jun Wako - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ -#include "keymap_common.h" - - -/* translates key to keycode */ -uint8_t keymap_key_to_keycode(uint8_t layer, keypos_t key) -{ - return pgm_read_byte(&keymaps[(layer)][(key.row)][(key.col)]); -} - -/* translates Fn keycode to action */ -action_t keymap_fn_to_action(uint8_t keycode) -{ - return (action_t){ .code = pgm_read_word(&fn_actions[FN_INDEX(keycode)]) }; -} diff --git a/converter/adb_usb/keymap_common.h b/converter/adb_usb/keymap_common.h deleted file mode 100644 index bdca38e129a..00000000000 --- a/converter/adb_usb/keymap_common.h +++ /dev/null @@ -1,212 +0,0 @@ -/* -Copyright 2011,2012,2013 Jun Wako - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ -#ifndef KEYMAP_COMMON_H -#define KEYMAP_COMMON_H - -#include -#include -#include -#include "keycode.h" -#include "action.h" -#include "action_macro.h" -#include "report.h" -#include "print.h" -#include "debug.h" -#include "keymap.h" - - -extern const uint8_t keymaps[][MATRIX_ROWS][MATRIX_COLS]; -extern const uint16_t fn_actions[]; - - -/* M0115 Apple Extended Keyboard ANSI - * ,---. ,---------------. ,---------------. ,---------------. ,-----------. ,---. - * |Esc| |F1 |F2 |F3 |F4 | |F5 |F6 |F7 |F8 | |F9 |F10|F11|F12| |PrS|ScL|Pau| |Pwr| - * `---' `---------------' `---------------' `---------------' `-----------' `---' - * ,-----------------------------------------------------------. ,-----------. ,---------------. - * | `| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Backspa| |Ins|Hom|PgU| |NmL| =| /| *| - * |-----------------------------------------------------------| |-----------| |---------------| - * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \| |Del|End|PgD| | 7| 8| 9| -| - * |-----------------------------------------------------------| `-----------' |---------------| - * |CapsLo| A| S| D| F| G| H| J| K| L| ;| '|Return | | 4| 5| 6| +| - * |-----------------------------------------------------------| ,---. |---------------| - * |Shift | Z| X| C| V| B| N| M| ,| ,| /|Shift | |Up | | 1| 2| 3| | - * |-----------------------------------------------------------| ,-----------. |-----------|Ent| - * |Ctrl |Opt |Cmd | Space | |Opt |Ctrl | |Lef|Dow|Rig| | 0| .| | - * `-----------------------------------------------------------' `-----------' `---------------' - */ -#define KEYMAP_EXT_ANSI( \ - K35, K7A,K78,K63,K76, K60,K61,K62,K64, K65,K6D,K67,K6F, K69,K6B,K71, K7F, \ - K32,K12,K13,K14,K15,K17,K16,K1A,K1C,K19,K1D,K1B,K18,K33, K72,K73,K74, K47,K51,K4B,K43, \ - K30,K0C,K0D,K0E,K0F,K11,K10,K20,K22,K1F,K23,K21,K1E,K2A, K75,K77,K79, K59,K5B,K5C,K4E, \ - K39,K00,K01,K02,K03,K05,K04,K26,K28,K25,K29,K27, K24, K56,K57,K58,K45, \ - K38,K06,K07,K08,K09,K0B,K2D,K2E,K2B,K2F,K2C, K7B, K3E, K53,K54,K55, \ - K36,K3A,K37, K31, K7C,K7D, K3B,K3D,K3C, K52, K41,K4C \ -) { \ - { KC_##K00, KC_##K01, KC_##K02, KC_##K03, KC_##K04, KC_##K05, KC_##K06, KC_##K07 }, \ - { KC_##K08, KC_##K09, KC_NUBS, KC_##K0B, KC_##K0C, KC_##K0D, KC_##K0E, KC_##K0F }, \ - { KC_##K10, KC_##K11, KC_##K12, KC_##K13, KC_##K14, KC_##K15, KC_##K16, KC_##K17 }, \ - { KC_##K18, KC_##K19, KC_##K1A, KC_##K1B, KC_##K1C, KC_##K1D, KC_##K1E, KC_##K1F }, \ - { KC_##K20, KC_##K21, KC_##K22, KC_##K23, KC_##K24, KC_##K25, KC_##K26, KC_##K27 }, \ - { KC_##K28, KC_##K29, KC_##K2A, KC_##K2B, KC_##K2C, KC_##K2D, KC_##K2E, KC_##K2F }, \ - { KC_##K30, KC_##K31, KC_##K32, KC_##K33, KC_PENT, KC_##K35, KC_##K36, KC_##K37 }, \ - { KC_##K38, KC_##K39, KC_##K3A, KC_##K3B, KC_##K3C, KC_##K3D, KC_##K3E, KC_NO }, \ - { KC_F17, KC_##K41, KC_NO, KC_##K43, KC_F18, KC_##K45, KC_NO, KC_##K47 }, \ - { KC_NO, KC_NO, KC_NO, KC_##K4B, KC_##K4C, KC_NO, KC_##K4E, KC_F18 }, \ - { KC_F19, KC_##K51, KC_##K52, KC_##K53, KC_##K54, KC_##K55, KC_##K56, KC_##K57 }, \ - { KC_##K58, KC_##K59, KC_F20, KC_##K5B, KC_##K5C, KC_INT3, KC_INT1, KC_PCMM }, \ - { KC_##K60, KC_##K61, KC_##K62, KC_##K63, KC_##K64, KC_##K65, KC_LANG2, KC_##K67 }, \ - { KC_LANG1, KC_##K69, KC_F16, KC_##K6B, KC_NO, KC_##K6D, KC_APP, KC_##K6F }, \ - { KC_NO, KC_##K71, KC_##K72, KC_##K73, KC_##K74, KC_##K75, KC_##K76, KC_##K77 }, \ - { KC_##K78, KC_##K79, KC_##K7A, KC_##K7B, KC_##K7C, KC_##K7D, KC_NO, KC_##K7F } \ -} - -/* M0115 Apple Extended Keyboard ISO - * ,---. ,---------------. ,---------------. ,---------------. ,-----------. ,---. - * |Esc| |F1 |F2 |F3 |F4 | |F5 |F6 |F7 |F8 | |F9 |F10|F11|F12| |PrS|ScL|Pau| |Pwr| - * `---' `---------------' `---------------' `---------------' `-----------' `---' - * ,-----------------------------------------------------------. ,-----------. ,---------------. - * | `| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Backspa| |Ins|Hom|PgU| |NmL| =| /| *| - * |-----------------------------------------------------------| |-----------| |---------------| - * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]|Retur| |Del|End|PgD| | 7| 8| 9| -| - * |------------------------------------------------------` | `-----------' |---------------| - * |CapsLo| A| S| D| F| G| H| J| K| L| ;| '| #| | | 4| 5| 6| +| - * |-----------------------------------------------------------| ,---. |---------------| - * |Shif| \| Z| X| C| V| B| N| M| ,| ,| /|Shift | |Up | | 1| 2| 3| | - * |-----------------------------------------------------------| ,-----------. |-----------|Ent| - * |Ctrl |Opt |Cmd | Space | |Opt |Ctrl | |Lef|Dow|Rig| | 0| .| | - * `-----------------------------------------------------------' `-----------' `---------------' - */ -#define KEYMAP_EXT_ISO( \ - K35, K7A,K78,K63,K76, K60,K61,K62,K64, K65,K6D,K67,K6F, K69,K6B,K71, K7F, \ - K32,K12,K13,K14,K15,K17,K16,K1A,K1C,K19,K1D,K1B,K18,K33, K72,K73,K74, K47,K51,K4B,K43, \ - K30,K0C,K0D,K0E,K0F,K11,K10,K20,K22,K1F,K23,K21,K1E,K24, K75,K77,K79, K59,K5B,K5C,K4E, \ - K39,K00,K01,K02,K03,K05,K04,K26,K28,K25,K29,K27,K2A, K56,K57,K58,K45, \ - K38,K0A,K06,K07,K08,K09,K0B,K2D,K2E,K2B,K2F,K2C, K7B, K3E, K53,K54,K55, \ - K36,K3A,K37, K31, K7C,K7D, K3B,K3D,K3C, K52, K41,K4C \ -) { \ - { KC_##K00, KC_##K01, KC_##K02, KC_##K03, KC_##K04, KC_##K05, KC_##K06, KC_##K07 }, \ - { KC_##K08, KC_##K09, KC_##K0A, KC_##K0B, KC_##K0C, KC_##K0D, KC_##K0E, KC_##K0F }, \ - { KC_##K10, KC_##K11, KC_##K12, KC_##K13, KC_##K14, KC_##K15, KC_##K16, KC_##K17 }, \ - { KC_##K18, KC_##K19, KC_##K1A, KC_##K1B, KC_##K1C, KC_##K1D, KC_##K1E, KC_##K1F }, \ - { KC_##K20, KC_##K21, KC_##K22, KC_##K23, KC_##K24, KC_##K25, KC_##K26, KC_##K27 }, \ - { KC_##K28, KC_##K29, KC_##K2A, KC_##K2B, KC_##K2C, KC_##K2D, KC_##K2E, KC_##K2F }, \ - { KC_##K30, KC_##K31, KC_##K32, KC_##K33, KC_PENT, KC_##K35, KC_##K36, KC_##K37 }, \ - { KC_##K38, KC_##K39, KC_##K3A, KC_##K3B, KC_##K3C, KC_##K3D, KC_##K3E, KC_NO }, \ - { KC_F17, KC_##K41, KC_NO, KC_##K43, KC_F18, KC_##K45, KC_NO, KC_##K47 }, \ - { KC_NO, KC_NO, KC_NO, KC_##K4B, KC_##K4C, KC_NO, KC_##K4E, KC_F18 }, \ - { KC_F19, KC_##K51, KC_##K52, KC_##K53, KC_##K54, KC_##K55, KC_##K56, KC_##K57 }, \ - { KC_##K58, KC_##K59, KC_F20, KC_##K5B, KC_##K5C, KC_INT3, KC_INT1, KC_PCMM }, \ - { KC_##K60, KC_##K61, KC_##K62, KC_##K63, KC_##K64, KC_##K65, KC_LANG2, KC_##K67 }, \ - { KC_LANG1, KC_##K69, KC_F16, KC_##K6B, KC_NO, KC_##K6D, KC_APP, KC_##K6F }, \ - { KC_NO, KC_##K71, KC_##K72, KC_##K73, KC_##K74, KC_##K75, KC_##K76, KC_##K77 }, \ - { KC_##K78, KC_##K79, KC_##K7A, KC_##K7B, KC_##K7C, KC_##K7D, KC_NO, KC_##K7F } \ -} - - - - -/* M0116 Apple Standard Keyboard ANSI -* +-------+ -* | power | -* +-------+ -* +---+---+---+---+---+---+---+---+---+---+---+---+---+-----+ +---+---+---+---+ -* |esc| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | bks | |clr| = | / | * | -* +---------------------------------------------------------+ +---+---+---+---+ -* | tab | q | w | e | r | t | y | u | i | o | p | [ | ] | | | 7 | 8 | 9 | + | -* +-----------------------------------------------------+ | +---+---+---+---+ -* | ctrl | a | s | d | f | g | h | j | k | l | ; | ' |return| | 4 | 5 | 6 | - | -* +---------------------------------------------------------+ +---+---+---+---+ -* | shift | z | x | c | v | b | n | m | , | . | / | shift | | 1 | 2 | 3 | | -* +---------------------------------------------------------+ +-------+---|ent| -* |cap|opt|comnd| ` | | \ |lef|rig|dwn|up | | 0 | . | | -* +---------------------------------------------------------+ +-------+---+---+ -*/ -#define KEYMAP_M0116_ANSI( \ - K7F, \ - K35,K12,K13,K14,K15,K17,K16,K1A,K1C,K19,K1D,K1B,K18,K33, K47,K51,K4B,K43, \ - K30,K0C,K0D,K0E,K0F,K11,K10,K20,K22,K1F,K23,K21,K1E, K59,K5B,K5C,K45, \ - K36,K00,K01,K02,K03,K05,K04,K26,K28,K25,K29,K27, K24, K56,K57,K58,K4E, \ - K38,K06,K07,K08,K09,K0B,K2D,K2E,K2B,K2F,K2C, K7B, K53,K54,K55, \ - K39,K3A,K37,K32, K31, K2A,K3B,K3C,K3D,K3E, K52, K41,K4C \ -) { \ - { KC_##K00, KC_##K01, KC_##K02, KC_##K03, KC_##K04, KC_##K05, KC_##K06, KC_##K07 }, \ - { KC_##K08, KC_##K09, KC_NO, KC_##K0B, KC_##K0C, KC_##K0D, KC_##K0E, KC_##K0F }, \ - { KC_##K10, KC_##K11, KC_##K12, KC_##K13, KC_##K14, KC_##K15, KC_##K16, KC_##K17 }, \ - { KC_##K18, KC_##K19, KC_##K1A, KC_##K1B, KC_##K1C, KC_##K1D, KC_##K1E, KC_##K1F }, \ - { KC_##K20, KC_##K21, KC_##K22, KC_##K23, KC_##K24, KC_##K25, KC_##K26, KC_##K27 }, \ - { KC_##K28, KC_##K29, KC_##K2A, KC_##K2B, KC_##K2C, KC_##K2D, KC_##K2E, KC_##K2F }, \ - { KC_##K30, KC_##K31, KC_##K32, KC_##K33, KC_NO, KC_##K35, KC_##K36, KC_##K37 }, \ - { KC_##K38, KC_##K39, KC_##K3A, KC_##K3B, KC_##K3C, KC_##K3D, KC_##K3E, KC_NO }, \ - { KC_NO, KC_##K41, KC_NO, KC_##K43, KC_NO, KC_##K45, KC_NO, KC_##K47 }, \ - { KC_NO, KC_NO, KC_NO, KC_##K4B, KC_##K4C, KC_NO, KC_##K4E, KC_NO }, \ - { KC_NO, KC_##K51, KC_##K52, KC_##K53, KC_##K54, KC_##K55, KC_##K56, KC_##K57 }, \ - { KC_##K58, KC_##K59, KC_NO, KC_##K5B, KC_##K5C, KC_NO, KC_NO, KC_NO }, \ - { KC_NO, KC_NO, KC_NO, KC_NO , KC_NO, KC_NO, KC_NO, KC_NO }, \ - { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, \ - { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, \ - { KC_NO , KC_NO, KC_NO , KC_##K7B, KC_NO, KC_NO, KC_NO, KC_##K7F } \ -} - -#endif - - -/* -ADB ANSI/ISO Keymapping Note -============================ -ANSI -,----------- ----------. -| *a| 1| 2 =|Backspa| -|----------- ----------| -|Tab | Q| | ]| *c| -|----------- ----------| -|CapsLo| A| '|Return | -|----------- ----------| -|Shift | Shift | -`----------- ----------' - -ISO -,----------- ----------. -| *a| 1| 2 =|Backspa| -|----------- ----------| -|Tab | Q| | ]|Retur| -|----------- -----` | -|CapsLo| A| '| *c| | -|----------- ----------| -|Shif| *b| Shift | -`----------- ----------' - -ADB Keyboard scan code: - ADB scan code USB usage - ------------- --------- -Key ANSI ISO ANSI ISO ---------------------------------------------- -*a 0x32 0x0A 0x35 0x35 -*b ---- 0x32 ---- 0x64 -*c 0x2A 0x2A 0x31 0x31(or 0x32) - - -TMK ADB-USB mapping: -ADB USB(ANSI) USB(ISO) ---------------------------------- -0x32 0x35 0x64 -0x0A ---- 0x35 -0x2A 0x31 0x31(or 0x32) - -Note that mappings of ADB code 0x32 are diffrent between ANSI and ISO keyboard. -https://github.com/tmk/tmk_keyboard/issues/35 - */ diff --git a/converter/adb_usb/keymap_hasu.c b/converter/adb_usb/keymap_hasu.c deleted file mode 100644 index a0b3f1fc683..00000000000 --- a/converter/adb_usb/keymap_hasu.c +++ /dev/null @@ -1,58 +0,0 @@ -#include "keymap_common.h" - - -const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - /* Default Layer: plain keymap - * ,---. ,---------------. ,---------------. ,---------------. ,-----------. ,---. - * |Esc| |F1 |F2 |F3 |F4 | |F5 |F6 |F7 |F8 | |F9 |F10|F11|F12| |PrS|ScL|Pau| | | - * `---' `---------------' `---------------' `---------------' `-----------' `---' - * ,-----------------------------------------------------------. ,-----------. ,---------------. - * | `| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Backspa| |Ins|Hom|PgU| |NmL| =| /| *| - * |-----------------------------------------------------------| |-----------| |---------------| - * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| Fn0| |Del|End|PgD| | 7| 8| 9| -| - * |-----------------------------------------------------------| `-----------' |---------------| - * |CapsLo| A| S| D| F| G| H| J| K| L| ;| '|Return | | 4| 5| 6| +| - * |-----------------------------------------------------------| ,---. |---------------| - * |Shift | Z| X| C| V| B| N| M| ,| ,| /|Shift | |Up | | 1| 2| 3| | - * |-----------------------------------------------------------| ,-----------. |-----------|Ent| - * |Ctrl |Gui |Alt | Space |Alt |Gui |Ctrl | |Lef|Dow|Rig| | 0| .| | - * `-----------------------------------------------------------' `-----------' `---------------' - */ - KEYMAP_EXT_ANSI( - ESC, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, PSCR,SLCK,BRK, NO, - GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, BSPC, INS, HOME,PGUP, NLCK,EQL, PSLS,PAST, - TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC,RBRC,FN0, DEL, END, PGDN, P7, P8, P9, PMNS, - LCAP,A, S, D, F, G, H, J, K, L, SCLN,QUOT, ENT, P4, P5, P6, PPLS, - LSFT,Z, X, C, V, B, N, M, COMM,DOT, SLSH, RSFT, UP, P1, P2, P3, - LCTL,LGUI,LALT, SPC, RGUI,RCTL, LEFT,DOWN,RGHT, P0, PDOT,PENT - ), - - /* Default Layer: plain keymap - * ,---. ,---------------. ,---------------. ,---------------. ,-----------. ,---. - * |` | |F1 |F2 |F3 |F4 | |F5 |F6 |F7 |F8 | |F9 |F10|F11|F12| |PrS|ScL|Pau| | | - * `---' `---------------' `---------------' `---------------' `-----------' `---' - * ,-----------------------------------------------------------. ,-----------. ,---------------. - * |Esc|F1 |F2 |F3 |F4 |F5 |F6 |F7 |F8 |F9 |F10|F11|F12|Delete | |Ins|Hom|PgU| |NmL|Mb1|Mb2|Mb3| - * |-----------------------------------------------------------| |-----------| |---------------| - * |Tab | Q| W| E| R| T| Y| U|PrS|ScL|Pau|Up |Ins| Fn0| |Del|End|PgD| |MwD|McU|MwU|MwD| - * |-----------------------------------------------------------| `-----------' |---------------| - * |CapsLo|VoD|VoU|Mut| F| G| H| J|Hom|PgU|Lef|Rig|Return | |McL|McD|McR|MwU| - * |-----------------------------------------------------------| ,---. |---------------| - * |Shift | Z| X| C| V| B| N| M|End|PgD|Dow|Shift | |PgU| |MwL|McD|MwR| | - * |-----------------------------------------------------------| ,-----------. |-----------|Mb3| - * |Ctrl |Gui |Alt | Space |Alt |Gui |Ctrl | |Hom|PgD|End| | Mb1|Mb2| | - * `-----------------------------------------------------------' `-----------' `---------------' - */ - KEYMAP_EXT_ANSI( - GRV, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, PSCR,SLCK,BRK, NO, - ESC, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, DEL, INS, HOME,PGUP, NLCK,BTN1,BTN2,BTN3, - TAB, Q, W, E, R, T, Y, U, PSCR,SLCK,PAUS,UP, INS, FN0, DEL, END, PGDN, WH_D,MS_U,WH_U,WH_D, - LCAP,VOLD,VOLU,MUTE,F, G, H, J, HOME,PGUP,LEFT,RGHT, ENT, MS_L,MS_D,MS_R,WH_U, - LSFT,Z, X, C, V, B, N, M, END, PGDN,DOWN, RSFT, PGUP, WH_L,MS_D,WH_R, - LCTL,LGUI,LALT, SPC, RGUI,RCTL, HOME,PGDN,END, BTN1, BTN2,BTN3 - ), -}; - -const uint16_t PROGMEM fn_actions[] = { - [0] = ACTION_LAYER_TAP_KEY(1, KC_BSLS), -}; diff --git a/converter/adb_usb/keymap_iso.c b/converter/adb_usb/keymap_iso.c deleted file mode 100644 index a1b1a5ebd3c..00000000000 --- a/converter/adb_usb/keymap_iso.c +++ /dev/null @@ -1,16 +0,0 @@ -#include "keymap_common.h" - - -const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - KEYMAP_EXT_ISO( - ESC, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, PSCR,SLCK,PAUS, NO, - GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, BSPC, INS, HOME,PGUP, NLCK,PEQL,PSLS,PAST, - TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC,RBRC,ENT, DEL, END, PGDN, P7, P8, P9, PMNS, - LCAP,A, S, D, F, G, H, J, K, L, SCLN,QUOT,NUHS, P4, P5, P6, PPLS, - LSFT,NUBS,Z, X, C, V, B, N, M, COMM,DOT, SLSH, RSFT, UP, P1, P2, P3, - LCTL,LALT,LGUI, SPC, RALT,RCTL, LEFT,DOWN,RGHT, P0, PDOT,PENT - ), -}; - -const uint16_t PROGMEM fn_actions[] = { -}; diff --git a/converter/adb_usb/led.c b/converter/adb_usb/led.c deleted file mode 100644 index 3ee64a8e7d3..00000000000 --- a/converter/adb_usb/led.c +++ /dev/null @@ -1,27 +0,0 @@ -/* -Copyright 2011 Jun Wako - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#include -#include -#include "adb.h" -#include "led.h" - - -void led_set(uint8_t usb_led) -{ - adb_host_kbd_led(~usb_led); -} diff --git a/converter/adb_usb/matrix.c b/converter/adb_usb/matrix.c deleted file mode 100644 index 6220ee6e1c0..00000000000 --- a/converter/adb_usb/matrix.c +++ /dev/null @@ -1,296 +0,0 @@ -/* -Copyright 2011 Jun Wako - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -/* - * scan matrix - */ -#include -#include -#include -#include -#include "print.h" -#include "util.h" -#include "debug.h" -#include "adb.h" -#include "matrix.h" -#include "report.h" -#include "host.h" - - -#if (MATRIX_COLS > 16) -# error "MATRIX_COLS must not exceed 16" -#endif -#if (MATRIX_ROWS > 255) -# error "MATRIX_ROWS must not exceed 255" -#endif - - -static bool is_modified = false; -static report_mouse_t mouse_report = {}; - -// matrix state buffer(1:on, 0:off) -#if (MATRIX_COLS <= 8) -static uint8_t matrix[MATRIX_ROWS]; -#else -static uint16_t matrix[MATRIX_ROWS]; -#endif - -#ifdef MATRIX_HAS_GHOST -static bool matrix_has_ghost_in_row(uint8_t row); -#endif -static void register_key(uint8_t key); - - -inline -uint8_t matrix_rows(void) -{ - return MATRIX_ROWS; -} - -inline -uint8_t matrix_cols(void) -{ - return MATRIX_COLS; -} - -void matrix_init(void) -{ - adb_host_init(); - // wait for keyboard to boot up and receive command - _delay_ms(1000); - // Enable keyboard left/right modifier distinction - // Addr:Keyboard(0010), Cmd:Listen(10), Register3(11) - // upper byte: reserved bits 0000, device address 0010 - // lower byte: device handler 00000011 - adb_host_listen(0x2B,0x02,0x03); - - // initialize matrix state: all keys off - for (uint8_t i=0; i < MATRIX_ROWS; i++) matrix[i] = 0x00; - - debug_enable = true; - //debug_matrix = true; - //debug_keyboard = true; - //debug_mouse = true; - print("debug enabled.\n"); - return; -} - -#ifdef ADB_MOUSE_ENABLE - -#ifdef MAX -#undef MAX -#endif -#define MAX(X, Y) ((X) > (Y) ? (X) : (Y)) - -void adb_mouse_task(void) -{ - uint16_t codes; - int16_t x, y; - static int8_t mouseacc; - _delay_ms(12); // delay for preventing overload of poor ADB keyboard controller - codes = adb_host_mouse_recv(); - // If nothing received reset mouse acceleration, and quit. - if (!codes) { - mouseacc = 1; - return; - }; - // Bit sixteen is button. - if (~codes & (1 << 15)) - mouse_report.buttons |= MOUSE_BTN1; - if (codes & (1 << 15)) - mouse_report.buttons &= ~MOUSE_BTN1; - // lower seven bits are movement, as signed int_7. - // low byte is X-axis, high byte is Y. - y = (codes>>8 & 0x3F); - x = (codes>>0 & 0x3F); - // bit seven and fifteen is negative - // usb does not use int_8, but int_7 (measuring distance) with sign-bit. - if (codes & (1 << 6)) - x = (x-0x40); - if (codes & (1 << 14)) - y = (y-0x40); - // Accelerate mouse. (They weren't meant to be used on screens larger than 320x200). - x *= mouseacc; - y *= mouseacc; - // Cap our two bytes per axis to one byte. - // Easier with a MIN-function, but since -MAX(-a,-b) = MIN(a,b)... - // I.E. MIN(MAX(x,-127),127) = -MAX(-MAX(x, -127), -127) = MIN(-MIN(-x,127),127) - mouse_report.x = -MAX(-MAX(x, -127), -127); - mouse_report.y = -MAX(-MAX(y, -127), -127); - if (debug_mouse) { - print("adb_host_mouse_recv: "); print_bin16(codes); print("\n"); - print("adb_mouse raw: ["); - phex(mouseacc); print(" "); - phex(mouse_report.buttons); print("|"); - print_decs(mouse_report.x); print(" "); - print_decs(mouse_report.y); print("]\n"); - } - // Send result by usb. - host_mouse_send(&mouse_report); - // increase acceleration of mouse - mouseacc += ( mouseacc < ADB_MOUSE_MAXACC ? 1 : 0 ); - return; -} -#endif - -uint8_t matrix_scan(void) -{ - /* extra_key is volatile and more convoluted than necessary because gcc refused - to generate valid code otherwise. Making extra_key uint8_t and constructing codes - here via codes = extra_key<<8 | 0xFF; would consistently fail to even LOAD - extra_key from memory, and leave garbage in the high byte of codes. I tried - dozens of code variations and it kept generating broken assembly output. So - beware if attempting to make extra_key code more logical and efficient. */ - static volatile uint16_t extra_key = 0xFFFF; - uint16_t codes; - uint8_t key0, key1; - - is_modified = false; - - codes = extra_key; - extra_key = 0xFFFF; - - if ( codes == 0xFFFF ) - { - _delay_ms(12); // delay for preventing overload of poor ADB keyboard controller - codes = adb_host_kbd_recv(); - } - key0 = codes>>8; - key1 = codes&0xFF; - - if (debug_matrix && codes) { - print("adb_host_kbd_recv: "); phex16(codes); print("\n"); - } - - if (codes == 0) { // no keys - return 0; - } else if (codes == 0x7F7F) { // power key press - register_key(0x7F); - } else if (codes == 0xFFFF) { // power key release - register_key(0xFF); - } else if (key0 == 0xFF) { // error - xprintf("adb_host_kbd_recv: ERROR(%d)\n", codes); - return key1; - } else { - register_key(key0); - if (key1 != 0xFF) // key1 is 0xFF when no second key. - extra_key = key1<<8 | 0xFF; // process in a separate call - } - - return 1; -} - -bool matrix_is_modified(void) -{ - return is_modified; -} - -inline -bool matrix_has_ghost(void) -{ -#ifdef MATRIX_HAS_GHOST - for (uint8_t i = 0; i < MATRIX_ROWS; i++) { - if (matrix_has_ghost_in_row(i)) - return true; - } -#endif - return false; -} - -inline -bool matrix_is_on(uint8_t row, uint8_t col) -{ - return (matrix[row] & (1<>3)&0x0F; - if (key&0x80) { - matrix[row] &= ~(1< - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#ifndef CONFIG_H -#define CONFIG_H - -#define VENDOR_ID 0xFEED -#define PRODUCT_ID 0x5C01 -#define DEVICE_VER 0x0100 -#define MANUFACTURER t.m.k. -#define PRODUCT ASCII keyboard converter -#define DESCRIPTION converts Serial Console Terminal into USB keyboard - - -/* matrix size */ -#define MATRIX_ROWS 16 -#define MATRIX_COLS 16 - -/* key combination for command */ -#define IS_COMMAND() ( \ - host_get_first_key() == KC_BRK \ -) - - -/* - * Serial(USART) configuration - * asynchronous, positive logic, 19200baud, bit order: LSB first - * 1-start bit, 8-data bit, odd parity, 1-stop bit - */ -#ifdef __AVR_ATmega32U4__ - #define SERIAL_UART_BAUD 19200 - #define SERIAL_UART_DATA UDR1 - #define SERIAL_UART_UBRR ((F_CPU/(16UL*SERIAL_UART_BAUD))-1) - #define SERIAL_UART_RXD_VECT USART1_RX_vect - #define SERIAL_UART_TXD_READY (UCSR1A&(1<>8); /* baud rate */ \ - UCSR1B |= (1< - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#include -#include -#include -#include "keycode.h" -#include "action.h" -#include "action_macro.h" -#include "action_util.h" -#include "util.h" -#include "print.h" -#include "keymap.h" - - -// Keymap is not used. See matrix.c. - -/* translates key to keycode */ -uint8_t keymap_key_to_keycode(uint8_t layer, keypos_t key) -{ - return KC_NO; -} - -/* translates Fn keycode to action */ -action_t keymap_fn_to_action(uint8_t keycode) -{ - return (action_t) { .code = ACTION_NO }; -} diff --git a/converter/ascii_usb/led.c b/converter/ascii_usb/led.c deleted file mode 100644 index d1c39bc6539..00000000000 --- a/converter/ascii_usb/led.c +++ /dev/null @@ -1,25 +0,0 @@ -/* -Copyright 2012 Jun Wako - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#include "stdint.h" -#include "serial.h" -#include "led.h" - - -void led_set(uint8_t usb_led) -{ -} diff --git a/converter/ascii_usb/matrix.c b/converter/ascii_usb/matrix.c deleted file mode 100644 index e1ea8e0ab8a..00000000000 --- a/converter/ascii_usb/matrix.c +++ /dev/null @@ -1,195 +0,0 @@ -/* -Copyright 2014 Jun Wako - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#include -#include -#include -#include -#include "print.h" -#include "util.h" -#include "matrix.h" -#include "debug.h" -#include "action_util.h" -#include "protocol/serial.h" - - -/* - * Not use Matrix. - * - * ROW: 16(4bits) - * COL: 16(4bits) - * - * 8bit wide - * +---------+ - * 0|00 ... 0F| - * 1|08 ... 1F| - * :| ... | - * :| ... | - * E|E0 ... EF| - * F|F0 ... FF| - * +---------+ - */ - - -inline -uint8_t matrix_rows(void) -{ - return MATRIX_ROWS; -} - -inline -uint8_t matrix_cols(void) -{ - return MATRIX_COLS; -} - -void matrix_init(void) -{ - debug_matrix = true; - serial_init(); - - debug("init\n"); - return; -} - -static void type_key(uint16_t keycode) -{ - if (keycode == 0) return; - - uint8_t mods = keycode>>8; - uint8_t key = keycode&0xFF; - if (mods) { - add_mods(mods); - send_keyboard_report(); - } - - add_key(key); - send_keyboard_report(); - - del_key(key); - send_keyboard_report(); - - if (mods) { - del_mods(mods); - send_keyboard_report(); - } -} -static uint16_t code2key(uint8_t code) -{ - // ASCII to key combination in US laout - switch (code) { - case 0x01 ... 0x08: // Ctrl-[a-z] - return MOD_BIT(KC_LCTRL)<<8 | (KC_A + (code-0x01)); - case 0x09: return KC_TAB; // TAB(Ctrl-i) - case 0x0A ... 0x0C: // Ctrl-[a-z] - return MOD_BIT(KC_LCTRL)<<8 | (KC_A + (code-0x01)); - case 0x0D: return KC_ENTER; // Enter(Ctrl-m) - case 0x0E ... 0x1A: // Ctrl-[a-z] - return MOD_BIT(KC_LCTRL)<<8 | (KC_A + (code-0x01)); - case 0x1B: return KC_ESC; - case 0x1C: return KC_RIGHT; - case 0x1D: return KC_LEFT; - case 0x1E: return KC_UP; - case 0x1F: return KC_DOWN; - case 0x20: return KC_SPACE; - case 0x21: return MOD_BIT(KC_LSHIFT)<<8 | KC_1; // ! - case 0x22: return MOD_BIT(KC_LSHIFT)<<8 | KC_QUOTE; // " - case 0x23: return MOD_BIT(KC_LSHIFT)<<8 | KC_3; // # - case 0x24: return MOD_BIT(KC_LSHIFT)<<8 | KC_4; // $ - case 0x25: return MOD_BIT(KC_LSHIFT)<<8 | KC_5; // % - case 0x26: return MOD_BIT(KC_LSHIFT)<<8 | KC_7; // & - case 0x27: return KC_QUOTE; // ' - case 0x28: return MOD_BIT(KC_LSHIFT)<<8 | KC_9; // ( - case 0x29: return MOD_BIT(KC_LSHIFT)<<8 | KC_0; // ) - case 0x2A: return MOD_BIT(KC_LSHIFT)<<8 | KC_8; // * - case 0x2B: return MOD_BIT(KC_LSHIFT)<<8 | KC_EQUAL; // + - case 0x2C: return KC_COMMA; // , - case 0x2D: return KC_MINUS; // - - case 0x2E: return KC_DOT; // . - case 0x2F: return KC_SLASH; // / - case 0x30: return KC_0; - case 0x31 ... 0x39: // 1-9 - return KC_1 + (code-0x31); - case 0x3A: return MOD_BIT(KC_LSHIFT)<<8 | KC_SCLN; // : - case 0x3B: return KC_SCLN; // ; - case 0x3C: return MOD_BIT(KC_LSHIFT)<<8 | KC_COMMA; // < - case 0x3D: return KC_EQUAL; // = - case 0x3E: return MOD_BIT(KC_LSHIFT)<<8 | KC_DOT; // > - case 0x3F: return MOD_BIT(KC_LSHIFT)<<8 | KC_SLASH; // ? - case 0x40: return MOD_BIT(KC_LSHIFT)<<8 | KC_2; // @ - case 0x41 ... 0x5A: // A-Z - return MOD_BIT(KC_LSHIFT)<<8 | (KC_A + (code-0x41)); - case 0x5B: return KC_LBRACKET; // [ - case 0x5C: return KC_BSLASH; // - case 0x5D: return KC_RBRACKET; // ] - case 0x5E: return MOD_BIT(KC_LSHIFT)<<8 | KC_6; // ^ - case 0x5F: return MOD_BIT(KC_LSHIFT)<<8 | KC_MINUS; // _ - case 0x61 ... 0x7A: // a-z - return KC_A + (code-0x61); - case 0x7B: return MOD_BIT(KC_LSHIFT)<<8 | KC_LBRACKET; // { - case 0x7C: return MOD_BIT(KC_LSHIFT)<<8 | KC_BSLASH; // | - case 0x7D: return MOD_BIT(KC_LSHIFT)<<8 | KC_RBRACKET; // } - case 0x7E: return MOD_BIT(KC_LSHIFT)<<8 | KC_GRAVE; // } - case 0x7F: return KC_DELETE; // - } - return 0; -} - -uint8_t matrix_scan(void) -{ - uint16_t code = serial_recv2(); - if (code == -1) { - return 0; - } - - print_hex8(code); print(" "); - - // echo back - serial_send(code); - type_key(code2key(code)); - - - return code; -} - -inline -bool matrix_has_ghost(void) -{ - return false; -} - -inline -bool matrix_is_on(uint8_t row, uint8_t col) -{ - return false; -} - -inline -matrix_row_t matrix_get_row(uint8_t row) -{ - return 0; -} - -void matrix_print(void) -{ - print("\nr/c 0123456789ABCDEF\n"); - for (uint8_t row = 0; row < matrix_rows(); row++) { - phex(row); print(": "); - pbin_reverse(matrix_get_row(row)); - print("\n"); - } -} diff --git a/converter/ibm4704_usb/Makefile b/converter/ibm4704_usb/Makefile deleted file mode 100644 index b5c97d2d314..00000000000 --- a/converter/ibm4704_usb/Makefile +++ /dev/null @@ -1,93 +0,0 @@ -# Target file name (without extension). -TARGET = ibm4704_usb - -# Directory common source filess exist -TMK_DIR = ../../tmk_core - -# Directory keyboard dependent files exist -TARGET_DIR = . - -# project specific files -SRC = keymap_common.c \ - matrix.c \ - led.c \ - protocol/ibm4704.c - -ifdef KEYMAP - SRC := keymap_$(KEYMAP).c $(SRC) -else - SRC := keymap_plain.c $(SRC) -endif - -CONFIG_H = config.h - - -# MCU name -#MCU = at90usb1287 -MCU = atmega32u4 - -# Processor frequency. -# This will define a symbol, F_CPU, in all source code files equal to the -# processor frequency in Hz. You can then use this symbol in your source code to -# calculate timings. Do NOT tack on a 'UL' at the end, this will be done -# automatically to create a 32-bit value in your source code. -# -# This will be an integer division of F_USB below, as it is sourced by -# F_USB after it has run through any CPU prescalers. Note that this value -# does not *change* the processor frequency - it should merely be updated to -# reflect the processor speed set externally so that the code can use accurate -# software delays. -F_CPU = 16000000 - - -# -# LUFA specific -# -# Target architecture (see library "Board Types" documentation). -ARCH = AVR8 - -# Input clock frequency. -# This will define a symbol, F_USB, in all source code files equal to the -# input clock frequency (before any prescaling is performed) in Hz. This value may -# differ from F_CPU if prescaling is used on the latter, and is required as the -# raw input clock is fed directly to the PLL sections of the AVR for high speed -# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' -# at the end, this will be done automatically to create a 32-bit value in your -# source code. -# -# If no clock division is performed on the input clock inside the AVR (via the -# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. -F_USB = $(F_CPU) - -# Interrupt driven control endpoint task(+60) -OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT - - -# Boot Section Size in *bytes* -# Teensy halfKay 512 -# Teensy++ halfKay 1024 -# Atmel DFU loader 4096 -# LUFA bootloader 4096 -# USBaspLoader 2048 -OPT_DEFS += -DBOOTLOADER_SIZE=4096 - - -# Build Options -# comment out to disable the options. -# -#BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE = yes # Mouse keys(+4700) -EXTRAKEY_ENABLE = yes # Audio control and System control(+450) -CONSOLE_ENABLE = yes # Console for debug(+400) -COMMAND_ENABLE = yes # Commands for debug and configuration -#NKRO_ENABLE = yes # USB Nkey Rollover - not yet supported in LUFA - - -# Search Path -VPATH += $(TARGET_DIR) -VPATH += $(TMK_DIR) - -include $(TMK_DIR)/protocol.mk -include $(TMK_DIR)/protocol/lufa.mk -include $(TMK_DIR)/common.mk -include $(TMK_DIR)/rules.mk diff --git a/converter/ibm4704_usb/README.md b/converter/ibm4704_usb/README.md deleted file mode 100644 index 68db4bd0500..00000000000 --- a/converter/ibm4704_usb/README.md +++ /dev/null @@ -1,72 +0,0 @@ -IBM 4704 to USB keyboard converter -================================== -This firmware converts IBM 4704 keyboard protocol to USB HID. - -Keyboard initialization process takes a few seconds at start up. During that you will hear buzzer from the keyboard. **You need to plug USB cable after hooking up your keyboard to the converter.** - - -Update ------- -2015/09/07 Added keymap for Alps 102-key. Thanks, tai @ geekhack! -2015/05/05 Added keymaps for 107-key, 77-key and 50-key. Thanks, orihalcon @ geekhack! -2015/05/19 Fixed a protocol handling bug. - - - -Supported Keyboard ------------------- -### IBM capacitive switch models: -- 6019273 Model 100 50-key (grid layout) http://kishy.ca/?p=894 -- 6019284 Model 200 62-key Alpha(60% layout) http://kishy.ca/?p=894 -- 6019303 Model 300 77-key Expanded Alpha http://deskthority.net/photos-f62/ibm-6019303-t8502.html -- 6020218 Model 400 107-key Full key http://kishy.ca/?p=894 - -### Alps switch(vintage Green) models: - -- 5954339 Japanese 102-key http://deskthority.net/post87127.html#p87127 -- 6112883 Japanese 102-key http://geekhack.org/index.php?topic=52888.msg1194489#msg1194489 -- 6112884 Japanese 102-key http://geekhack.org/index.php?topic=50437.msg1193047#msg1193047 -- 6341739 Chinese 102-key http://geekhack.org/index.php?topic=52888.msg1176566#msg1176566 - - -Connector ---------- -Keyboard Plug from front: - - DSUB-9 - ------------- - \ N 2 3 4 5 / - \ N N N N / - --------- - 2 GND - 3 VCC 5V - 4 DATA - 5 CLOCK - N No connection/No pin. - - -Connection ----------- -In case of using ATMega32U4(Teensy2.0): - -1. Supply power with VCC and GND. -2. Connect CLOCK to PD1 and DATA to PD0. You can change pin with config.h. -3. Optionally you may need pull-up register. 1KOhm probably work. - - -Build Firmware --------------- -Just run `make`: - - $ make - -To select keymap: - - $ make KEYMAP=[plain|...] - - -Keymap ------- -Several version of keymap are available in advance but you are recommended to define your favorite layout yourself. To define your own keymap create file named `keymap_.c` and see keymap document(you can find in top README.md) and existent keymap files. - -Use `KEYMAP_ALPS102()` to define your keymap for Alps models. diff --git a/converter/ibm4704_usb/config.h b/converter/ibm4704_usb/config.h deleted file mode 100644 index 2fee10fd61f..00000000000 --- a/converter/ibm4704_usb/config.h +++ /dev/null @@ -1,61 +0,0 @@ -/* -Copyright 2014 Jun Wako - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#ifndef CONFIG_H -#define CONFIG_H - -#include - -#define VENDOR_ID 0xFEED -#define PRODUCT_ID 0x4707 -#define DEVICE_VER 0x0001 -#define MANUFACTURER t.m.k. -#define PRODUCT IBM 4704 keyboard converter -#define DESCRIPTION convert IBM 4704 keyboard to USB - - -/* matrix size */ -#define MATRIX_ROWS 16 // keycode bit3-6 -#define MATRIX_COLS 8 // keycode bit0-2 - - -/* key combination for command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LCTRL) | MOD_BIT(KC_RCTRL)) || \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - - - -/* Pin configuration */ -#define IBM4704_CLOCK_PORT PORTD -#define IBM4704_CLOCK_PIN PIND -#define IBM4704_CLOCK_DDR DDRD -#define IBM4704_CLOCK_BIT 1 -#define IBM4704_DATA_PORT PORTD -#define IBM4704_DATA_PIN PIND -#define IBM4704_DATA_DDR DDRD -#define IBM4704_DATA_BIT 0 - -/* Pin interrupt on rising edge of clock */ -#define IBM4704_INT_INIT() do { EICRA |= ((1<| Z| X| C| V| B| N| M| ,| ,| /|???|Shift | - |-----------------------------------------------------------| - |Reset|blk|Alt | Space |Alt |blk|Enter| - `-----------------------------------------------------------' - +----------+---------------------+----------+----------+ - |` 00|PD1 04|Caps 20|LShift 30|Reset 31| - |1 18|q 05|a 21|<> 3E|Rblank 41| - |2 19|w 06|s 22|z 32|Alt 3F| - |3 1A|e 13|d 23|x 33|Space 40| - |4 10|r 14|f 24|c 34|Alt 3F| - |5 11|t 15|g 25|v 35|Lblank 42| - |6 12|y 16|h 26|b 36|Enter 2F| - |7 08|u 17|j 27|n 37| | - |8 09|i 01|k 28|m 38| | - |9 0A|o 02|l 29|, 39| | - |0 0F|p 03|; 2A|. 3A| | - |- 1F|¢ 1B|' 2B|/ 3B| | - |= 0D|\ 1C|{} 2C|??? 3C| | - |??? 0C|PD2 1D|PD3 2D|RShift 3D| | - |BS 0E| | | | | - +----------+---------------------+----------+----------+ - Bit7 is 'press flag' which set 1 on press and 0 on release when break code is enabled. - -NOTE: When break code is enabled the key sends scancode with setting 7th bit on press -and without it on release. That is, '`' sends 80h on press and 00h on release. - - -Keyboard command ----------------- -Keyboard accepts these commands from host. - - Description Entry point - ----------------------------------------------------------- - FF Soft Reset 0008h - FE Resend 00e8h - FD Buzzer(emits a short beep) 00edh - FC Set Key Flag 00f6h - FB Soft Reset 0008h - FA Reset 0000h - - -Keyboard response ------------------ -Keyobard sends these bytes to host. - - Description Entry point - ----------------------------------------------------------- - FE Overflow(key event/receive data) 00c5h, 0346h - Memory test error 0224h - FD Command out of bound 00d8h - Key out of bound - 7E Read/Parity error in receive from host 00bch - - -Set Key Flag command(FC) ------------------------- -After 'Power on Reset' firmware enters this command mode and waits for data from host, -so that you don't need to send 'FC' and it doesn't send any scancode until you send 'FF'. - -Data sent from host: - - bit: 7 6 ... 0 - en | | - | `-----`--- scan code - `------------- enable bit(0: enable repeat, 1: enable break) - - 00-79 Enable repeat - 80-F9 Enable break(FA-FF are used as other commands, see above.) - FE Resend(011ah) no need to use - FF End(0114h) exits FC command mode. - -Response from keyboard: - FD Out of bound - Invalid scancode - -- OK - No response means that command is accepted. - -Examples: - To enable break code of all keys. - - FC 80 81 ... F7 FF - diff --git a/converter/ibm4704_usb/keymap_50key.c b/converter/ibm4704_usb/keymap_50key.c deleted file mode 100644 index 97294fb45dd..00000000000 --- a/converter/ibm4704_usb/keymap_50key.c +++ /dev/null @@ -1,17 +0,0 @@ -#include "keymap_common.h" - - -const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - KEYMAP_50( - F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, \ - 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, \ - Q, W, E, R, T, Y, U, I, O, P, \ - A, S, D, F, G, H, J, K, L, SCLN, \ - Z, X, C, V, B, N, M, COMM,DOT, SLSH \ - ), -}; - -const uint16_t PROGMEM fn_actions[] = { -}; - - diff --git a/converter/ibm4704_usb/keymap_alps102key.c b/converter/ibm4704_usb/keymap_alps102key.c deleted file mode 100644 index f3dda718ace..00000000000 --- a/converter/ibm4704_usb/keymap_alps102key.c +++ /dev/null @@ -1,50 +0,0 @@ -#include "keymap_common.h" - - -const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - /* Layer 0: - * ,---------------------------------------------------------------. ,-----------. ,---------------. - * | `| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|BS |BS |F21| |PSC|SLK|PAU| |F1 |F2 |F3 |F4 | - * |---------------------------------------------------------------| |-----------| |---------------| - * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \|F22| |Ins|Hom|PgU| |F5 |F6 |F7 |F8 | - * |---------------------------------------------------------------| |-----------| |---------------| - * |Ctrl | A| S| D| F| G| H| J| K| L| ;| '|Ret|Ret |F23| |Del|End|PgD| |F9 |F10|F11|F12| - * |---------------------------------------------------------------| |-----------| |---------------| - * |Shift | Z| X| C| V| B| N| M| ,| ,| /|Shf|Shift |F24| | |Up | | |F13|F14|F15|F16| - * |---------------------------------------------------------------| |-----------| |---------------| - * |Fn0 |Gui|Alt | Space |Alt* |Gui|Fn0 | |Lef|Dow|Rig| |F17|F18|F19|F20| - * `---------------------------------------------------------------' `-----------' `---------------' - */ - KEYMAP_ALPS102( - ESC, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, BSPC,BSPC,F21, PSCR,SLCK,PAUS, F1, F2, F3, F4, \ - TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC,RBRC,BSLS, F22, INS, HOME,PGUP, F5, F6, F7, F8, \ - LCTL,A, S, D, F, G, H, J, K, L, SCLN,QUOT,GRV, ENT, F23, DEL, END, PGDN, F9, F10, F11, F12, \ - LSFT,Z, X, C, V, B, N, M, COMM,DOT, SLSH,RSFT,RSFT, F24, NO, UP, NO, F13, F14, F15, F16, \ - FN0, LGUI,LALT, SPC, RALT,RGUI, FN0, LEFT,DOWN,RGHT, F17, F18, F19, F20 \ - ), - - /* Layer 1: - * ,---------------------------------------------------------------. ,-----------. ,---------------. - * | `| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|BS |BS |F21| |VoD|VoU|Mut| |F1 |F2 |F3 |F4 | - * |---------------------------------------------------------------| |-----------| |---------------| - * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \|F22| |Ins|Hom|PgU| |F5 |F6 |F7 |F8 | - * |---------------------------------------------------------------| |-----------| |---------------| - * |Ctrl | A| S| D| F| G| H| J| K| L| ;| '|Ret|Ret |F23| |Del|End|PgD| |F9 |F10|F11|F12| - * |---------------------------------------------------------------| |-----------| |---------------| - * |Shift | Z| X| C| V| B| N| M| ,| ,| /|Shf|Shift |F24| | |PgU| | |F13|F14|F15|F16| - * |---------------------------------------------------------------| |-----------| |---------------| - * |Fn0 |Gui|Alt | Space |Alt* |Gui|Fn0 | |Hom|PgD|End| |F17|F18|F19|F20| - * `---------------------------------------------------------------' `-----------' `---------------' - */ - KEYMAP_ALPS102( - TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, VOLD,VOLU,MUTE, TRNS,TRNS,TRNS,TRNS, \ - TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, TRNS, TRNS,TRNS,TRNS, TRNS,TRNS,TRNS,TRNS, \ - TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, TRNS, TRNS,TRNS,TRNS, TRNS,TRNS,TRNS,TRNS, \ - TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, TRNS, TRNS,PGUP,TRNS, TRNS,TRNS,TRNS,TRNS, \ - TRNS,TRNS,TRNS, TRNS, TRNS,TRNS, TRNS, HOME,PGDN,END, TRNS,TRNS,TRNS,TRNS \ - ), -}; - -const uint16_t PROGMEM fn_actions[] = { - [0] = ACTION_LAYER_MOMENTARY(1), -}; diff --git a/converter/ibm4704_usb/keymap_common.c b/converter/ibm4704_usb/keymap_common.c deleted file mode 100644 index 55a13793cbb..00000000000 --- a/converter/ibm4704_usb/keymap_common.c +++ /dev/null @@ -1,30 +0,0 @@ -/* -Copyright 2011,2012,2013 Jun Wako - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ -#include "keymap_common.h" - - -/* translates key to keycode */ -uint8_t keymap_key_to_keycode(uint8_t layer, keypos_t key) -{ - return pgm_read_byte(&keymaps[(layer)][(key.row)][(key.col)]); -} - -/* translates Fn keycode to action */ -action_t keymap_fn_to_action(uint8_t keycode) -{ - return (action_t){ .code = pgm_read_word(&fn_actions[FN_INDEX(keycode)]) }; -} diff --git a/converter/ibm4704_usb/keymap_common.h b/converter/ibm4704_usb/keymap_common.h deleted file mode 100644 index 9cb23b0b838..00000000000 --- a/converter/ibm4704_usb/keymap_common.h +++ /dev/null @@ -1,146 +0,0 @@ -/* -Copyright 2011,2012,2013 Jun Wako - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ -#ifndef KEYMAP_COMMON_H -#define KEYMAP_COMMON_H - -#include -#include -#include -#include "keycode.h" -#include "action.h" -#include "action_macro.h" -#include "report.h" -#include "print.h" -#include "debug.h" -#include "keymap.h" - - -// 32*8(256) byte array which converts PS/2 code into USB code -extern const uint8_t keymaps[][MATRIX_ROWS][MATRIX_COLS]; -extern const uint16_t fn_actions[]; - - -/* 107-key */ -#define KEYMAP( \ - K46,K64, K00,K18,K19,K1A,K10,K11,K12,K08,K09,K0A,K0F,K1F,K0D,K0C,K0E, K6A,K6B,K6C, K47,K48,K49,K4A, \ - K56,K66, K04,K05,K06,K13,K14,K15,K16,K17,K01,K02,K03,K1B,K1C,K1D, K6D,K6E,K6F, K4B,K4C,K4D,K4E, \ - K71,K77, K20,K21,K22,K23,K24,K25,K26,K27,K28,K29,K2A,K2B,K2C,K2D, K70,K65,K72, K50,K51,K52,K53, \ - K44,K45, K30,K3E,K32,K33,K34,K35,K36,K37,K38,K39,K3A,K3B,K3C,K3D, K74,K75,K76, K5E,K58,K59,K5A, \ - K54,K55, K31,K41,K3F, K40, K42,K2F, K78,K67,K79, K5B,K5C,K5D,K57 \ -) { \ - { KC_##K00, KC_##K01, KC_##K02, KC_##K03, KC_##K04, KC_##K05, KC_##K06, KC_NO }, \ - { KC_##K08, KC_##K09, KC_##K0A, KC_NO, KC_##K0C, KC_##K0D, KC_##K0E, KC_##K0F }, \ - { KC_##K10, KC_##K11, KC_##K12, KC_##K13, KC_##K14, KC_##K15, KC_##K16, KC_##K17 }, \ - { KC_##K18, KC_##K19, KC_##K1A, KC_##K1B, KC_##K1C, KC_##K1D, KC_NO, KC_##K1F }, \ - { KC_##K20, KC_##K21, KC_##K22, KC_##K23, KC_##K24, KC_##K25, KC_##K26, KC_##K27 }, \ - { KC_##K28, KC_##K29, KC_##K2A, KC_##K2B, KC_##K2C, KC_##K2D, KC_NO, KC_##K2F }, \ - { KC_##K30, KC_##K31, KC_##K32, KC_##K33, KC_##K34, KC_##K35, KC_##K36, KC_##K37 }, \ - { KC_##K38, KC_##K39, KC_##K3A, KC_##K3B, KC_##K3C, KC_##K3D, KC_##K3E, KC_##K3F }, \ - { KC_##K40, KC_##K41, KC_##K42, KC_NO, KC_##K44, KC_##K45, KC_##K46, KC_##K47 }, \ - { KC_##K48, KC_##K49, KC_##K4A, KC_##K4B, KC_##K4C, KC_##K4D, KC_##K4E, KC_NO }, \ - { KC_##K50, KC_##K51, KC_##K52, KC_##K53, KC_##K54, KC_##K55, KC_##K56, KC_##K57 }, \ - { KC_##K58, KC_##K59, KC_##K5A, KC_##K5B, KC_##K5C, KC_##K5D, KC_##K5E, KC_NO }, \ - { KC_NO, KC_NO, KC_NO, KC_NO, KC_##K64, KC_##K65, KC_##K66, KC_##K67 }, \ - { KC_NO, KC_NO, KC_##K6A, KC_##K6B, KC_##K6C, KC_##K6D, KC_##K6E, KC_##K6F }, \ - { KC_##K70, KC_##K71, KC_##K72, KC_NO, KC_##K74, KC_##K75, KC_##K76, KC_##K77 }, \ - { KC_##K78, KC_##K79, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO } \ -} - -/* 77-key */ -#define KEYMAP_77( \ - K00,K18,K19,K1A,K10,K11,K12,K08,K09,K0A,K0F,K1F,K0D,K0C,K0E, K6A,K6B,K6C, \ - K04,K05,K06,K13,K14,K15,K16,K17,K01,K02,K03,K1B,K1C,K1D, K6D,K6E,K6F, \ - K20,K21,K22,K23,K24,K25,K26,K27,K28,K29,K2A,K2B,K2C,K2D, K70,K65,K72, \ - K30,K3E,K32,K33,K34,K35,K36,K37,K38,K39,K3A,K3B,K3C,K3D, K74,K75,K76, \ - K31,K41,K3F, K40, K42,K2F, K78,K67,K79 \ -) KEYMAP( \ - F1, F2, K00,K18,K19,K1A,K10,K11,K12,K08,K09,K0A,K0F,K1F,K0D,K0C,K0E, K6A,K6B,K6C, NLCK,PSLS,PAST,PMNS, \ - F3, F4, K04,K05,K06,K13,K14,K15,K16,K17,K01,K02,K03,K1B,K1C,K1D, K6D,K6E,K6F, P7, P8, P9, PPLS, \ - F5, F6, K20,K21,K22,K23,K24,K25,K26,K27,K28,K29,K2A,K2B,K2C,K2D, K70,K65,K72, P4, P5, P6, PPLS, \ - F7, F8, K30,K3E,K32,K33,K34,K35,K36,K37,K38,K39,K3A,K3B,K3C,K3D, K74,K75,K76, P1, P2, P3, PENT, \ - F9, F10, K31,K41,K3F, K40, K42,K2F, K78,K67,K79 P0, P0, PDOT,PENT \ -) - -/* 62-key */ -#define KEYMAP_62( \ - K00,K18,K19,K1A,K10,K11,K12,K08,K09,K0A,K0F,K1F,K0D,K0C,K0E, \ - K04,K05,K06,K13,K14,K15,K16,K17,K01,K02,K03,K1B,K1C,K1D, \ - K20,K21,K22,K23,K24,K25,K26,K27,K28,K29,K2A,K2B,K2C,K2D, \ - K30,K3E,K32,K33,K34,K35,K36,K37,K38,K39,K3A,K3B,K3C,K3D, \ - K31,K41,K3F, K40, K42,K2F \ -) KEYMAP( \ - F1, F2, K00,K18,K19,K1A,K10,K11,K12,K08,K09,K0A,K0F,K1F,K0D,K0C,K0E, INS, HOME,PGUP, NLCK,PSLS,PAST,PMNS, \ - F3, F4, K04,K05,K06,K13,K14,K15,K16,K17,K01,K02,K03,K1B,K1C,K1D, DEL, END, PGDN, P7, P8, P9, PPLS, \ - F5, F6, K20,K21,K22,K23,K24,K25,K26,K27,K28,K29,K2A,K2B,K2C,K2D, PSCR,SLCK,PAUS, P4, P5, P6, PPLS, \ - F7, F8, K30,K3E,K32,K33,K34,K35,K36,K37,K38,K39,K3A,K3B,K3C,K3D, F11, UP, F12, P1, P2, P3, PENT, \ - F9, F10, K31,K41,K3F, K40, K42,K2F, LEFT,DOWN,RGHT, P0, P0, PDOT,PENT \ -) - -/* 50-key */ -#define KEYMAP_50( \ - K00,K01,K02, K03,K04,K05, K20,K21,K22,K23, \ - K08,K09,K0A, K0B,K0C,K0D, K28,K29,K2A,K35, \ - K10,K11,K12, K13,K14,K15, K30,K31,K32,K36, \ - K18,K19,K1A, K1B,K1C,K1D, K38,K39,K3A,K37, \ - K16,K1E,K0E, K0F,K1F,K17, K33,K3B,K2B,K3F \ -) { \ - { KC_##K00, KC_##K01, KC_##K02, KC_##K03, KC_##K04, KC_##K05, KC_NO, KC_NO, }, \ - { KC_##K08, KC_##K09, KC_##K0A, KC_##K0B, KC_##K0C, KC_##K0D, KC_##K0E, KC_##K0F }, \ - { KC_##K10, KC_##K11, KC_##K12, KC_##K13, KC_##K14, KC_##K15, KC_##K16, KC_##K17 }, \ - { KC_##K18, KC_##K19, KC_##K1A, KC_##K1B, KC_##K1C, KC_##K1D, KC_##K1E, KC_##K1F }, \ - { KC_##K20, KC_##K21, KC_##K22, KC_##K23, KC_NO, KC_NO, KC_NO, KC_NO, }, \ - { KC_##K28, KC_##K29, KC_##K2A, KC_##K2B, KC_NO, KC_NO, KC_NO, KC_NO, }, \ - { KC_##K30, KC_##K31, KC_##K32, KC_##K33, KC_NO, KC_##K35, KC_##K36, KC_##K37 }, \ - { KC_##K38, KC_##K39, KC_##K3A, KC_##K3B, KC_NO, KC_NO, KC_NO, KC_##K3F }, \ - { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, }, \ - { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, }, \ - { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, }, \ - { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, }, \ - { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, }, \ - { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, }, \ - { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, }, \ - { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, } \ -} - -/* Alps 102-key */ -#define KEYMAP_ALPS102( \ - K00, K0F, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, K44, K45, K46, K43, K41, K42, K4A, \ - K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E, K54, K55, K56, K50, K51, K52, K5A, \ - K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, K2E, K64, K65, K66, K60, K61, K62, K6B, \ - K30, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, K3E, K74, K75, K76, K70, K71, K72, K7B, \ - K31, K47, K3F, K40, K4F, K48, K2F, K77, K67, K57, K73, K63, K53, K4E \ -) { \ - { KC_##K00, KC_##K01, KC_##K02, KC_##K03, KC_##K04, KC_##K05, KC_##K06, KC_##K07 }, \ - { KC_##K08, KC_##K09, KC_##K0A, KC_##K0B, KC_##K0C, KC_##K0D, KC_##K0E, KC_##K0F }, \ - { KC_##K10, KC_##K11, KC_##K12, KC_##K13, KC_##K14, KC_##K15, KC_##K16, KC_##K17 }, \ - { KC_##K18, KC_##K19, KC_##K1A, KC_##K1B, KC_##K1C, KC_##K1D, KC_##K1E, KC_NO, }, \ - { KC_##K20, KC_##K21, KC_##K22, KC_##K23, KC_##K24, KC_##K25, KC_##K26, KC_##K27 }, \ - { KC_##K28, KC_##K29, KC_##K2A, KC_##K2B, KC_##K2C, KC_##K2D, KC_##K2E, KC_##K2F }, \ - { KC_##K30, KC_##K31, KC_##K32, KC_##K33, KC_##K34, KC_##K35, KC_##K36, KC_##K37 }, \ - { KC_##K38, KC_##K39, KC_##K3A, KC_##K3B, KC_##K3C, KC_##K3D, KC_##K3E, KC_##K3F }, \ - { KC_##K40, KC_##K41, KC_##K42, KC_##K43, KC_##K44, KC_##K45, KC_##K46, KC_##K47 }, \ - { KC_##K48, KC_NO, KC_##K4A, KC_NO, KC_NO, KC_NO, KC_##K4E, KC_##K4F }, \ - { KC_##K50, KC_##K51, KC_##K52, KC_##K53, KC_##K54, KC_##K55, KC_##K56, KC_##K57 }, \ - { KC_NO, KC_NO, KC_##K5A, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, }, \ - { KC_##K60, KC_##K61, KC_##K62, KC_##K63, KC_##K64, KC_##K65, KC_##K66, KC_##K67 }, \ - { KC_NO, KC_NO, KC_NO, KC_##K6B, KC_NO, KC_NO, KC_NO, KC_NO, }, \ - { KC_##K70, KC_##K71, KC_##K72, KC_##K73, KC_##K74, KC_##K75, KC_##K76, KC_##K77 }, \ - { KC_NO, KC_NO, KC_NO, KC_##K7B, KC_NO, KC_NO, KC_NO, KC_NO, } \ -} - - -#endif diff --git a/converter/ibm4704_usb/keymap_hasu.c b/converter/ibm4704_usb/keymap_hasu.c deleted file mode 100644 index 14c171179ca..00000000000 --- a/converter/ibm4704_usb/keymap_hasu.c +++ /dev/null @@ -1,85 +0,0 @@ -#include "keymap_common.h" - - -const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - /* 0: default - * ,-----------------------------------------------------------. - * | `| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|???|BS | - * |-----------------------------------------------------------| - * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \| - * |-----------------------------------------------------------| - * |Ctrl | A| S| D| F| G| H| J| K| L| ;| '|xxx|Ret | - * |-----------------------------------------------------------| - * |Shif|xxx| Z| X| C| V| B| N| M| ,| ,| /|xxx|Shift | - * |-----------------------------------------------------------| - * |Ctrl |Gui|Alt | Space |Alt |Gui|Ctrl | - * `-----------------------------------------------------------' - */ - KEYMAP_62( - ESC, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, BSLS,GRV, \ - TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC,RBRC,BSPC, \ - LCTL,A, S, D, F, G, H, J, K, L, FN1, QUOT,NO, ENT, \ - LSFT,NO, Z, X, C, V, B, N, M, COMM,DOT, FN2, NO, FN0, \ - LCTL,LGUI,LALT, FN3, RGUI,RCTL \ - ), - - KEYMAP_62( - ESC, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, INS, DEL, \ - CAPS,NO, NO, NO, NO, NO, NO, NO, PSCR,SLCK,PAUS, UP, NO, BSPC, \ - LCTL,VOLD,VOLU,MUTE,NO, NO, PAST,PSLS,HOME,PGUP,LEFT,RGHT,NO, ENT, \ - LSFT,NO, NO, NO, NO, NO, NO, PPLS,PMNS,END, PGDN,DOWN,NO, TRNS, \ - LCTL,LGUI,LALT, SPC, RGUI,RCTL \ - ), - - KEYMAP_62( - ESC, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, INS, DEL, \ - TAB, NO, NO, NO, NO, NO, WH_L,WH_D,WH_U,WH_R,WSTP,WBAK,WFWD,BSPC, \ - LCTL,NO, ACL0,ACL1,ACL2,NO, MS_L,MS_D,MS_U,MS_R,TRNS,NO, NO, ENT, \ - LSFT,NO, NO, NO, NO, NO, BTN3,BTN2,BTN1,BTN4,BTN5,NO, NO, RSFT,\ - LCTL,LGUI,LALT, BTN1, RGUI,RCTL \ - ), - - KEYMAP_62( - ESC, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, INS, DEL, \ - TAB, HOME,PGDN,UP, PGUP,END, HOME,PGDN,PGUP,END, NO, NO, NO, BSPC, \ - LCTL,NO, LEFT,DOWN,RGHT,NO, LEFT,DOWN,UP, RGHT,NO, NO, NO, ENT, \ - LSFT,NO, NO, NO, NO, NO, NO, HOME,PGDN,PGUP,END, TRNS,NO, RSFT, \ - LCTL,LGUI,LALT, SPC, RGUI,RCTL \ - ), - - KEYMAP_62( - ESC, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, INS, DEL, \ - TAB, NO, NO, NO, NO, NO, WH_L,WH_D,MS_U,WH_U,WH_R,BTN4,BTN5,FN4, \ - LCTL,VOLD,VOLU,MUTE,NO, NO, BTN2,MS_L,MS_D,MS_R,BTN1,NO, NO, ENT, \ - LSFT,NO, NO, NO, NO, NO, BTN3,BTN2,BTN1,BTN4,BTN5,NO, NO, NO, \ - LCTL,LGUI,LALT, TRNS, RGUI,RCTL \ - ), -}; - -enum macro_id { - ALT_TAB, -}; - -const uint16_t PROGMEM fn_actions[] = { - [0] = ACTION_LAYER_MOMENTARY(1), - [1] = ACTION_LAYER_TAP_KEY(2, KC_SCLN), - [2] = ACTION_LAYER_TAP_KEY(3, KC_SLASH), - [3] = ACTION_LAYER_TAP_KEY(4, KC_SPC), - [4] = ACTION_MACRO(ALT_TAB), -}; - -/* - * Macro definition - */ -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - keyevent_t event = record->event; - - switch (id) { - case ALT_TAB: - return (event.pressed ? - MACRO( D(LALT), D(TAB), END ) : - MACRO( U(TAB), END )); - } - return MACRO_NONE; -} diff --git a/converter/ibm4704_usb/keymap_plain.c b/converter/ibm4704_usb/keymap_plain.c deleted file mode 100644 index 4aed684e4ca..00000000000 --- a/converter/ibm4704_usb/keymap_plain.c +++ /dev/null @@ -1,50 +0,0 @@ -#include "keymap_common.h" - - -const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - /* 0: default - * ,-----------------------------------------------------------. - * | `| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|???|BS | - * |-----------------------------------------------------------| - * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \| - * |-----------------------------------------------------------| - * |Ctrl | A| S| D| F| G| H| J| K| L| ;| '|Ret|Ret | - * |-----------------------------------------------------------| - * |Shif|Shf| Z| X| C| V| B| N| M| ,| ,| /|???|Shift | - * |-----------------------------------------------------------| - * |Ctrl |Gui|Alt | Space |Alt* |Gui|Fn | - * `-----------------------------------------------------------' - */ - KEYMAP( - F1, F2, GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, NO, BSPC, INS, HOME,PGUP, NLCK,PSLS,PAST,PMNS, \ - F3, F4, TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC,RBRC,BSLS, DEL, END, PGDN, P7, P8, P9, PPLS, \ - F5, F6, LCTL,A, S, D, F, G, H, J, K, L, SCLN,QUOT,ENT, ENT, PSCR,SLCK,PAUS, P4, P5, P6, PPLS, \ - F7, F8, LSFT,LSFT,Z, X, C, V, B, N, M, COMM,DOT, SLSH,NO, RSFT, F11, UP, F12, P1, P2, P3, PENT, \ - F9, F10, LCTL,LGUI,LALT, SPC, RGUI,FN0, LEFT,DOWN,RGHT, P0, P0, PDOT,PENT \ - ), - - /* 1: HHKB - * ,-----------------------------------------------------------. - * |Esc| F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12|???|Del| - * |-----------------------------------------------------------| - * |Caps | | | | | | | |Psc|Slk|Pau| Up| | Ins| - * |-----------------------------------------------------------| - * |Ctrl |VoD|VoU|VoM| | | *| /|Hom|PgU|Lef|Rig|Ret|Ret | - * |-----------------------------------------------------------| - * |Shif|Shi| | | | | | +| -|End|PgD|Dow|???|Shift | - * |-----------------------------------------------------------| - * |Ctrl |Gui|Alt | Space |Alt* |Gui|Fn | - * `-----------------------------------------------------------' - */ - KEYMAP( - F1, F2, ESC, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, NO, DEL, INS, HOME,PGUP, NLCK,PSLS,PAST,PMNS, \ - F3, F4, CAPS,NO, NO, NO, NO, NO, NO, NO, PSCR,SLCK,PAUS, UP, NO, INS, DEL, END, PGDN, P7, P8, P9, PPLS, \ - F5, F6, TRNS,VOLD,VOLU,MUTE,NO, NO, PAST,PSLS,HOME,PGUP,LEFT,RGHT,ENT, ENT, PSCR,SLCK,PAUS, P4, P5, P6, PPLS, \ - F7, F8, TRNS,TRNS,NO, NO, NO, NO, NO, PPLS,PMNS,END, PGDN,DOWN,NO, TRNS, F11, UP, F12, P1, P2, P3, PENT, \ - F9, F10, TRNS,TRNS,TRNS, TRNS, TRNS,TRNS, LEFT,DOWN,RGHT, P0, P0, PDOT,PENT \ - ), -}; - -const uint16_t PROGMEM fn_actions[] = { - [0] = ACTION_LAYER_MOMENTARY(1), -}; diff --git a/converter/ibm4704_usb/led.c b/converter/ibm4704_usb/led.c deleted file mode 100644 index f76545f0ba6..00000000000 --- a/converter/ibm4704_usb/led.c +++ /dev/null @@ -1,24 +0,0 @@ -/* -Copyright 2011 Jun Wako - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#include "stdint.h" -#include "led.h" - - -void led_set(uint8_t usb_led) -{ -} diff --git a/converter/ibm4704_usb/matrix.c b/converter/ibm4704_usb/matrix.c deleted file mode 100644 index 5b91d49f81d..00000000000 --- a/converter/ibm4704_usb/matrix.c +++ /dev/null @@ -1,162 +0,0 @@ -/* -Copyright 2014 Jun Wako - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#include -#include -#include -#include -#include "action.h" -#include "print.h" -#include "debug.h" -#include "util.h" -#include "ibm4704.h" -#include "matrix.h" - - -static void matrix_make(uint8_t code); -static void matrix_break(uint8_t code); -static void matrix_clear(void); - - -/* - * Matrix Array usage: - * IBM 4704 scan codes are assigned into 128(16x8)-cell matrix. - * - * 8bit wide - * +---------+ - * 0| | - * :| XX | 00-7F - * f| | - * +---------+ - * - * Exceptions: - */ -static uint8_t matrix[MATRIX_ROWS]; - -// scan code bits 7654 3210 -// R:row/C:column -RRR RCCC -#define ROW(code) ((code>>3)&0x0f) -#define COL(code) (code&0x07) - - -inline -uint8_t matrix_rows(void) -{ - return MATRIX_ROWS; -} - -inline -uint8_t matrix_cols(void) -{ - return MATRIX_COLS; -} - -static void enable_break(void) -{ - print("Enable break: "); - while (ibm4704_send(0xFC)) { _delay_ms(10); } - // valid scancode: 00-79h - for (uint8_t code = 0; code < 0x7F; code++) { - while (ibm4704_send(0x80|code)) _delay_ms(10); - _delay_ms(5); // wait for response - // No response(FF) when ok, FD when out of bound - xprintf("s%02X:r%02X ", code, ibm4704_recv()); - } - while (ibm4704_send(0xFF)) { _delay_ms(10); } // End - print("End\n"); -} - - -void matrix_setup(void) -{ - ibm4704_init(); -} - -void matrix_init(void) -{ - debug_enable = true; - - print("IBM 4704 converter\n"); - matrix_clear(); - _delay_ms(2000); // wait for keyboard starting up - xprintf("Keyboard ID: %02X\n", ibm4704_recv()); - enable_break(); -} - -/* - * IBM 4704 Scan Code - */ -uint8_t matrix_scan(void) -{ - uint8_t code = ibm4704_recv(); - if (code==0xFF) { - // Not receivd - return 0; - } else if ((code&0x7F) >= 0x7A) { - // 0xFF-FA and 0x7F-7A is not scancode - xprintf("Error: %02X\n", code); - matrix_clear(); - return 0; - } else if (code&0x80) { - dprintf("%02X\n", code); - matrix_make(code); - } else { - dprintf("%02X\n", code); - matrix_break(code); - } - return 1; -} - -inline -bool matrix_is_on(uint8_t row, uint8_t col) -{ - return (matrix[row] & (1< - -Close-up picture of handset cable. You can see one end of plug has reverse color codes against the other. Click to enlarge. -[![4P4C cable](http://i.imgur.com/3S9P1mYm.jpg?1)](http://i.imgur.com/3S9P1mY.jpg?1) - -[Teensy]: http://www.pjrc.com/teensy/ -[TMK converter]: https://github.com/tmk/keyboard_converter - - -### Socket Pinout -- - -![Jack fig](http://www.kbdbabel.org/conn/kbd_connector_macplus.png) - - -### Pull-up Resistor -You may need pull-up resistors on signal lines(`CLOCK`, `DATA`) in particular when you have long or coiled cable. **1k-10k Ohm** will be OK for this purpose. In that case the converter may not read signal from keyboard correctly without pull-up resistors. - - - -Building Firmware ------------------ -To compile firmware you need AVR GCC. You can edit *Makefile* and *config.h* to change compile options and pin configuration. Also `KEYMAP` option can be used to select keymap. - - $ git clone git://github.com/tmk/tmk_keyboard.git (or download source) - $ cd m0110_usb - $ make -f Makefile.rev2 clean - $ make -f Makefile.rev2 [KEYMAP={default|intl|spacefn|hasu}] - -Use `Maefile.tmk_rev1` for TMK converter Rev.1, `Makefile.teensy` for Teensy instead. - - - -Keymap ------- -To create your own keymap copy existent keymap file to `keymap_name.c` and edit it. - - - -Debug ------ -You can use [PJRC HID listen](http://www.pjrc.com/teensy/hid_listen.html) to see debug output. The converter has some functions for debug, press `+H` simultaneously to get help. - -- Magic combo: `Shift+Option+⌘` or `Shift+Option+Ctrl`(`Shift+Alt+Gui` or `Shift+Alt+Control`) diff --git a/converter/m0110_usb/config.h b/converter/m0110_usb/config.h deleted file mode 100644 index 801bc4ebfa9..00000000000 --- a/converter/m0110_usb/config.h +++ /dev/null @@ -1,62 +0,0 @@ -/* -Copyright 2011,2012 Jun Wako - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#ifndef CONFIG_H -#define CONFIG_H - - -#define VENDOR_ID 0xFEED -#define PRODUCT_ID 0x0110 -#define DEVICE_VER 0x0101 -#define MANUFACTURER t.m.k. -#define PRODUCT M0110 keyboard converter -#define DESCRIPTION convert M0110 keyboard to USB - - -/* matrix size */ -#define MATRIX_ROWS 14 -#define MATRIX_COLS 8 - - -/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ -#define LOCKING_SUPPORT_ENABLE -/* Locking resynchronize hack */ -#define LOCKING_RESYNC_ENABLE - - -/* magic key */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_LALT) | MOD_BIT(KC_LGUI)) || \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_LALT) | MOD_BIT(KC_LCTL)) \ -) - -/* boot magic key */ -#define BOOTMAGIC_KEY_SALT KC_FN0 -#define BOOTMAGIC_KEY_CAPSLOCK_TO_CONTROL KC_LCAP - - -/* ports */ -#define M0110_CLOCK_PORT PORTD -#define M0110_CLOCK_PIN PIND -#define M0110_CLOCK_DDR DDRD -#define M0110_CLOCK_BIT 1 -#define M0110_DATA_PORT PORTD -#define M0110_DATA_PIN PIND -#define M0110_DATA_DDR DDRD -#define M0110_DATA_BIT 0 - -#endif diff --git a/converter/m0110_usb/keymap_common.c b/converter/m0110_usb/keymap_common.c deleted file mode 100644 index 4ac2d71783c..00000000000 --- a/converter/m0110_usb/keymap_common.c +++ /dev/null @@ -1,37 +0,0 @@ -/* -Copyright 2011,2012,2014 Jun Wako - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ -#include -#include -#include "action.h" -#include "keycode.h" -#include "keymap.h" -#include "keymap_common.h" - - -/* translates key to keycode */ -uint8_t keymap_key_to_keycode(uint8_t layer, keypos_t key) -{ - return pgm_read_byte(&keymaps[(layer)][(key.row)][(key.col)]); -} - -/* translates Fn index to action */ -action_t keymap_fn_to_action(uint8_t keycode) -{ - action_t action; - action.code = pgm_read_word(&fn_actions[FN_INDEX(keycode)]); - return action; -} diff --git a/converter/m0110_usb/keymap_common.h b/converter/m0110_usb/keymap_common.h deleted file mode 100644 index 925556d9776..00000000000 --- a/converter/m0110_usb/keymap_common.h +++ /dev/null @@ -1,133 +0,0 @@ -/* -Copyright 2011,2012,2014,2015 Jun Wako - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ -#include -#include -#include "keycode.h" -#include "keymap.h" - - -extern const uint8_t keymaps[][MATRIX_ROWS][MATRIX_COLS]; -extern const uint16_t fn_actions[]; - - -/* Common layout for M0110 and M0110A - * This keymap works with both keyboards. As you can see, the M0110A is - * a superset of M0110 keyboard, only one exception is 'Enter'(34) of M0110 - * does not exist on the M0110A. - * - * ,---------------------------------------------------------. ,---------------. - * | `| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Backs| |Clr| =| /| *| - * |---------------------------------------------------------| |---------------| - * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| | | 7| 8| 9| -| - * |-----------------------------------------------------' | |---------------| - * |Caps | A| S| D| F| G| H| J| K| L| ;| '|Return| | 4| 5| 6| +| - * |---------------------------------------------------------| |---------------| - * |Shift | Z| X| C| V| B| N| M| ,| ,| /|Shft|Up | | 1| 2| 3| | - * |---------------------------------------------------------| |-----------|Ent| - * |Opt |Mac | Space |Ent| \|Lft|Rgt|Dn | | 0| .| | - * `---------------------------------------------------------' `---------------' - * - * M0110A scan codes - * ,---------------------------------------------------------. ,---------------. - * | 32| 12| 13| 14| 15| 17| 16| 1A| 1C| 19| 1D| 1B| 18| 33| | 47| 68| 6D| 62| - * |---------------------------------------------------------| |---------------| - * | 30| 0C| 0D| 0E| 0F| 10| 11| 20| 22| 1F| 23| 21| 1E| | | 59| 5B| 5C| 4E| - * |-----------------------------------------------------' | |---------------| - * | 39| 00| 01| 02| 03| 05| 04| 26| 28| 25| 29| 27| 24| | 56| 57| 58| 66| - * |---------------------------------------------------------| |---------------| - * | 38| 06| 07| 08| 09| 0B| 2D| 2E| 2B| 2F| 2C| 38| 4D| | 53| 54| 55| | - * `---------------------------------------------------------' |-----------| 4C| - * | 3A| 37| 31 | 2A| 46| 42| 48| | 52| 41| | - * `---------------------------------------------------------' `---------------' - * - * M0110 + M0120 scan codes - * ,---------------------------------------------------------. ,---------------. - * | 32| 12| 13| 14| 15| 17| 16| 1A| 1C| 19| 1D| 1B| 18| 33| | 47| 68| 6D| 62| - * |---------------------------------------------------------| |---------------| - * | 30| 0C| 0D| 0E| 0F| 10| 11| 20| 22| 1F| 23| 21| 1E| 2A| | 59| 5B| 5C| 4E| - * |---------------------------------------------------------| |---------------| - * | 39| 00| 01| 02| 03| 05| 04| 26| 28| 25| 29| 27| 24| | 56| 57| 58| 66| - * |---------------------------------------------------------| |---------------| - * | 38| 06| 07| 08| 09| 0B| 2D| 2E| 2B| 2F| 2C| 38| | 53| 54| 55| | - * `---------------------------------------------------------' |-----------| 4C| - * | 3A| 37| 31 | 34| 3A| | 52| 41| | - * `------------------------------------------------' `---------------' - * Two right and left keys of 38 and 3A are identical, you cannot discriminate those two. - */ -#define KEYMAP( \ - K32,K12,K13,K14,K15,K17,K16,K1A,K1C,K19,K1D,K1B,K18,K33, K47,K68,K6D,K62, \ - K30,K0C,K0D,K0E,K0F,K11,K10,K20,K22,K1F,K23,K21,K1E, K59,K5B,K5C,K4E, \ - K39,K00,K01,K02,K03,K05,K04,K26,K28,K25,K29,K27, K24, K56,K57,K58,K66, \ - K38,K06,K07,K08,K09,K0B,K2D,K2E,K2B,K2F,K2C, K4D, K53,K54,K55,K4C, \ - K3A,K37, K31, K34,K2A,K46,K42,K48, K52, K41 \ -) { \ - { KC_##K00, KC_##K01, KC_##K02, KC_##K03, KC_##K04, KC_##K05, KC_##K06, KC_##K07 }, \ - { KC_##K08, KC_##K09, KC_NO, KC_##K0B, KC_##K0C, KC_##K0D, KC_##K0E, KC_##K0F }, \ - { KC_##K10, KC_##K11, KC_##K12, KC_##K13, KC_##K14, KC_##K15, KC_##K16, KC_##K17 }, \ - { KC_##K18, KC_##K19, KC_##K1A, KC_##K1B, KC_##K1C, KC_##K1D, KC_##K1E, KC_##K1F }, \ - { KC_##K20, KC_##K21, KC_##K22, KC_##K23, KC_##K24, KC_##K25, KC_##K26, KC_##K27 }, \ - { KC_##K28, KC_##K29, KC_##K2A, KC_##K2B, KC_##K2C, KC_##K2D, KC_##K2E, KC_##K2F }, \ - { KC_##K30, KC_##K31, KC_##K32, KC_##K33, KC_##K34, KC_NO, KC_NO, KC_##K37 }, \ - { KC_##K38, KC_##K39, KC_##K3A, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, \ - { KC_NO, KC_##K41, KC_##K42, KC_NO, KC_NO, KC_NO, KC_##K46, KC_##K47 }, \ - { KC_##K48, KC_NO, KC_NO, KC_NO, KC_##K4C, KC_##K4D, KC_##K4E, KC_NO }, \ - { KC_NO, KC_NO, KC_##K52, KC_##K53, KC_##K54, KC_##K55, KC_##K56, KC_##K57 }, \ - { KC_##K58, KC_##K59, KC_NO, KC_##K5B, KC_##K5C, KC_NO, KC_NO, KC_NO }, \ - { KC_NO, KC_NO, KC_##K62, KC_NO, KC_NO, KC_NO, KC_##K66, KC_NO }, \ - { KC_##K68, KC_NO, KC_NO, KC_NO, KC_NO, KC_##K6D, KC_NO, KC_NO }, \ -} - -/* International keyboard layout for M0110 + M0120 - * https://en.wikipedia.org/wiki/File:Apple_Macintosh_Plus_Keyboard.jpg - * Probably International keyboard layout of M0110A doesn't exist. - * - * M0110 + M0120 scan codes - * ,---------------------------------------------------------. ,---------------. - * | 32| 12| 13| 14| 15| 17| 16| 1A| 1C| 19| 1D| 1B| 18| 33| | 47| 68| 6D| 62| - * |---------------------------------------------------------| |---------------| - * | 30| 0C| 0D| 0E| 0F| 10| 11| 20| 22| 1F| 23| 21| 1E| 2A| | 59| 5B| 5C| 4E| - * |------------------------------------------------------, | |---------------| - * | 39| 00| 01| 02| 03| 05| 04| 26| 28| 25| 29| 27| 24| | | 56| 57| 58| 66| - * |---------------------------------------------------------| |---------------| - * | 38| 06| 07| 08| 09| 0B| 2D| 2E| 2B| 2F| 2C| 0A| 38| | 53| 54| 55| | - * `---------------------------------------------------------' |-----------| 4C| - * | 3A| 37| 34 | 31| 3A| | 52| 41| | - * `------------------------------------------------' `---------------' - * Two right and left keys of 38 and 3A are identical, you cannot discriminate those two. - */ -#define KEYMAP_INTL( \ - K32,K12,K13,K14,K15,K17,K16,K1A,K1C,K19,K1D,K1B,K18,K33, K47,K68,K6D,K62, \ - K30,K0C,K0D,K0E,K0F,K11,K10,K20,K22,K1F,K23,K21,K1E,K2A, K59,K5B,K5C,K4E, \ - K39,K00,K01,K02,K03,K05,K04,K26,K28,K25,K29,K27,K24, K56,K57,K58,K66, \ - K38,K06,K07,K08,K09,K0B,K2D,K2E,K2B,K2F,K2C,K0A, K53,K54,K55,K4C, \ - K3A,K37, K34, K31, K52, K41 \ -) { \ - { KC_##K00, KC_##K01, KC_##K02, KC_##K03, KC_##K04, KC_##K05, KC_##K06, KC_##K07 }, \ - { KC_##K08, KC_##K09, KC_##K0A, KC_##K0B, KC_##K0C, KC_##K0D, KC_##K0E, KC_##K0F }, \ - { KC_##K10, KC_##K11, KC_##K12, KC_##K13, KC_##K14, KC_##K15, KC_##K16, KC_##K17 }, \ - { KC_##K18, KC_##K19, KC_##K1A, KC_##K1B, KC_##K1C, KC_##K1D, KC_##K1E, KC_##K1F }, \ - { KC_##K20, KC_##K21, KC_##K22, KC_##K23, KC_##K24, KC_##K25, KC_##K26, KC_##K27 }, \ - { KC_##K28, KC_##K29, KC_##K2A, KC_##K2B, KC_##K2C, KC_##K2D, KC_##K2E, KC_##K2F }, \ - { KC_##K30, KC_##K31, KC_##K32, KC_##K33, KC_##K34, KC_NO, KC_NO, KC_##K37 }, \ - { KC_##K38, KC_##K39, KC_##K3A, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, \ - { KC_NO, KC_##K41, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_##K47 }, \ - { KC_NO, KC_NO, KC_NO, KC_NO, KC_##K4C, KC_NO, KC_##K4E, KC_NO }, \ - { KC_NO, KC_NO, KC_##K52, KC_##K53, KC_##K54, KC_##K55, KC_##K56, KC_##K57 }, \ - { KC_##K58, KC_##K59, KC_NO, KC_##K5B, KC_##K5C, KC_NO, KC_NO, KC_NO }, \ - { KC_NO, KC_NO, KC_##K62, KC_NO, KC_NO, KC_NO, KC_##K66, KC_NO }, \ - { KC_##K68, KC_NO, KC_NO, KC_NO, KC_NO, KC_##K6D, KC_NO, KC_NO }, \ -} diff --git a/converter/m0110_usb/keymap_default.c b/converter/m0110_usb/keymap_default.c deleted file mode 100644 index ff7478d1b59..00000000000 --- a/converter/m0110_usb/keymap_default.c +++ /dev/null @@ -1,137 +0,0 @@ -/* -Copyright 2011,2012,2015 Jun Wako - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ -#include -#include "keycode.h" -#include "keymap_common.h" - - - -#ifdef KEYMAP_SECTION_ENABLE -const uint8_t keymaps[][MATRIX_ROWS][MATRIX_COLS] __attribute__ ((section (".keymap.keymaps"))) = { -#else -const uint8_t keymaps[][MATRIX_ROWS][MATRIX_COLS] PROGMEM = { -#endif - /* Default: - * M0110 M0120 - * ,---------------------------------------------------------. ,---------------. - * | `| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Backs| |Nlk| =| /| *| - * |---------------------------------------------------------| |---------------| - * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \| | 7| 8| 9| -| - * |---------------------------------------------------------| |---------------| - * |Ctrl | A| S| D| F| G| H| J| K| L| ;| '|Return| | 4| 5| 6| +| - * |---------------------------------------------------------| |---------------| - * |Shift | Z| X| C| V| B| N| M| ,| ,| /|Shift | | 1| 2| 3| | - * `---------------------------------------------------------' |-----------|Ent| - * |Opt|Mac | Space |Fn |Opt| | 0| .| | - * `-----------------------------------------------' `---------------' - * M0110A - * ,---------------------------------------------------------. ,---------------. - * | `| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Backs| |Nlk| =| /| *| - * |---------------------------------------------------------| |---------------| - * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| | | 7| 8| 9| -| - * |-----------------------------------------------------' | |---------------| - * |Ctrl | A| S| D| F| G| H| J| K| L| ;| '|Return| | 4| 5| 6| +| - * |---------------------------------------------------------| |---------------| - * |Shift | Z| X| C| V| B| N| M| ,| ,| /|Shft|Up | | 1| 2| 3| | - * |---------------------------------------------------------| |-----------|Ent| - * |Opt |Mac | Space | \|Lft|Rgt|Dn | | 0| .| | - * `---------------------------------------------------------' `---------------' - */ - [0] = KEYMAP( - GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, BSPC, NLCK,EQL, PSLS,PAST, - TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC,RBRC, P7, P8, P9, PMNS, - LCTL,A, S, D, F, G, H, J, K, L, SCLN,QUOT, ENT, P4, P5, P6, PPLS, - LSFT,Z, X, C, V, B, N, M, COMM,DOT, SLSH, UP, P1, P2, P3, PENT, - LALT,LGUI, SPC, FN0, FN13,LEFT,RGHT,DOWN, P0, PDOT - ), - /* Cursor Layer: - * M0110 M0120 - * ,---------------------------------------------------------. ,---------------. - * |Esc| F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12|Delet| |Nlk| =| /| *| - * |---------------------------------------------------------| |---------------| - * |Caps |Hom| Up|PgU| | | | |Psc|Slk|Pau|Up |INS| | | 7| 8| 9| -| - * |---------------------------------------------------------| |---------------| - * |Ctrl |Lef|Dow|Rig| | | | |Hom|PgU|Lef|Rig|Return| | 4| 5| 6| +| - * |---------------------------------------------------------| |---------------| - * |Shift |End| |PgD| | | | |End|PgD|Dow|Shift | | 1| 2| 3| | - * `---------------------------------------------------------' |-----------|Ent| - * |Opt|Mac | Space |Fn |Opt| | 0| .| | - * `-----------------------------------------------' `---------------' - * M0110A - * ,---------------------------------------------------------. ,---------------. - * |Esc| F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12|Delet| |Nlk| =| /| *| - * |---------------------------------------------------------| |---------------| - * |Caps |Hom| Up|PgU| | | | |Psc|Slk|Pau|Up |INS| | | 7| 8| 9| -| - * |-----------------------------------------------------' | |---------------| - * |Ctrl |Lef|Dow|Rig| | | | |Hom|PgU|Lef|Rig|Return| | 4| 5| 6| +| - * |---------------------------------------------------------| |---------------| - * |Shift |End| |PgD| | | | |End|PgD|Dow|Shft|PgU| | 1| 2| 3| | - * |---------------------------------------------------------| |-----------|Ent| - * |Opt |Mac | Space | \|Hom|End|PgD| | 0| .| | - * `---------------------------------------------------------' `---------------' - */ - [1] = KEYMAP( - ESC, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, DEL, NLCK,EQL, PSLS,PAST, - CAPS,HOME,UP, PGUP,NO, NO, NO, NO, PSCR,SLCK,PAUS,UP, INS, P7, P8, P9, PMNS, - LCTL,LEFT,DOWN,RGHT,NO, NO, NO, NO, HOME,PGUP,LEFT,RGHT, ENT, P4, P5, P6, PPLS, - LSFT,END, NO, PGDN,NO, NO, NO, NO, END, PGDN,DOWN, PGUP, P1, P2, P3, PENT, - LALT,LGUI, SPC, FN0, FN13,HOME,END, PGDN, P0, PDOT - ), -}; - - -/* - * Fn action definition - */ -#ifdef KEYMAP_SECTION_ENABLE -const uint16_t fn_actions[] __attribute__ ((section (".keymap.fn_actions"))) = { -#else -const uint16_t fn_actions[] PROGMEM = { -#endif - [0] = ACTION_LAYER_MOMENTARY(1), - [1] = ACTION_LAYER_MOMENTARY(2), - [2] = ACTION_LAYER_MOMENTARY(3), - [3] = ACTION_LAYER_MOMENTARY(4), - [4] = ACTION_LAYER_MOMENTARY(5), - [5] = ACTION_LAYER_MOMENTARY(6), - [6] = ACTION_LAYER_MOMENTARY(7), - [7] = ACTION_LAYER_TOGGLE(1), - [8] = ACTION_LAYER_TOGGLE(2), - [9] = ACTION_LAYER_TOGGLE(3), - [10] = ACTION_LAYER_TAP_TOGGLE(1), - [11] = ACTION_LAYER_TAP_TOGGLE(2), - [12] = ACTION_LAYER_TAP_TOGGLE(3), - [13] = ACTION_LAYER_TAP_KEY(1, KC_BSLASH), - [14] = ACTION_LAYER_TAP_KEY(2, KC_TAB), - [15] = ACTION_LAYER_TAP_KEY(3, KC_ENTER), - [16] = ACTION_LAYER_TAP_KEY(4, KC_SPACE), - [17] = ACTION_LAYER_TAP_KEY(5, KC_SCOLON), - [18] = ACTION_LAYER_TAP_KEY(6, KC_QUOTE), - [19] = ACTION_LAYER_TAP_KEY(7, KC_SLASH), - [20] = ACTION_MODS_TAP_KEY(MOD_LSFT, KC_SPACE), - [21] = ACTION_MODS_TAP_KEY(MOD_LCTL, KC_SPACE), - [22] = ACTION_MODS_TAP_KEY(MOD_RCTL, KC_QUOTE), - [23] = ACTION_MODS_TAP_KEY(MOD_RCTL, KC_ENTER), - [24] = ACTION_MODS_TAP_KEY(MOD_LCTL, KC_ESC), - [25] = ACTION_MODS_TAP_KEY(MOD_LCTL, KC_BSPACE), - [26] = ACTION_MODS_ONESHOT(MOD_LCTL), - [27] = ACTION_MODS_TAP_KEY(MOD_LSFT, KC_ESC), - [28] = ACTION_MODS_TAP_KEY(MOD_LSFT, KC_BSPACE), - [29] = ACTION_MODS_ONESHOT(MOD_LSFT), - [30] = ACTION_MODS_TAP_KEY(MOD_RSFT, KC_GRAVE), - [31] = ACTION_MODS_TAP_KEY(MOD_RALT, KC_BSLASH), -}; diff --git a/converter/m0110_usb/keymap_hasu.c b/converter/m0110_usb/keymap_hasu.c deleted file mode 100644 index 11f1a4f394a..00000000000 --- a/converter/m0110_usb/keymap_hasu.c +++ /dev/null @@ -1,87 +0,0 @@ -/* -Copyright 2014 Jun Wako - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ -#include -#include "keycode.h" -#include "keymap_common.h" - - -const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - /* Default: - * M0110 - * ,---------------------------------------------------------. - * | `| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Backs| - * |---------------------------------------------------------| - * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \| - * |---------------------------------------------------------| - * |Ctrl | A| S| D| F| G| H| J| K| L| Fn| '|Return| - * |---------------------------------------------------------| - * |Shift | Z| X| C| V| B| N| M| ,| ,| Fn|Shift | - * `---------------------------------------------------------' - * |Fn |alt | Fn |Gui |Fn | - * `-----------------------------------------------' - */ - [0] = KEYMAP( - ESC, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, BSPC, NLCK,EQL, PSLS,PAST, - TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC,RBRC, P7, P8, P9, PMNS, - LCTL,A, S, D, F, G, H, J, K, L, FN3, QUOT, ENT, P4, P5, P6, PPLS, - LSFT,Z, X, C, V, B, N, M, COMM,DOT, FN1, UP, P1, P2, P3, PENT, - FN0, LALT, FN2, LGUI,BSLS,LEFT,RGHT,DOWN, P0, PDOT - ), - // IJKL cursor - [1] = KEYMAP( - GRV, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, DEL, NLCK,EQL, PSLS,PAST, - CAPS,NO, NO, NO, NO, NO, HOME,PGDN,UP, PGUP,END, NO, NO, P7, P8, P9, PMNS, - LCTL,VOLD,VOLU,MUTE,NO, NO, HOME,LEFT,DOWN,RGHT,END, NO, ENT, P4, P5, P6, PPLS, - LSFT,NO, NO, NO, NO, NO, HOME,PGDN,PGUP,END, NO, PGUP, P1, P2, P3, PENT, - TRNS,LALT, SPC, LGUI,BSLS,HOME,END, PGDN, P0, PDOT - ), - // HJKL cursor - [2] = KEYMAP( - GRV, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, DEL, NLCK,EQL, PSLS,PAST, - CAPS,NO, NO, NO, NO, NO, HOME,PGDN,UP, PGUP,END, NO, NO, P7, P8, P9, PMNS, - LCTL,VOLD,VOLU,MUTE,NO, NO, LEFT,DOWN,UP, RGHT,NO, NO, ENT, P4, P5, P6, PPLS, - LSFT,NO, NO, NO, NO, NO, HOME,PGDN,PGUP,END, TRNS, PGUP, P1, P2, P3, PENT, - TRNS,LALT, SPC, LGUI,BSLS,HOME,END, PGDN, P0, PDOT - ), - // Mousekey - [3] = KEYMAP( - GRV, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, DEL, NLCK,EQL, PSLS,PAST, - CAPS,Q, W, E, R, T, WH_L,WH_D,MS_U,WH_U,WH_R,WBAK,WFWD, P7, P8, P9, PMNS, - LCTL,VOLD,VOLU,MUTE,NO, NO, BTN2,MS_L,MS_D,MS_R,BTN1,NO, ENT, P4, P5, P6, PPLS, - LSFT,Z, X, C, V, B, BTN2,BTN1,BTN4,BTN5,NO, PGUP, P1, P2, P3, PENT, - NO, LALT, TRNS, LGUI,BSLS,HOME,END, PGDN, P0, PDOT - ), - // Mousekey - [4] = KEYMAP( - GRV, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, DEL, NLCK,EQL, PSLS,PAST, - CAPS,Q, W, E, R, T, WH_L,WH_D,MS_U,WH_U,WH_R,WBAK,WFWD, P7, P8, P9, PMNS, - LCTL,VOLD,VOLU,MUTE,NO, NO, BTN2,MS_L,MS_D,MS_R,TRNS,NO, ENT, P4, P5, P6, PPLS, - LSFT,Z, X, C, V, B, BTN2,BTN1,BTN4,BTN5,NO, PGUP, P1, P2, P3, PENT, - NO, LALT, BTN1, LGUI,BSLS,HOME,END, PGDN, P0, PDOT - ), -}; - - -/* - * Fn action definition - */ -const uint16_t fn_actions[] PROGMEM = { - [0] = ACTION_LAYER_MOMENTARY(1), - [1] = ACTION_LAYER_TAP_KEY(2, KC_SLASH), - [2] = ACTION_LAYER_TAP_KEY(3, KC_SPACE), - [3] = ACTION_LAYER_TAP_KEY(4, KC_SCOLON), -}; diff --git a/converter/m0110_usb/keymap_intl.c b/converter/m0110_usb/keymap_intl.c deleted file mode 100644 index 6cc251a2894..00000000000 --- a/converter/m0110_usb/keymap_intl.c +++ /dev/null @@ -1,73 +0,0 @@ -/* -Copyright 2015 Jun Wako - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ -#include -#include "keycode.h" -#include "keymap_common.h" - - - -const uint8_t keymaps[][MATRIX_ROWS][MATRIX_COLS] PROGMEM = { - /* International keyboard - * M0110 M0120 - * ,---------------------------------------------------------. ,---------------. - * | `| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Backs| |Nlk| -| +| *| - * |---------------------------------------------------------| |---------------| - * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]|Ret| | 7| 8| 9| /| - * |------------------------------------------------------, | |---------------| - * |Ctrl | A| S| D| F| G| H| J| K| L| ;| '| \| | | 4| 5| 6| ,| - * |---------------------------------------------------------| |---------------| - * |Shif| <| Z| X| C| V| B| N| M| ,| ,| /| | | 1| 2| 3| | - * `---------------------------------------------------------' |-----------|Ent| - * |Opt|Mac | Space |Fn | | | 0| .| | - * `-----------------------------------------------' `---------------' - */ - [0] = KEYMAP_INTL( - GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, BSPC, NLCK,EQL, PSLS,PAST, - TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC,RBRC,ENT, P7, P8, P9, PMNS, - LCTL,A, S, D, F, G, H, J, K, L, SCLN,QUOT,BSLS, P4, P5, P6, PPLS, - LSFT,NUBS,Z, X, C, V, B, N, M, COMM,DOT, SLSH, P1, P2, P3, PENT, - LALT,LGUI, SPC, FN0, P0, PDOT - ), - /* Cursor Layer - * ,---------------------------------------------------------. ,---------------. - * |Esc| F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12|Delet| |Nlk| -| +| *| - * |---------------------------------------------------------| |---------------| - * |Caps |Hom| Up|PgU| | | | |Psc|Slk|Pau|Up | |Ret| | 7| 8| 9| /| - * |------------------------------------------------------, | |---------------| - * |Ctrl |Lef|Dow|Rig| | | | |Hom|PgU|Lef|Rig|Ins| | | 4| 5| 6| ,| - * |---------------------------------------------------------| |---------------| - * |Shif| <|End| |PgD| | | | |End|PgD|Dow| | | 1| 2| 3| | - * `---------------------------------------------------------' |-----------|Ent| - * |Opt|Mac | Space |Fn | | | 0| .| | - * `-----------------------------------------------' `---------------' - */ - [1] = KEYMAP_INTL( - ESC, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, DEL, NLCK,EQL, PSLS,PAST, - CAPS,HOME,UP, PGUP,NO, NO, NO, NO, PSCR,SLCK,PAUS,UP, NO, ENT, P7, P8, P9, PMNS, - LCTL,LEFT,DOWN,RGHT,NO, NO, NO, NO, HOME,PGUP,LEFT,RGHT,INS, P4, P5, P6, PPLS, - LSFT,NO, END, NO, PGDN,NO, NO, NO, NO, END, PGDN,DOWN, P1, P2, P3, PENT, - LALT,LGUI, SPC, FN0, P0, PDOT - ), -}; - - -/* - * Fn action definition - */ -const uint16_t fn_actions[] PROGMEM = { - [0] = ACTION_LAYER_MOMENTARY(1), -}; diff --git a/converter/m0110_usb/keymap_spacefn.c b/converter/m0110_usb/keymap_spacefn.c deleted file mode 100644 index 5017861a34e..00000000000 --- a/converter/m0110_usb/keymap_spacefn.c +++ /dev/null @@ -1,71 +0,0 @@ -/* -Copyright 2014 Jun Wako - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ -#include -#include "keycode.h" -#include "keymap_common.h" - - -const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - /* Default: - * M0110 M0120 - * ,---------------------------------------------------------. ,---------------. - * | `| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Backs| |Nlk| -| +| *| - * |---------------------------------------------------------| |---------------| - * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \| | 7| 8| 9| /| - * |---------------------------------------------------------| |---------------| - * |Ctrl | A| S| D| F| G| H| J| K| L| ;| '|Return| | 4| 5| 6| ,| - * |---------------------------------------------------------| |---------------| - * |Shift | Z| X| C| V| B| N| M| ,| ,| /|Shift | | 1| 2| 3| | - * `---------------------------------------------------------' |-----------|Ent| - * |Opt|Mac | Space |Mac |Opt| | 0| .| | - * `-----------------------------------------------' `---------------' - * M0110A - * ,---------------------------------------------------------. ,---------------. - * | `| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Bcksp| |Nlk| =| /| *| - * |---------------------------------------------------------| |---------------| - * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| | | 7| 8| 9| -| - * |-----------------------------------------------------' | |---------------| - * |Caps | A| S| D| F| G| H| J| K| L| ;| '|Return| | 4| 5| 6| +| - * |---------------------------------------------------------| |---------------| - * |Shift | Z| X| C| V| B| N| M| ,| ,| /|Shft|Up | | 1| 2| 3| | - * |---------------------------------------------------------' |-----------|Ent| - * |Opt |Mac | Space | \|Lft|Rgt|Dn | | 0| .| | - * `---------------------------------------------------------' `---------------' - */ - [0] = KEYMAP( - GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, BSPC, NLCK,PEQL,PSLS,PAST, - TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC,RBRC, P7, P8, P9, PMNS, - LCTL,A, S, D, F, G, H, J, K, L, SCLN,QUOT, ENT, P4, P5, P6, PPLS, - LSFT,Z, X, C, V, B, N, M, COMM,DOT, SLSH, UP, P1, P2, P3, PENT, - LALT,LGUI, FN0, RGUI,BSLS,LEFT,RGHT,DOWN, P0, PDOT - ), - [1] = KEYMAP( - ESC, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, DEL, NLCK,EQL, PSLS,PAST, - TRNS,TRNS,TRNS,ESC, TRNS,TRNS,TRNS,HOME,UP, END, PSCR,SLCK,PAUS, P7, P8, P9, PMNS, - LCTL,TRNS,TRNS,TRNS,TRNS,TRNS,PGUP,LEFT,DOWN,RGHT,TRNS,TRNS, TRNS, P4, P5, P6, PPLS, - TRNS,TRNS,TRNS,TRNS,TRNS,SPC, PGDN,GRV, FN1, TRNS,APP, PGUP, P1, P2, P3, PENT, - TRNS,TRNS, TRNS, TRNS,INS, HOME,END, PGDN, P0, PDOT - ), -}; - -/* - * Fn action definition - */ -const uint16_t fn_actions[] PROGMEM = { - [0] = ACTION_LAYER_TAP_KEY(1, KC_SPACE), - [1] = ACTION_MODS_KEY(MOD_LSFT, KC_GRV), // tilde -}; diff --git a/converter/m0110_usb/led.c b/converter/m0110_usb/led.c deleted file mode 100644 index 3822a131b86..00000000000 --- a/converter/m0110_usb/led.c +++ /dev/null @@ -1,32 +0,0 @@ -/* -Copyright 2011 Jun Wako - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#include -#include -#include "led.h" - - -void led_set(uint8_t usb_led) -{ - if (usb_led & (1< - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -/* - * scan matrix - */ -#include -#include -#include -#include -#include "print.h" -#include "util.h" -#include "debug.h" -#include "host.h" -#include "led.h" -#include "m0110.h" -#include "matrix.h" - - -#define CAPS 0x39 -#define CAPS_BREAK (CAPS | 0x80) -#define ROW(key) ((key)>>3&0x0F) -#define COL(key) ((key)&0x07) - - -static bool is_modified = false; - -// matrix state buffer(1:on, 0:off) -static uint8_t *matrix; -static uint8_t _matrix0[MATRIX_ROWS]; - -static void register_key(uint8_t key); - - -inline -uint8_t matrix_rows(void) -{ - return MATRIX_ROWS; -} - -inline -uint8_t matrix_cols(void) -{ - return MATRIX_COLS; -} - -void matrix_init(void) -{ - m0110_init(); - // initialize matrix state: all keys off - for (uint8_t i=0; i < MATRIX_ROWS; i++) _matrix0[i] = 0x00; - matrix = _matrix0; - return; -} - -uint8_t matrix_scan(void) -{ - uint8_t key; - - is_modified = false; - key = m0110_recv_key(); - - if (key == M0110_NULL) { - return 0; - } else if (key == M0110_ERROR) { - return 0; - } else { - is_modified = true; - register_key(key); - } - - if (debug_enable) { - print("["); phex(key); print("]\n"); - } - return 1; -} - -bool matrix_is_modified(void) -{ - return is_modified; -} - -inline -bool matrix_has_ghost(void) -{ - return false; -} - -inline -bool matrix_is_on(uint8_t row, uint8_t col) -{ - return (matrix[row] & (1< - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#ifndef CONFIG_H -#define CONFIG_H - - -#define VENDOR_ID 0xFEED -#define PRODUCT_ID 0x5021 -#define MANUFACTURER t.m.k. -#define PRODUCT SONY NEWS keyboard converter -#define DESCRIPTION converts SONY NEWS protocol into USB - - -/* matrix size */ -#define MATRIX_ROWS 16 // keycode bit: 3-0 -#define MATRIX_COLS 8 // keycode bit: 6-4 - - -/* legacy keymap support */ -#define USE_LEGACY_KEYMAP - - -/* key combination for command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) || \ - keyboard_report->mods == (MOD_BIT(KC_LCTRL) | MOD_BIT(KC_RSHIFT)) \ -) - - -/* Asynchronous USART - * 8-data bit, non parity, 1-stop bit, no flow control - */ -#ifdef __AVR_ATmega32U4__ -# define NEWS_KBD_RX_VECT USART1_RX_vect -# define NEWS_KBD_RX_DATA UDR1 -# define NEWS_KBD_RX_BAUD 9600 -# define NEWS_KBD_RX_UBBR ((F_CPU/(16UL*NEWS_KBD_RX_BAUD))-1) -# define NEWS_KBD_RX_INIT() do { \ - UBRR1L = (uint8_t) NEWS_KBD_RX_UBBR; \ - UBRR1H = (uint8_t) (NEWS_KBD_RX_UBBR>>8); \ - UCSR1B |= (1< - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#include -#include -#include -#include "keycode.h" -#include "util.h" -#include "keymap.h" - - - - -// Following macros help you to define a keymap with the form of actual keyboard layout. - -/* SONY NEWS NWP-5461 */ -#define KEYMAP( \ - K7A, K01,K02,K03,K04,K05, K06,K07,K08,K09,K0A, K68,K69, K64,K65,K52, \ - K0B,K0C,K0D,K0E,K0F,K10,K11,K12,K13,K14,K15,K16,K17,K18,K19, K6A, K4B,K4C,K4D,K4E, \ - K1A,K1B,K1C,K1D,K1E,K1F,K20,K21,K22,K23,K24,K25,K26,K27, K6B, K4F,K50,K51,K56, \ - K28,K29,K2A,K2B,K2C,K2D,K2E,K2F,K30,K31,K32,K33,K34, K35, K6C, K53,K54,K55,K5A, \ - K36,K37,K38,K39,K3A,K3B,K3C,K3D,K3E,K3F,K40,K41, K42, K6D, K57,K59,K58, \ - K43,K44,K45, K46, K47, K48,K49,K4A, K6E, K66,K5B,K5C,K5D \ -) { \ - { KC_NO, KC_##K01, KC_##K02, KC_##K03, KC_##K04, KC_##K05, KC_##K06, KC_##K07 }, \ - { KC_##K08, KC_##K09, KC_##K0A, KC_##K0B, KC_##K0C, KC_##K0D, KC_##K0E, KC_##K0F }, \ - { KC_##K10, KC_##K11, KC_##K12, KC_##K13, KC_##K14, KC_##K15, KC_##K16, KC_##K17 }, \ - { KC_##K18, KC_##K19, KC_##K1A, KC_##K1B, KC_##K1C, KC_##K1D, KC_##K1E, KC_##K1F }, \ - { KC_##K20, KC_##K21, KC_##K22, KC_##K23, KC_##K24, KC_##K25, KC_##K26, KC_##K27 }, \ - { KC_##K28, KC_##K29, KC_##K2A, KC_##K2B, KC_##K2C, KC_##K2D, KC_##K2E, KC_##K2F }, \ - { KC_##K30, KC_##K31, KC_##K32, KC_##K33, KC_##K34, KC_##K35, KC_##K36, KC_##K37 }, \ - { KC_##K38, KC_##K39, KC_##K3A, KC_##K3B, KC_##K3C, KC_##K3D, KC_##K3E, KC_##K3F }, \ - { KC_##K40, KC_##K41, KC_##K42, KC_##K43, KC_##K44, KC_##K45, KC_##K46, KC_##K47 }, \ - { KC_##K48, KC_##K49, KC_##K4A, KC_##K4B, KC_##K4C, KC_##K4D, KC_##K4E, KC_##K4F }, \ - { KC_##K50, KC_##K51, KC_##K52, KC_##K53, KC_##K54, KC_##K55, KC_##K56, KC_##K57 }, \ - { KC_##K58, KC_##K59, KC_##K5A, KC_##K5B, KC_##K5C, KC_##K5D, KC_NO, KC_NO }, \ - { KC_NO, KC_NO, KC_NO, KC_NO, KC_##K64, KC_##K65, KC_##K66, KC_NO }, \ - { KC_##K68, KC_##K69, KC_##K6A, KC_##K6B, KC_##K6C, KC_##K6D, KC_##K6E, KC_NO }, \ - { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, }, \ - { KC_NO, KC_NO, KC_##K7A, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO } \ -} - - -// Assign Fn key(0-7) to a layer to which switch with the Fn key pressed. -static const uint8_t PROGMEM fn_layer[] = { - 0, // Fn0 - 0, // Fn1 - 0, // Fn2 - 0, // Fn3 - 0, // Fn4 - 0, // Fn5 - 0, // Fn6 - 0 // Fn7 -}; - -// Assign Fn key(0-7) to a keycode sent when release Fn key without use of the layer. -// See layer.c for details. -static const uint8_t PROGMEM fn_keycode[] = { - KC_NO, // Fn0 - KC_NO, // Fn1 - KC_NO, // Fn2 - KC_NO, // Fn3 - KC_NO, // Fn4 - KC_NO, // Fn5 - KC_NO, // Fn6 - KC_NO // Fn7 -}; - - -static const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - /* 0: default - * ,---. ,------------------------, ,------------------------. ,---------. - * |Pow| | F1 | F2 | F3 | F4 | F5 | | F6 | F7 | F8 | F9 | F10| | F11| F12| ,-----------. - * `---' `------------------------' `------------------------' `---------' | *| /| +| - * ,-------------------------------------------------------------. ,---. ,---------------| - * |Esc| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =| \| BS | |Hlp| | 7| 8| 9| -| - * |-------------------------------------------------------------| |---| |---------------| - * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]|Del| | |Ins| | 4| 5| 6| ,| - * |---------------------------------------------------------' | |---| |---------------| - * |Ctrl | A| S| D| F| G| H| J| K| L| ;| '| `|Return| |Clr| | 1| 2| 3| | - * |-------------------------------------------------------------| |---| |-----------|Ent| - * |Shift | Z| X| C| V| B| N| M| ,| ,| /| |Shift | |PgU| | 0| .| Up| | - * |-------------------------------------------------------------| |---| |---------------| - * |Alt |Gui |Alt | Space | |Gui|App|Ctrl | |PgD| |Tab|Lef|Dow|Rig| - * `-------------------------------------------------------------' `---' `---------------' - */ - KEYMAP( - PWR, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, PAST,PSLS,PPLS, - ESC, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, BSLS,BSPC, HELP, P7, P8, P9, PMNS, - TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC,RBRC,DEL, INS, P4, P5, P6, PCMM, - LCTL,A, S, D, F, G, H, J, K, L, SCLN,QUOT,GRV, ENT, CLR, P1, P2, P3, PENT, - LSFT,Z, X, C, V, B, N, M, COMM,DOT, SLSH,RO, RSFT, PGUP, P0, PDOT,UP, - LALT,CAPS,LALT, SPC, ERAS, RALT,RGUI,RCTL, PGDN, TAB, LEFT,DOWN,RGHT - ), -}; - - -uint8_t keymap_get_keycode(uint8_t layer, uint8_t row, uint8_t col) -{ - return pgm_read_byte(&keymaps[(layer)][(row)][(col)]); -} - -uint8_t keymap_fn_layer(uint8_t index) -{ - return pgm_read_byte(&fn_layer[index]); -} - -uint8_t keymap_fn_keycode(uint8_t index) -{ - return pgm_read_byte(&fn_keycode[index]); -} diff --git a/converter/news_usb/led.c b/converter/news_usb/led.c deleted file mode 100644 index 51e601318aa..00000000000 --- a/converter/news_usb/led.c +++ /dev/null @@ -1,26 +0,0 @@ -/* -Copyright 2012 Jun Wako - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#include "stdint.h" -#include "news.h" -#include "led.h" - - -void led_set(uint8_t usb_led) -{ - // not supported now -} diff --git a/converter/news_usb/matrix.c b/converter/news_usb/matrix.c deleted file mode 100644 index f0d5b58633a..00000000000 --- a/converter/news_usb/matrix.c +++ /dev/null @@ -1,142 +0,0 @@ -/* -Copyright 2012 Jun Wako - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#include -#include -#include -#include -#include "print.h" -#include "util.h" -#include "news.h" -#include "matrix.h" -#include "debug.h" - - -/* - * Matrix Array usage: - * - * ROW: 16 - * COL:8 - * - * 8bit wide - * +---------+ - * 0|00 ... 07| - * 1|08 ... 0F| - * :| ... | - * :| ... | - * E|70 ... 77| - * F|78 ... 7F| - * +---------+ - * - */ -static uint8_t matrix[MATRIX_ROWS]; -#define ROW(code) ((code>>3)&0xF) -#define COL(code) (code&0x07) - -static bool is_modified = false; - - -inline -uint8_t matrix_rows(void) -{ - return MATRIX_ROWS; -} - -inline -uint8_t matrix_cols(void) -{ - return MATRIX_COLS; -} - -void matrix_init(void) -{ - news_init(); - - // initialize matrix state: all keys off - for (uint8_t i=0; i < MATRIX_ROWS; i++) matrix[i] = 0x00; - - return; -} - -uint8_t matrix_scan(void) -{ - is_modified = false; - - uint8_t code; - code = news_recv(); - if (code == 0) { - return 0; - } - - phex(code); print(" "); - if (code&0x80) { - // break code - if (matrix_is_on(ROW(code), COL(code))) { - matrix[ROW(code)] &= ~(1< -Arduino code by "Ladyada" Limor Fried (http://ladyada.net/, http://adafruit.com/), released under BSD license - -Timing reference thanks to http://m0115.web.fc2.com/ (dead link), http://cfile7.uf.tistory.com/image/14448E464F410BF22380BB -Pinouts thanks to http://www.68k.org/~degs/nextkeyboard.html -Keycodes from http://ftp.netbsd.org/pub/NetBSD/NetBSD-release-6/src/sys/arch/next68k/dev/ - -This software is licensed with a Modified BSD License. -All of this is supposed to be Free Software, Open Source, DFSG-free, -GPL-compatible, and OK to use in both free and proprietary applications. -Additions and corrections to this file are welcome. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -* Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - -* Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - -* Neither the name of the copyright holders nor the names of - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE -LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. - -*/ - -#define VENDOR_ID 0xFEED -#define PRODUCT_ID 0xBCBC -#define DEVICE_VER 0x0500 -#define MANUFACTURER t.m.k. -#define PRODUCT NeXT Keyboard to USB converter -#define DESCRIPTION USB converter for NeXT non-ADB Keyboard - -/* matrix size */ -#define MATRIX_ROWS 12 // keycode bit: 3-0 -#define MATRIX_COLS 8 // keycode bit: 6-4 - -#define DEBUG_ON_INIT 1 - -//#define TEENSY_CONFIG 1 -//#define PRO_MICRO_CONFIG 1 -#define TMK_CONFIG 1 - -// comment out if you don't want the keyboard's LEDs to flash upon initialization or pressing shift -//#define NEXT_KBD_INIT_FLASH_LEDS -//#define NEXT_KBD_SHIFT_FLASH_LEDS - -//============= Start of Arduino Pro Micro Configuration ============== -#ifdef PRO_MICRO_CONFIG - -// this is the debugging LED that flashes when a key is being pressed -// comment out in order to disable debugging LED -#define NEXT_KBD_LED1_PORT PORTD -#define NEXT_KBD_LED1_PIN PIND -#define NEXT_KBD_LED1_DDR DDRD -#define NEXT_KBD_LED1_BIT 5 - -#define NEXT_KBD_LED1_ON NEXT_KBD_LED1_PORT &= ~(1<mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) || \ - (keyboard_report->mods == (MOD_BIT(KC_RALT) | MOD_BIT(KC_RALT))) || \ - (keyboard_report->mods == (MOD_BIT(KC_RGUI) | MOD_BIT(KC_RGUI))) \ -) diff --git a/converter/next_usb/keymap.c b/converter/next_usb/keymap.c deleted file mode 100644 index 0041df543fd..00000000000 --- a/converter/next_usb/keymap.c +++ /dev/null @@ -1,177 +0,0 @@ -/* -NeXT non-ADB Keyboard USB Converter - -Copyright 2013, Benjamin Gould (bgould@github.com) - -Based on: ---------- -* TMK firmware code Copyright 2011,2012 Jun WAKO -* Arduino code by "Ladyada" Limor Fried (http://ladyada.net/, http://adafruit.com/) \ - released under BSD license \ - https://github.com/adafruit/USB-NeXT-Keyboard - -Timing reference thanks to http://m0115.web.fc2.com/ (dead link), http://cfile7.uf.tistory.com/image/14448E464F410BF22380BB -Pinouts thanks to http://www.68k.org/~degs/nextkeyboard.html -Keycodes from http://ftp.netbsd.org/pub/NetBSD/NetBSD-release-6/src/sys/arch/next68k/dev/ - -This software is licensed with a Modified BSD License. -All of this is supposed to be Free Software, Open Source, DFSG-free, -GPL-compatible, and OK to use in both free and proprietary applications. -Additions and corrections to this file are welcome. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -* Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - -* Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - -* Neither the name of the copyright holders nor the names of - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE -LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. - -*/ - -#include -#include -#include -#include "keycode.h" -#include "print.h" -#include "debug.h" -#include "util.h" -#include "keymap.h" -#include "keycode.h" - -// 32*8(256) byte array which converts PS/2 code into USB code -static const uint16_t PROGMEM fn_actions[] = { - ACTION_LAYER_MOMENTARY(1), // FN0 - left command key - ACTION_LAYER_MOMENTARY(1), // FN1 - right command key - ACTION_KEY(KC_BSLS), // FN2 - number pad slash & backslash - ACTION_MODS_KEY(MOD_LSFT, KC_BSLS), // FN3 - number pad equals & pipe - ACTION_MODS_KEY(MOD_LCTL, KC_Z), // FN4 - cmd+undo on layer 1 - ACTION_MODS_KEY(MOD_LCTL, KC_X), // FN5 - cmd+cut on layer 1 - ACTION_MODS_KEY(MOD_LCTL, KC_C), // FN6 - cmd+copy on layer 1 - ACTION_MODS_KEY(MOD_LCTL, KC_V), // FN7 - cmd+paste on layer 1 -}; - -/* This is the physical layout that I am starting with: - * Note: there is some strangeness on the number pad; - * the equal sign shifts to pipe and forward slash shifts to backslash - * ,-----------------------------------------------------------. ,-----------. ,---------------. - * |Esc| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =| BS | |VUp|Pwr|BrU| |` | =| /| *| - * |-----------------------------------------------------------| |-----------| |---------------| - * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| | |VDn| |BrD| | 7| 8| 9| -| - * |------------------------------------------------------ | `---' `---' |-----------|---| - * |Ctrl | A| S| D| F| G| H| J| K| L| ;| '| Return| | 4| 5| 6| +| - * |-----------------------------------------------------------| ,---. |---------------| - * |Shift | Z| X| C| V| B| N| M| ,| .| /|Shift | |Up | | 1| 2| 3| | - * |-----------------------------------------------------------| ,-----------. |-----------|Ent| - * |Alt |Cmd | Space |Cmd |Alt | |Lef|Dow|Rig| | 0| .| | - * `-----------------------------------------------------------' `-----------' `---------------' - * - * Keymap array: - * 8 bytes - * +---------+ - * 0| | - * :| | 0x00-0x87 - * ;| | - * 11| | - * +---------+ - */ -#define KEYMAP( \ - K49,K4A,K4B,K4C,K4D,K50,K4F,K4E,K1E,K1F,K20,K1D,K1C,K1B, K1A,K58,K19, K26,K27,K28,K25, \ - K41,K42,K43,K44,K45,K48,K47,K46,K06,K07,K08,K05,K04,K03, K02, K01, K21,K22,K23,K24, \ - K57,K39,K3A,K3B,K3C,K3D,K40,K3F,K3E,K2D,K2C,K2B, K2A, K12,K18,K13,K15, \ - K56, K31,K32,K33,K34,K35,K37,K36,K2E,K2F,K30, K55, K16, K11,K17,K14, \ - K52,K54, K38, K53,K51, K09,K0F,K10, K0B, K0C,K0D \ -) { \ - { KC_NO, KC_##K01, KC_##K02, KC_##K03, KC_##K04, KC_##K05, KC_##K06, KC_##K07 }, \ - { KC_##K08, KC_##K09, KC_##K10, KC_##K0B, KC_##K0C, KC_##K0D, KC_NO, KC_##K0F }, \ - { KC_##K10, KC_##K11, KC_##K12, KC_##K13, KC_##K14, KC_##K15, KC_##K16, KC_##K17 }, \ - { KC_##K18, KC_##K19, KC_##K1A, KC_##K1B, KC_##K1C, KC_##K1D, KC_##K1E, KC_##K1F }, \ - { KC_##K20, KC_##K21, KC_##K22, KC_##K23, KC_##K24, KC_##K25, KC_##K26, KC_##K27 }, \ - { KC_##K28, KC_NO, KC_##K2A, KC_##K2B, KC_##K2C, KC_##K2D, KC_##K2E, KC_##K2F }, \ - { KC_##K30, KC_##K31, KC_##K32, KC_##K33, KC_##K34, KC_##K35, KC_##K36, KC_##K37 }, \ - { KC_##K38, KC_##K39, KC_##K3A, KC_##K3B, KC_##K3C, KC_##K3D, KC_##K3E, KC_##K3F }, \ - { KC_##K40, KC_##K41, KC_##K42, KC_##K43, KC_##K44, KC_##K45, KC_##K46, KC_##K47 }, \ - { KC_##K48, KC_##K49, KC_##K4A, KC_##K4B, KC_##K4C, KC_##K4D, KC_##K4E, KC_##K4F }, \ - { KC_##K50, KC_##K51, KC_##K52, KC_##K53, KC_##K54, KC_##K55, KC_##K56, KC_##K57 }, \ - { KC_##K58, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, }, \ -} - - -static const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - - /* Layer 0: default - * ,-----------------------------------------------------------. ,-----------. ,---------------. - * |Esc| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =| BS | |Ins|Ref|Hom| |` | =| /| *| - * |-----------------------------------------------------------| |-----------| |---------------| - * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| | |Del| |End| | 7| 8| 9| -| - * |-----------------------------------------------------' | `---' `---' |-----------|---| - * |Ctrl | A| S| D| F| G| H| J| K| L| ;| '| Return| | 4| 5| 6| +| - * |-----------------------------------------------------------| ,---. |---------------| - * |Shift | Z| X| C| V| B| N| M| ,| .| /|Shift | |Up | | 1| 2| 3| | - * |-----------------------------------------------------------| ,-----------. |-----------|Ent| - * |Fn0 |Alt | Space |LGui |Fn1 | |Lef|Dow|Rig| | 0| .| | - * `-----------------------------------------------------------' `-----------' `---------------' - */ - KEYMAP( - ESC, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, BSPC, INS, WREF,HOME, GRV, FN3, FN2, PAST, - TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC,RBRC,NO, DEL, END, P7, P8, P9, PMNS, - LCTL,A, S, D, F, G, H, J, K, L, SCLN,QUOT, ENT, P4, P5, P6, PPLS, - LSFT, Z, X, C, V, B, N, M, COMM,DOT, SLSH, RSFT, UP, P1, P2, P3, - FN0, LALT, SPC, LGUI,FN1, LEFT,DOWN,RGHT, P0, PDOT,PENT - - ), - - /* Layer 1: extra keys - * ,-----------------------------------------------------------. ,-----------. ,---------------. - * |Grv| F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12| BS | |VUp|VMu|PgU| |` | =| /| *| - * |-----------------------------------------------------------| |-----------| |---------------| - * |Tab |Pau| W| E| R| T| Y| U| I| O|PSc| \| ]| | |VDn| |PgD| | 7| 8| 9| -| - * |-----------------------------------------------------' | `---' `---' |-----------|---| - * |Ctrl | A| S| D| F| G| H| J| K| L| ;| '| Return| | 4| 5| 6| +| - * |-----------------------------------------------------------| ,---. |---------------| - * |Shift |UND|CUT|COP|PST| B| N| M| ,| .| /|Shift | |Up | | 1| 2| 3| | - * |-----------------------------------------------------------| ,-----------. |-----------|Ent| - * |Fn0 |Alt | Space |RGui |Fn1 | |Lef|Dow|Rig| | 0| .| | - * `-----------------------------------------------------------' `-----------' `---------------' - */ - KEYMAP( - - GRV, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, TRNS, VOLU,MUTE,PGUP, TRNS,TRNS,TRNS,TRNS, - TRNS,PAUS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,PSCR,FN3, BSLS,TRNS, VOLD, PGDN, BTN1,MS_U,BTN2,WH_U, - TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, TRNS, MS_L,MS_D,MS_R,WH_D, - TRNS, FN4, FN5, FN6, FN7, TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, TRNS, TRNS, TRNS,TRNS,TRNS, - TRNS,TRNS, TRNS, TRNS,TRNS, TRNS,TRNS,TRNS, TRNS, TRNS,TRNS - - ) -}; - -/* translates key to keycode */ -uint8_t keymap_key_to_keycode(uint8_t layer, keypos_t key) -{ - return pgm_read_byte(&keymaps[(layer)][(key.row)][(key.col)]); -} - -/* translates Fn keycode to action */ -action_t keymap_fn_to_action(uint8_t keycode) -{ - return (action_t){ .code = pgm_read_word(&fn_actions[FN_INDEX(keycode)]) }; -} diff --git a/converter/next_usb/led.c b/converter/next_usb/led.c deleted file mode 100644 index 2bd0ef6dd4f..00000000000 --- a/converter/next_usb/led.c +++ /dev/null @@ -1,60 +0,0 @@ -/* -NeXT non-ADB Keyboard USB Converter - -Copyright 2013, Benjamin Gould (bgould@github.com) - -Based on: -TMK firmware code Copyright 2011,2012 Jun WAKO -Arduino code by "Ladyada" Limor Fried (http://ladyada.net/, http://adafruit.com/), released under BSD license - -Timing reference thanks to http://m0115.web.fc2.com/ (dead link), http://cfile7.uf.tistory.com/image/14448E464F410BF22380BB -Pinouts thanks to http://www.68k.org/~degs/nextkeyboard.html -Keycodes from http://ftp.netbsd.org/pub/NetBSD/NetBSD-release-6/src/sys/arch/next68k/dev/ - -This software is licensed with a Modified BSD License. -All of this is supposed to be Free Software, Open Source, DFSG-free, -GPL-compatible, and OK to use in both free and proprietary applications. -Additions and corrections to this file are welcome. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -* Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - -* Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - -* Neither the name of the copyright holders nor the names of - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE -LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. - -*/ - -#include "stdint.h" -#include "led.h" -#include "next_kbd.h" - - -void led_set(uint8_t usb_led) -{ - if (usb_led & (1< -Arduino code by "Ladyada" Limor Fried (http://ladyada.net/, http://adafruit.com/), released under BSD license - -Timing reference thanks to http://m0115.web.fc2.com/ (dead link), http://cfile7.uf.tistory.com/image/14448E464F410BF22380BB -Pinouts thanks to http://www.68k.org/~degs/nextkeyboard.html -Keycodes from http://ftp.netbsd.org/pub/NetBSD/NetBSD-release-6/src/sys/arch/next68k/dev/ - -This software is licensed with a Modified BSD License. -All of this is supposed to be Free Software, Open Source, DFSG-free, -GPL-compatible, and OK to use in both free and proprietary applications. -Additions and corrections to this file are welcome. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -* Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - -* Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - -* Neither the name of the copyright holders nor the names of - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE -LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. - -*/ - -#include -#include -#include -#include -#include "print.h" -#include "util.h" -#include "serial.h" -#include "matrix.h" -#include "debug.h" -#include "matrix.h" -#include "next_kbd.h" - -static void matrix_make(uint8_t code); -static void matrix_break(uint8_t code); - -static uint8_t matrix[MATRIX_ROWS]; -#define ROW(code) ((code>>3)&0xF) -#define COL(code) (code&0x07) - -static bool is_modified = false; - -/* number of matrix rows */ -inline -uint8_t matrix_rows(void) -{ - return MATRIX_ROWS; -} - -/* number of matrix columns */ -inline -uint8_t matrix_cols(void) -{ - return MATRIX_COLS; -} - -#ifndef NEXT_KBD_LED1_ON -#define NEXT_KBD_LED1_ON -#endif - -#ifndef NEXT_KBD_LED1_OFF -#define NEXT_KBD_LED1_OFF -#endif - -#define NEXT_KBD_PWR_READ (NEXT_KBD_PWR_PIN&(1<>1) -#define NEXT_KBD_PRESSED_KEYCODE(response) (uint8_t)(((response)&0xF00)==0x400) -#define NEXT_KBD_PRESSED(response, mask) (uint8_t)(((response)&mask)>0) -#define NEXT_KBD_PRESSED_CONTROL(response) NEXT_KBD_PRESSED(response,0x01000) -#define NEXT_KBD_PRESSED_SHIFT_LEFT(response) NEXT_KBD_PRESSED(response,0x02000) -#define NEXT_KBD_PRESSED_SHIFT_RGHT(response) NEXT_KBD_PRESSED(response,0x04000) -#define NEXT_KBD_PRESSED_CMD_LEFT(response) NEXT_KBD_PRESSED(response,0x08000) -#define NEXT_KBD_PRESSED_CMD_RGHT(response) NEXT_KBD_PRESSED(response,0x10000) -#define NEXT_KBD_PRESSED_ALT_LEFT(response) NEXT_KBD_PRESSED(response,0x20000) -#define NEXT_KBD_PRESSED_ALT_RGHT(response) NEXT_KBD_PRESSED(response,0x40000) -#define NEXT_KBD_MAKE_OR_BREAK(key, code) \ - do { \ - if (NEXT_KBD_PRESSED_##key(resp) > 0) \ - matrix_make(code); \ - else \ - matrix_break(code); \ - } while (0); - -#define NEXT_KBD_PWR_KEYCODE 0x58 - -/* scan all key states on matrix */ -uint8_t matrix_scan(void) -{ - _delay_ms(5); - - //next_kbd_set_leds(false, false); - NEXT_KBD_LED1_OFF; - - is_modified = false; - - if (!NEXT_KBD_PWR_READ) { - matrix_make(NEXT_KBD_PWR_KEYCODE); - power_state = 1; - if (is_modified) - { - dprintf("Power state 1\n"); - - } - } else { - matrix_break(NEXT_KBD_PWR_KEYCODE); - power_state = 0; - if (is_modified) - { - dprintf("Power state 0\n"); - - } - } - - uint32_t resp = (next_kbd_recv()); - - if (resp == NEXT_KBD_KMBUS_IDLE) - { - return 0; - } - - NEXT_KBD_LED1_ON; - -#ifdef NEXT_KBD_SHIFT_FLASH_LEDS - next_kbd_set_leds( - NEXT_KBD_PRESSED_SHIFT_LEFT(resp) ? true : false, - NEXT_KBD_PRESSED_SHIFT_RGHT(resp) ? true : false - ); -#endif - - dprintf("[ r=%04lX keycode=%02X pressed=%X CTRL=%X SHIFT_LEFT=%X SHIFT_RGHT=%X CMD_LEFT=%X CMD_RGHT=%X ALT_LEFT=%X ALT_RGHT=%X ]\n", \ - resp, \ - NEXT_KBD_KEYCODE(resp), \ - NEXT_KBD_PRESSED_KEYCODE(resp), \ - NEXT_KBD_PRESSED_CONTROL(resp), \ - NEXT_KBD_PRESSED_SHIFT_LEFT(resp), \ - NEXT_KBD_PRESSED_SHIFT_RGHT(resp), \ - NEXT_KBD_PRESSED_CMD_LEFT(resp), \ - NEXT_KBD_PRESSED_CMD_RGHT(resp), \ - NEXT_KBD_PRESSED_ALT_LEFT(resp), \ - NEXT_KBD_PRESSED_ALT_RGHT(resp) \ - ); - - // Modifier keys don't return keycode; have to check the upper bits - NEXT_KBD_MAKE_OR_BREAK(ALT_RGHT, 0x51); - NEXT_KBD_MAKE_OR_BREAK(ALT_LEFT, 0x52); - NEXT_KBD_MAKE_OR_BREAK(CMD_RGHT, 0x53); - NEXT_KBD_MAKE_OR_BREAK(CMD_LEFT, 0x54); - NEXT_KBD_MAKE_OR_BREAK(SHIFT_RGHT, 0x55); - NEXT_KBD_MAKE_OR_BREAK(SHIFT_LEFT, 0x56); - NEXT_KBD_MAKE_OR_BREAK(CONTROL, 0x57); - NEXT_KBD_MAKE_OR_BREAK(KEYCODE, NEXT_KBD_KEYCODE(resp)); - - return 1; -} - -/* whether modified from previous scan. used after matrix_scan. */ -bool matrix_is_modified() -{ - return is_modified; -} - -/* whether a switch is on */ -inline -bool matrix_is_on(uint8_t row, uint8_t col) -{ - return (matrix[row] & (1< - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#ifndef CONFIG_H -#define CONFIG_H - -#define VENDOR_ID 0xFEED -#define PRODUCT_ID 0x9898 -#define DEVICE_VER 0x0100 -#define MANUFACTURER t.m.k. -#define PRODUCT PC98 keyboard converter -#define DESCRIPTION converts PC98 keyboard protocol into USB - - -/* matrix size */ -#define MATRIX_ROWS 16 -#define MATRIX_COLS 8 - -/* key combination for command */ -#define IS_COMMAND() ( \ - host_get_first_key() == KC_CANCEL \ -) - - -/* PC98 Reset Port shared with TXD */ -#define PC98_RST_DDR DDRD -#define PC98_RST_PORT PORTD -#define PC98_RST_BIT 3 -/* PC98 Ready Port */ -#define PC98_RDY_DDR DDRD -#define PC98_RDY_PORT PORTD -#define PC98_RDY_BIT 4 -/* PC98 Retry Port */ -#define PC98_RTY_DDR DDRD -#define PC98_RTY_PORT PORTD -#define PC98_RTY_BIT 5 - -/* - * PC98 Serial(USART) configuration - * asynchronous, positive logic, 19200baud, bit order: LSB first - * 1-start bit, 8-data bit, odd parity, 1-stop bit - */ -/* - * Software Serial - */ -#define SERIAL_SOFT_BAUD 19200 -#define SERIAL_SOFT_PARITY_ODD -#define SERIAL_SOFT_BIT_ORDER_LSB -#define SERIAL_SOFT_LOGIC_POSITIVE -/* RXD Port */ -#define SERIAL_SOFT_RXD_DDR DDRD -#define SERIAL_SOFT_RXD_PORT PORTD -#define SERIAL_SOFT_RXD_PIN PIND -#define SERIAL_SOFT_RXD_BIT 2 -#define SERIAL_SOFT_RXD_READ() (SERIAL_SOFT_RXD_PIN&(1<>8); /* baud rate */ \ - UCSR1B |= (1< - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#include -#include -#include -#include "keycode.h" -#include "action.h" -#include "action_macro.h" -#include "util.h" -#include "keymap.h" - - - - -/* PC-9801-98-S02 Raku Raku keyboard(Luckyboard) Normal Mode - ,---------------------------------------------------------------. - | 60| 61| 62| 63| 64| 65| 66| 67| 68| 69| 6A| 6B| 36| 37| 3F| 3E| - `---------------------------------------------------------------' - ,---------------------------------------------------------------. - | 00| 01| 02| 03| 04| 05| 58| 71| 06| 07| 08| 09| 0A| 0E| - |---------------------------------------------------------------| - | 0F| 10| 11| 12| 13| 14| 3A | 15| 16| 17| 18| 19| 1C| - |---------------------------------------------------------'. | - | 74| 20| 21| 22| 23| 24| 3B | 3C | 25| 26| 27| 28| 29| | - |---------------------------------------------------------------| - | 70| 2A| 2B| 2C| 2D| 2E| 38| 3D | 39| 2F| 30| 31| 32| 33| 70| - `---------------------------------------------------------------' - | 73| 51| 5B| 59| 34| 5A| 35| xx| - `-----------------------------------------------' - xx: 74 35 F4 B5 -*/ -#define KEYMAP( \ - K60, K61, K62, K63, K64, K65, K66, K67, K68, K69, K6A, K6B, K36, K37, K3F, K3E, \ - K00, K01, K02, K03, K04, K05, K58, K71, K06, K07, K08, K09, K0A, K0E, \ - K0F, K10, K11, K12, K13, K14, K3A, K15, K16, K17, K18, K19, K1C, \ - K74, K20, K21, K22, K23, K24, K3B, K3C, K25, K26, K27, K28, K29, \ - K70,K2A, K2B, K2C, K2D, K2E, K38, K3D, K39, K2F, K30, K31, K32, K33, \ - K73, K51, K5B, K59, K34, K5A, K35 \ -) { \ - { KC_##K00, KC_##K01, KC_##K02, KC_##K03, KC_##K04, KC_##K05, KC_##K06, KC_##K07 }, \ - { KC_##K08, KC_##K09, KC_##K0A, KC_NO, KC_NO, KC_NO, KC_##K0E, KC_##K0F }, \ - { KC_##K10, KC_##K11, KC_##K12, KC_##K13, KC_##K14, KC_##K15, KC_##K16, KC_##K17 }, \ - { KC_##K18, KC_##K19, KC_NO, KC_NO, KC_##K1C, KC_NO, KC_NO, KC_NO }, \ - { KC_##K20, KC_##K21, KC_##K22, KC_##K23, KC_##K24, KC_##K25, KC_##K26, KC_##K27 }, \ - { KC_##K28, KC_##K29, KC_##K2A, KC_##K2B, KC_##K2C, KC_##K2D, KC_##K2E, KC_##K2F }, \ - { KC_##K30, KC_##K31, KC_##K32, KC_##K33, KC_##K34, KC_##K35, KC_##K36, KC_##K37 }, \ - { KC_##K38, KC_##K39, KC_##K3A, KC_##K3B, KC_##K3C, KC_##K3D, KC_##K3E, KC_##K3F }, \ - { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, \ - { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, \ - { KC_NO, KC_##K51, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, \ - { KC_##K58, KC_##K59, KC_##K5A, KC_##K5B, KC_NO, KC_NO, KC_NO, KC_NO }, \ - { KC_##K60, KC_##K61, KC_##K62, KC_##K63, KC_##K64, KC_##K65, KC_##K66, KC_##K67 }, \ - { KC_##K68, KC_##K69, KC_##K6A, KC_##K6B, KC_NO, KC_NO, KC_NO, KC_NO }, \ - { KC_##K70, KC_##K71, KC_NO, KC_##K73, KC_##K74, KC_NO, KC_NO, KC_NO }, \ - { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO } \ -} - - - -static const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - /* - ,---------------------------------------------------------------. - | 60| 61| 62| 63| 64| 65| 66| 67| 68| 69| 6A| 6B| 36| 37| 3F| 3E| - `---------------------------------------------------------------' - ,---------------------------------------------------------------. - | 00| 01| 02| 03| 04| 05| 58| 71| 06| 07| 08| 09| 0A| 0E| - |---------------------------------------------------------------| - | 0F| 10| 11| 12| 13| 14| 3A | 15| 16| 17| 18| 19| 1C| - |---------------------------------------------------------------| - | 74| 20| 21| 22| 23| 24| MINS| EQL| 25| 26| 27| 28| 29| | - |---------------------------------------------------------------| - | 70| 2A| 2B| 2C| 2D| 2E| 38| 3D | 39| 2F| 30| 31| 32| 33| 70| - `---------------------------------------------------------------' - | 73| 51| 5B| 59| 34| 5A| 35| xx| - `-----------------------------------------------' - */ - KEYMAP( - CANCEL,COPY, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, F13, FN6, - ESC, 1, 2, 3, 4, 5, FN4, FN5, 6, 7, 8, 9, 0, BSPC, - TAB, Q, W, E, R, T, UP, Y, U, I, O, P, ENT, - LCTL, A, S, D, F, G, MINS, EQL, H, J, K, L, FN2, - LSFT, Z, X, C, V, B, GRV, BSLS, QUOT, N, M,COMM, DOT, FN1, - LGUI, LALT, LCTL, LSFT, SPC, SPC, RALT - ), - KEYMAP( - PAUS,COPY, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, F13, F14, - GRV, F1, F2, F3, F4, F5, NO, NO, F6, F7, F8, F9, F10, DEL, - TAB, Q, W, E, R, T, UP, HOME,PGDN,PGUP, END, P, ENT, - LCTL, A, S, D, F, G, MINS, EQL, LEFT,DOWN, UP,RGHT,SCLN, - LSFT, Z, X, C, V, B, INS, DOWN, DEL,HOME,PGDN,PGUP, END,TRNS, - LGUI, LALT, LCTL, LSFT, SPC, SPC, RALT - ), - KEYMAP( - PAUS,COPY, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, F13, F14, - GRV, F1, F2, F3, F4, F5, NO, NO, F6, F7, F8, F9, F10, DEL, - TAB, Q, W, E, R, T, UP, WH_L,WH_D,WH_U,WH_R, P, ENT, - LCTL, A, S, D, F, G, MINS, EQL, MS_L,MS_D,MS_U,MS_R,TRNS, - LSFT, Z, X, C, V, B, INS, DOWN, BTN3,BTN2,BTN1,BTN4,BTN5,TRNS, - LGUI, LALT, LCTL, LSFT, SPC, SPC, RALT - ), -}; -static const uint8_t PROGMEM overlays[][MATRIX_ROWS][MATRIX_COLS] = {}; - -/* - * Macro definition - */ -enum macro_id { - LBRACKET, - RBRACKET, - DUMMY, -}; - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - keyevent_t event = record->event; - //uint8_t tap_count = record->tap_count; - - switch (id) { - case LBRACKET: - return (event.pressed ? - MACRO( T(LBRC), END ) : - MACRO( T(LBRC), END ) ); - case RBRACKET: - return (event.pressed ? - MACRO( T(RBRC), END ) : - MACRO( T(RBRC), END ) ); - } - return MACRO_NONE; -} - -/* - * Action function - */ -void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) -{ -/* - keyevent_t event = record->event; - uint8_t tap_count = record->tap_count; - switch (id) { - case 0xFF: - action_macro_play(get_macro(opt, event.pressed)); - break; - } -*/ -} - - -/* - * Fn actions - */ -static const uint16_t PROGMEM fn_actions[] = { - ACTION_LAYER_TAP_TOGGLE(0), // FN0 - ACTION_LAYER_TAP_KEY(1, KC_SLASH), // FN1 - ACTION_LAYER_TAP_KEY(2, KC_SCLN), // FN2 - ACTION_LAYER_MOMENTARY(2), // FN3 - ACTION_MACRO(LBRACKET), // FN4 - ACTION_MACRO(RBRACKET), // FN5 - ACTION_MACRO(DUMMY), // FN6 -}; - - - - - - -/* - * No need to edit. - */ -#define KEYMAPS_SIZE (sizeof(keymaps) / sizeof(keymaps[0])) -#define FN_ACTIONS_SIZE (sizeof(fn_actions) / sizeof(fn_actions[0])) - -/* translates key to keycode */ -uint8_t keymap_key_to_keycode(uint8_t layer, keypos_t key) -{ - if (layer < KEYMAPS_SIZE) { - return pgm_read_byte(&keymaps[(layer)][(key.row)][(key.col)]); - } else { - // fall back to layer 0 - return pgm_read_byte(&keymaps[0][(key.row)][(key.col)]); - } -} - -/* translates Fn keycode to action */ -action_t keymap_fn_to_action(uint8_t keycode) -{ - action_t action; - if (FN_INDEX(keycode) < FN_ACTIONS_SIZE) { - action.code = pgm_read_word(&fn_actions[FN_INDEX(keycode)]); - } else { - action.code = ACTION_NO; - } - return action; -} diff --git a/converter/pc98_usb/led.c b/converter/pc98_usb/led.c deleted file mode 100644 index 48c3f1c2b29..00000000000 --- a/converter/pc98_usb/led.c +++ /dev/null @@ -1,33 +0,0 @@ -/* -Copyright 2012 Jun Wako - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#include "stdint.h" -#include "serial.h" -#include "led.h" - - -void led_set(uint8_t usb_led) -{ - uint8_t sun_led = 0; - if (usb_led & (1< - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#include -#include -#include -#include -#include "print.h" -#include "util.h" -#include "matrix.h" -#include "debug.h" -#include "protocol/serial.h" - - -/* - * Matrix Array usage: - * - * ROW: 16(4bits) - * COL: 8(3bits) - * - * 8bit wide - * +---------+ - * 0|00 ... 07| - * 1|08 ... 0F| - * :| ... | - * :| ... | - * E|70 ... 77| - * F|78 ... 7F| - * +---------+ - */ -static uint8_t matrix[MATRIX_ROWS]; -#define ROW(code) ((code>>3)&0xF) -#define COL(code) (code&0x07) - -static bool is_modified = false; - - -inline -uint8_t matrix_rows(void) -{ - return MATRIX_ROWS; -} - -inline -uint8_t matrix_cols(void) -{ - return MATRIX_COLS; -} - -static void pc98_inhibit_repeat(void) -{ - uint8_t code; - - while (serial_recv()) ; -RETRY: - PC98_RDY_PORT |= (1< -# to submit bug reports. -#AVRDUDE_VERBOSE = -v -v - -#AVRDUDE_FLAGS = -p $(MCU) -P $(AVRDUDE_PORT) -c $(AVRDUDE_PROGRAMMER) -AVRDUDE_FLAGS = -p $(MCU) -c $(AVRDUDE_PROGRAMMER) -AVRDUDE_FLAGS += $(AVRDUDE_NO_VERIFY) -AVRDUDE_FLAGS += $(AVRDUDE_VERBOSE) -AVRDUDE_FLAGS += $(AVRDUDE_ERASE_COUNTER) - -PROGRAM_CMD = $(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM) - - -# Boot Section Size in bytes -# Teensy halfKay 512 -# Atmel DFU loader 4096 -# LUFA bootloader 4096 -# USBasp 2048 -OPT_DEFS += -DBOOTLOADER_SIZE=2048 - - -# Search Path -VPATH += $(TARGET_DIR) -VPATH += $(TMK_DIR) - - -include $(TMK_DIR)/protocol.mk -include $(TMK_DIR)/common.mk -include $(TMK_DIR)/protocol/vusb.mk -include $(TMK_DIR)/rules.mk diff --git a/converter/ps2_usb/README.md b/converter/ps2_usb/README.md deleted file mode 100644 index 74464e26404..00000000000 --- a/converter/ps2_usb/README.md +++ /dev/null @@ -1,84 +0,0 @@ -PS/2 to USB keyboard converter -============================== -This firmware converts PS/2 keyboard protocol to USB.(It supports Scan Code Set 2.) - - -Connect Wires -------------- -In case of Teensy2.0(ATMega32U4): - -1. Connect **Vcc** and **GND**. -2. Connect **Clock** and **Data** line. - - **Interrupt**: **Clock** is on `PD1` and **Data** on `PD0`.(Recommended. Soarer's converter compatible) - - **Busywait**: **Clock** is on `PD1` and **Data** on `PD0`. - - **USART**: **Clock** is on `PD5` and **Data** on `PD2`. -3. Optionally you need pull-up resistor. 1K-10K Ohm is OK. - -To change pin configuration edit **config.h** and **Makefile**. - - -Build Firmware --------------- -For **PJRC Teensy** just run `make`: - - $ make clean - $ make - -To select keymap: - - $ make clean - $ make KEYMAP=[plain|jis|spacefn|...] - -After that you will find HEX file `ps2_usb_lufa.hex` in current directory. - - -- For **TMK converter Rev.1** use `make -f Makefile.tmk_rev1` instead of `make` and HEX file is `ps2_usb_tmk_rev1.hex`. - -- For **TMK converter Rev.2** use `make -f Makefile.tmk_rev2` instead of `make` and HEX file is `ps2_usb_tmk_rev2.hex`. - - -Keymap ------- -Several version of keymap are available in advance but you are recommended to define your favorite layout yourself. To define your own keymap create file named `keymap_.c` and see keymap document(you can find in README.md of top directory) and existent keymap files. - - -PS/2 signal handling implementations ------------------------------------- -Following three methods can be used to implement PS/2 signal handling. - -### Simple and stupid busy-wait(ps2_busywait.c) - This is expected to implemented with portable C code for reference. -### Interrupt driven(ps2_interrupt.c) - Uses pin interrupt to detect falling edge of clock line. -### USART hardware module(ps2_usart.c) - Uses AVR USART engine to receive PS/2 signal. - -To select method edit Makefile. - - -V-USB Support -------------- -With V-USB you can use this converter on ATmega(168/328) but it doesn't support NKRO at this time. - -Circuit: - - +---+ +---------------+ - USB GND | | ATmega168 | - === C3 | | - 5V <-------+--------+---|Vcc,AVCC | PS/2 - R1 | | ==== - D- <----+--+-----R2-----|INT1 RXD|------->DATA - D+ <----|---+----R3-----|INT0 XCK|------->CLOCK - Z1 Z2 | | ->5V - GND<----+---+--+--+-----|GND | ->GND - | | | | - | C2-+--|XTAL1 | - | X1 | | - +--C3-+--|XTAL2 | - +---------------+ - R1: 1.5K Ohm - R2,R3: 68 Ohm - Z1,Z2: Zenner 3.6V - C1,C2: 22pF - C3: 0.1uF - X1: Crystal 20MHz(16MHz/12MHz) diff --git a/converter/ps2_usb/config.h b/converter/ps2_usb/config.h deleted file mode 100644 index c0a4fab13b2..00000000000 --- a/converter/ps2_usb/config.h +++ /dev/null @@ -1,173 +0,0 @@ -/* -Copyright 2012 Jun Wako - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#ifndef CONFIG_H -#define CONFIG_H - -#include - -#define VENDOR_ID 0xFEED -#define PRODUCT_ID 0x6512 -#define DEVICE_VER 0x0001 -#define MANUFACTURER t.m.k. -#define PRODUCT PS/2 keyboard converter -#define DESCRIPTION convert PS/2 keyboard to USB - - -/* matrix size */ -#define MATRIX_ROWS 32 // keycode bit: 3-0 -#define MATRIX_COLS 8 // keycode bit: 6-4 - - -/* key combination for command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) || \ - keyboard_report->mods == (MOD_BIT(KC_LCTRL) | MOD_BIT(KC_RSHIFT)) \ -) - - -//#define NO_SUSPEND_POWER_DOWN - - -/* - * PS/2 Busywait - */ -#ifdef PS2_USE_BUSYWAIT -#define PS2_CLOCK_PORT PORTD -#define PS2_CLOCK_PIN PIND -#define PS2_CLOCK_DDR DDRD -#define PS2_CLOCK_BIT 1 -#define PS2_DATA_PORT PORTD -#define PS2_DATA_PIN PIND -#define PS2_DATA_DDR DDRD -#define PS2_DATA_BIT 0 -#endif - -/* - * PS/2 Pin interrupt - */ -#ifdef PS2_USE_INT -/* uses INT1 for clock line(ATMega32U4) */ -#define PS2_CLOCK_PORT PORTD -#define PS2_CLOCK_PIN PIND -#define PS2_CLOCK_DDR DDRD -#define PS2_CLOCK_BIT 1 -#define PS2_DATA_PORT PORTD -#define PS2_DATA_PIN PIND -#define PS2_DATA_DDR DDRD -#define PS2_DATA_BIT 0 -#define PS2_INT_INIT() do { \ - EICRA |= ((1< - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#ifndef CONFIG_MBED_H -#define CONFIG_MBED_H - - -#if 0 -// duplicated name against mbed USBDeivce -#define VENDOR_ID 0xFEED -#define PRODUCT_ID 0x6512 -#endif -#define DEVICE_VER 0x0001 -#define MANUFACTURER t.m.k. -#define PRODUCT PS/2 keyboard converter -#define DESCRIPTION convert PS/2 keyboard to USB - - -/* matrix size */ -#define MATRIX_ROWS 32 // keycode bit: 3-0 -#define MATRIX_COLS 8 // keycode bit: 6-4 - - -/* key combination for command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) || \ - keyboard_report->mods == (MOD_BIT(KC_LCTRL) | MOD_BIT(KC_RSHIFT)) \ -) - - -/* - * PS/2 Busywait - */ -#ifdef PS2_USE_BUSYWAIT -# define PS2_CLOCK_PORT PORTD -# define PS2_CLOCK_PIN PIND -# define PS2_CLOCK_DDR DDRD -# define PS2_CLOCK_BIT 5 -# define PS2_DATA_PORT PORTD -# define PS2_DATA_PIN PIND -# define PS2_DATA_DDR DDRD -# define PS2_DATA_BIT 2 -#endif - - -#endif diff --git a/converter/ps2_usb/config_tmk_rev1.h b/converter/ps2_usb/config_tmk_rev1.h deleted file mode 100644 index 75dc97df385..00000000000 --- a/converter/ps2_usb/config_tmk_rev1.h +++ /dev/null @@ -1,147 +0,0 @@ -/* -Copyright 2012 Jun Wako - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#ifndef CONFIG_H -#define CONFIG_H - -#include - -#define VENDOR_ID 0xFEED -#define PRODUCT_ID 0x6512 -#define DEVICE_VER 0x0001 -#define MANUFACTURER t.m.k. -#define PRODUCT PS/2 keyboard converter -#define DESCRIPTION convert PS/2 keyboard to USB - - -/* matrix size */ -#define MATRIX_ROWS 32 // keycode bit: 3-0 -#define MATRIX_COLS 8 // keycode bit: 6-4 - - -/* key combination for command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) || \ - keyboard_report->mods == (MOD_BIT(KC_LCTRL) | MOD_BIT(KC_RSHIFT)) \ -) - - -//#define NO_SUSPEND_POWER_DOWN - - -/* - * PS/2 Busywait - */ -#ifdef PS2_USE_BUSYWAIT -#define PS2_CLOCK_PORT PORTD -#define PS2_CLOCK_PIN PIND -#define PS2_CLOCK_DDR DDRD -#define PS2_CLOCK_BIT 5 -#define PS2_DATA_PORT PORTD -#define PS2_DATA_PIN PIND -#define PS2_DATA_DDR DDRD -#define PS2_DATA_BIT 2 -#endif - -/* - * PS/2 USART - */ -#ifdef PS2_USE_USART -#if defined(__AVR_ATmega16U4__) || defined(__AVR_ATmega32U4__) -/* XCK for clock line and RXD for data line */ -#define PS2_CLOCK_PORT PORTD -#define PS2_CLOCK_PIN PIND -#define PS2_CLOCK_DDR DDRD -#define PS2_CLOCK_BIT 5 -#define PS2_DATA_PORT PORTD -#define PS2_DATA_PIN PIND -#define PS2_DATA_DDR DDRD -#define PS2_DATA_BIT 2 -/* synchronous, odd parity, 1-bit stop, 8-bit data, sample at falling edge */ -/* set DDR of CLOCK as input to be slave */ -#define PS2_USART_INIT() do { \ - PS2_CLOCK_DDR &= ~(1< - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#ifndef CONFIG_H -#define CONFIG_H - -#include - -#define VENDOR_ID 0xFEED -#define PRODUCT_ID 0x6512 -#define DEVICE_VER 0x0001 -#define MANUFACTURER t.m.k. -#define PRODUCT PS/2 keyboard converter -#define DESCRIPTION convert PS/2 keyboard to USB - - -/* matrix size */ -#define MATRIX_ROWS 32 // keycode bit: 3-0 -#define MATRIX_COLS 8 // keycode bit: 6-4 - - -/* key combination for command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - - -//#define NO_SUSPEND_POWER_DOWN - - -/* - * PS/2 Busywait - */ -#ifdef PS2_USE_BUSYWAIT -#define PS2_CLOCK_PORT PORTD -#define PS2_CLOCK_PIN PIND -#define PS2_CLOCK_DDR DDRD -#define PS2_CLOCK_BIT 1 -#define PS2_DATA_PORT PORTD -#define PS2_DATA_PIN PIND -#define PS2_DATA_DDR DDRD -#define PS2_DATA_BIT 0 -#endif - -/* - * PS/2 Pin interrupt - */ -#ifdef PS2_USE_INT -/* uses INT1 for clock line(ATMega32U4) */ -#define PS2_CLOCK_PORT PORTD -#define PS2_CLOCK_PIN PIND -#define PS2_CLOCK_DDR DDRD -#define PS2_CLOCK_BIT 1 -#define PS2_DATA_PORT PORTD -#define PS2_DATA_PIN PIND -#define PS2_DATA_DDR DDRD -#define PS2_DATA_BIT 0 -#define PS2_INT_INIT() do { \ - EICRA |= ((1< - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ -#include "keymap_common.h" -#include "progmem.h" - - -/* translates key to keycode */ -uint8_t keymap_key_to_keycode(uint8_t layer, keypos_t key) -{ - return pgm_read_byte(&keymaps[(layer)][(key.row)][(key.col)]); -} - -/* translates Fn keycode to action */ -action_t keymap_fn_to_action(uint8_t keycode) -{ - return (action_t){ .code = pgm_read_word(&fn_actions[FN_INDEX(keycode)]) }; -} diff --git a/converter/ps2_usb/keymap_common.h b/converter/ps2_usb/keymap_common.h deleted file mode 100644 index d783e01dedd..00000000000 --- a/converter/ps2_usb/keymap_common.h +++ /dev/null @@ -1,173 +0,0 @@ -/* -Copyright 2011,2012,2013 Jun Wako - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ -#ifndef KEYMAP_COMMON_H -#define KEYMAP_COMMON_H - -#include -#include -#include "keycode.h" -#include "action.h" -#include "action_macro.h" -#include "report.h" -#include "print.h" -#include "debug.h" -#include "keymap.h" - - -// 32*8(256) byte array which converts PS/2 code into USB code -extern const uint8_t keymaps[][MATRIX_ROWS][MATRIX_COLS]; -extern const uint16_t fn_actions[]; - - -/* All keys */ -#define KEYMAP_ALL( \ - K76,K05,K06,K04,K0C,K03,K0B,K83,K0A,K01,K09,K78,K07, KFC,K7E,KFE, \ - K0E,K16,K1E,K26,K25,K2E,K36,K3D,K3E,K46,K45,K4E,K55,K66, KF0,KEC,KFD, K77,KCA,K7C,K7B, \ - K0D,K15,K1D,K24,K2D,K2C,K35,K3C,K43,K44,K4D,K54,K5B,K5D, KF1,KE9,KFA, K6C,K75,K7D, \ - K58,K1C,K1B,K23,K2B,K34,K33,K3B,K42,K4B,K4C,K52, K5A, K6B,K73,K74,K79, \ - K12,K1A,K22,K21,K2A,K32,K31,K3A,K41,K49,K4A, K59, KF5, K69,K72,K7A, \ - K14,K9F,K11, K29, K91,KA7,KAF,K94, KEB,KF2,KF4, K70, K71,KDA, \ - \ - K61, /* for European ISO */ \ - K51, K13, K6A, K64, K67, /* for Japanese JIS */ \ - K08, K10, K18, K20, K28, K30, K38, K40, K48, K50, K57, K5F, /* F13-24 */ \ - KB7, KBF, KDE, /* System Power, Sleep, Wake */ \ - KA3, KB2, KA1, /* Mute, Volume Up, Volume Down */ \ - KCD, K95, KBB, KB4, KD0, /* Next, Previous, Stop, Pause, Media Select */ \ - KC8, KAB, KC0, /* Mail, Calculator, My Computer */ \ - K90, KBA, KB8, KB0, /* WWW Search, Home, Back, Forward */ \ - KA8, KA0, K98 /* WWW Stop, Refresh, Favorites */ \ -) { \ - { KC_NO, KC_##K01, KC_NO, KC_##K03, KC_##K04, KC_##K05, KC_##K06, KC_##K07 }, \ - { KC_##K08, KC_##K09, KC_##K0A, KC_##K0B, KC_##K0C, KC_##K0D, KC_##K0E, KC_NO }, \ - { KC_##K10, KC_##K11, KC_##K12, KC_##K13, KC_##K14, KC_##K15, KC_##K16, KC_NO }, \ - { KC_##K18, KC_NO, KC_##K1A, KC_##K1B, KC_##K1C, KC_##K1D, KC_##K1E, KC_NO }, \ - { KC_##K20, KC_##K21, KC_##K22, KC_##K23, KC_##K24, KC_##K25, KC_##K26, KC_NO }, \ - { KC_##K28, KC_##K29, KC_##K2A, KC_##K2B, KC_##K2C, KC_##K2D, KC_##K2E, KC_NO }, \ - { KC_##K30, KC_##K31, KC_##K32, KC_##K33, KC_##K34, KC_##K35, KC_##K36, KC_NO }, \ - { KC_##K38, KC_NO, KC_##K3A, KC_##K3B, KC_##K3C, KC_##K3D, KC_##K3E, KC_NO }, \ - { KC_##K40, KC_##K41, KC_##K42, KC_##K43, KC_##K44, KC_##K45, KC_##K46, KC_NO }, \ - { KC_##K48, KC_##K49, KC_##K4A, KC_##K4B, KC_##K4C, KC_##K4D, KC_##K4E, KC_NO }, \ - { KC_##K50, KC_##K51, KC_##K52, KC_NO, KC_##K54, KC_##K55, KC_NO, KC_##K57 }, \ - { KC_##K58, KC_##K59, KC_##K5A, KC_##K5B, KC_NO, KC_##K5D, KC_NO, KC_##K5F }, \ - { KC_NO, KC_##K61, KC_NO, KC_NO, KC_##K64, KC_NO, KC_##K66, KC_##K67 }, \ - { KC_NO, KC_##K69, KC_##K6A, KC_##K6B, KC_##K6C, KC_NO, KC_NO, KC_NO }, \ - { KC_##K70, KC_##K71, KC_##K72, KC_##K73, KC_##K74, KC_##K75, KC_##K76, KC_##K77 }, \ - { KC_##K78, KC_##K79, KC_##K7A, KC_##K7B, KC_##K7C, KC_##K7D, KC_##K7E, KC_NO }, \ - { KC_NO, KC_NO, KC_NO, KC_##K83, KC_NO, KC_NO, KC_NO, KC_NO }, \ - { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, \ - { KC_##K90, KC_##K91, KC_NO, KC_NO, KC_##K94, KC_##K95, KC_NO, KC_NO }, \ - { KC_##K98, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_##K9F }, \ - { KC_##KA0, KC_##KA1, KC_NO, KC_##KA3, KC_NO, KC_NO, KC_NO, KC_##KA7 }, \ - { KC_##KA8, KC_NO, KC_NO, KC_##KAB, KC_NO, KC_NO, KC_NO, KC_##KAF }, \ - { KC_##KB0, KC_NO, KC_##KB2, KC_NO, KC_##KB4, KC_NO, KC_NO, KC_##KB7 }, \ - { KC_##KB8, KC_NO, KC_##KBA, KC_##KBB, KC_NO, KC_NO, KC_NO, KC_##KBF }, \ - { KC_##KC0, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, \ - { KC_##KC8, KC_NO, KC_##KCA, KC_NO, KC_NO, KC_##KCD, KC_NO, KC_NO }, \ - { KC_##KD0, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, \ - { KC_NO, KC_NO, KC_##KDA, KC_NO, KC_NO, KC_NO, KC_##KDE, KC_NO }, \ - { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, \ - { KC_NO, KC_##KE9, KC_NO, KC_##KEB, KC_##KEC, KC_NO, KC_NO, KC_NO }, \ - { KC_##KF0, KC_##KF1, KC_##KF2, KC_NO, KC_##KF4, KC_##KF5, KC_NO, KC_NO }, \ - { KC_NO, KC_NO, KC_##KFA, KC_NO, KC_##KFC, KC_##KFD, KC_##KFE, KC_NO }, \ -} - -/* US layout */ -#define KEYMAP( \ - K76,K05,K06,K04,K0C,K03,K0B,K83,K0A,K01,K09,K78,K07, KFC,K7E,KFE, \ - K0E,K16,K1E,K26,K25,K2E,K36,K3D,K3E,K46,K45,K4E,K55,K66, KF0,KEC,KFD, K77,KCA,K7C,K7B, \ - K0D,K15,K1D,K24,K2D,K2C,K35,K3C,K43,K44,K4D,K54,K5B,K5D, KF1,KE9,KFA, K6C,K75,K7D, \ - K58,K1C,K1B,K23,K2B,K34,K33,K3B,K42,K4B,K4C,K52, K5A, K6B,K73,K74,K79, \ - K12,K1A,K22,K21,K2A,K32,K31,K3A,K41,K49,K4A, K59, KF5, K69,K72,K7A, \ - K14,K9F,K11, K29, K91,KA7,KAF,K94, KEB,KF2,KF4, K70, K71,KDA \ -) \ -KEYMAP_ALL( \ - K76,K05,K06,K04,K0C,K03,K0B,K83,K0A,K01,K09,K78,K07, KFC,K7E,KFE, \ - K0E,K16,K1E,K26,K25,K2E,K36,K3D,K3E,K46,K45,K4E,K55,K66, KF0,KEC,KFD, K77,KCA,K7C,K7B, \ - K0D,K15,K1D,K24,K2D,K2C,K35,K3C,K43,K44,K4D,K54,K5B,K5D, KF1,KE9,KFA, K6C,K75,K7D, \ - K58,K1C,K1B,K23,K2B,K34,K33,K3B,K42,K4B,K4C,K52, K5A, K6B,K73,K74,K79, \ - K12,K1A,K22,K21,K2A,K32,K31,K3A,K41,K49,K4A, K59, KF5, K69,K72,K7A, \ - K14,K9F,K11, K29, K91,KA7,KAF,K94, KEB,KF2,KF4, K70, K71,KDA, \ - \ - NUBS, \ - RO, KANA, JYEN, HENK, MHEN, \ - F13, F14, F15, F16, F17, F18, F19, F20, F21, F22, F23, F24, \ - SYSTEM_POWER, SYSTEM_SLEEP, SYSTEM_WAKE, \ - AUDIO_MUTE, AUDIO_VOL_UP, AUDIO_VOL_DOWN, \ - MEDIA_NEXT_TRACK, MEDIA_PREV_TRACK, MEDIA_STOP, MEDIA_PLAY_PAUSE, MEDIA_SELECT, \ - MAIL, CALCULATOR, MY_COMPUTER, \ - WWW_SEARCH, WWW_HOME, WWW_BACK, WWW_FORWARD, \ - WWW_STOP, WWW_REFRESH, WWW_FAVORITES \ -) - -/* ISO layout */ -#define KEYMAP_ISO( \ - K76,K05,K06,K04,K0C,K03,K0B,K83,K0A,K01,K09,K78,K07, KFC,K7E,KFE, \ - K0E,K16,K1E,K26,K25,K2E,K36,K3D,K3E,K46,K45,K4E,K55,K66, KF0,KEC,KFD, K77,KCA,K7C,K7B, \ - K0D,K15,K1D,K24,K2D,K2C,K35,K3C,K43,K44,K4D,K54,K5B, KF1,KE9,KFA, K6C,K75,K7D, \ - K58,K1C,K1B,K23,K2B,K34,K33,K3B,K42,K4B,K4C,K52,K5D,K5A, K6B,K73,K74,K79, \ - K12,K61,K1A,K22,K21,K2A,K32,K31,K3A,K41,K49,K4A, K59, KF5, K69,K72,K7A, \ - K14,K9F,K11, K29, K91,KA7,KAF,K94, KEB,KF2,KF4, K70, K71,KDA \ -) \ -KEYMAP_ALL( \ - K76,K05,K06,K04,K0C,K03,K0B,K83,K0A,K01,K09,K78,K07, KFC,K7E,KFE, \ - K0E,K16,K1E,K26,K25,K2E,K36,K3D,K3E,K46,K45,K4E,K55,K66, KF0,KEC,KFD, K77,KCA,K7C,K7B, \ - K0D,K15,K1D,K24,K2D,K2C,K35,K3C,K43,K44,K4D,K54,K5B,K5D, KF1,KE9,KFA, K6C,K75,K7D, \ - K58,K1C,K1B,K23,K2B,K34,K33,K3B,K42,K4B,K4C,K52, K5A, K6B,K73,K74,K79, \ - K12,K1A,K22,K21,K2A,K32,K31,K3A,K41,K49,K4A, K59, KF5, K69,K72,K7A, \ - K14,K9F,K11, K29, K91,KA7,KAF,K94, KEB,KF2,KF4, K70, K71,KDA, \ - \ - K61, \ - RO, KANA, JYEN, HENK, MHEN, \ - F13, F14, F15, F16, F17, F18, F19, F20, F21, F22, F23, F24, \ - SYSTEM_POWER, SYSTEM_SLEEP, SYSTEM_WAKE, \ - AUDIO_MUTE, AUDIO_VOL_UP, AUDIO_VOL_DOWN, \ - MEDIA_NEXT_TRACK, MEDIA_PREV_TRACK, MEDIA_STOP, MEDIA_PLAY_PAUSE, MEDIA_SELECT, \ - MAIL, CALCULATOR, MY_COMPUTER, \ - WWW_SEARCH, WWW_HOME, WWW_BACK, WWW_FORWARD, \ - WWW_STOP, WWW_REFRESH, WWW_FAVORITES \ -) - -/* JIS layout */ -#define KEYMAP_JIS( \ - K76,K05,K06,K04,K0C,K03,K0B,K83,K0A,K01,K09,K78,K07, KFC,K7E,KFE, \ - K0E,K16,K1E,K26,K25,K2E,K36,K3D,K3E,K46,K45,K4E,K55,K6A,K66, KF0,KEC,KFD, K77,KCA,K7C,K7B, \ - K0D,K15,K1D,K24,K2D,K2C,K35,K3C,K43,K44,K4D,K54,K5B, KF1,KE9,KFA, K6C,K75,K7D, \ - K58,K1C,K1B,K23,K2B,K34,K33,K3B,K42,K4B,K4C,K52,K5D, K5A, K6B,K73,K74,K79, \ - K12,K1A,K22,K21,K2A,K32,K31,K3A,K41,K49,K4A,K51, K59, KF5, K69,K72,K7A, \ - K14,K9F,K11, K67,K29,K64,K13, K91,KA7,KAF,K94, KEB,KF2,KF4, K70, K71,KDA \ -) \ -KEYMAP_ALL( \ - K76,K05,K06,K04,K0C,K03,K0B,K83,K0A,K01,K09,K78,K07, KFC,K7E,KFE, \ - K0E,K16,K1E,K26,K25,K2E,K36,K3D,K3E,K46,K45,K4E,K55,K66, KF0,KEC,KFD, K77,KCA,K7C,K7B, \ - K0D,K15,K1D,K24,K2D,K2C,K35,K3C,K43,K44,K4D,K54,K5B,K5D, KF1,KE9,KFA, K6C,K75,K7D, \ - K58,K1C,K1B,K23,K2B,K34,K33,K3B,K42,K4B,K4C,K52, K5A, K6B,K73,K74,K79, \ - K12,K1A,K22,K21,K2A,K32,K31,K3A,K41,K49,K4A, K59, KF5, K69,K72,K7A, \ - K14,K9F,K11, K29, K91,KA7,KAF,K94, KEB,KF2,KF4, K70, K71,KDA, \ - \ - NUBS, \ - K51, K13, K6A, K64, K67, \ - F13, F14, F15, F16, F17, F18, F19, F20, F21, F22, F23, F24, \ - SYSTEM_POWER, SYSTEM_SLEEP, SYSTEM_WAKE, \ - AUDIO_MUTE, AUDIO_VOL_UP, AUDIO_VOL_DOWN, \ - MEDIA_NEXT_TRACK, MEDIA_PREV_TRACK, MEDIA_STOP, MEDIA_PLAY_PAUSE, MEDIA_SELECT, \ - MAIL, CALCULATOR, MY_COMPUTER, \ - WWW_SEARCH, WWW_HOME, WWW_BACK, WWW_FORWARD, \ - WWW_STOP, WWW_REFRESH, WWW_FAVORITES \ -) - -#endif diff --git a/converter/ps2_usb/keymap_jis.c b/converter/ps2_usb/keymap_jis.c deleted file mode 100644 index 02585150fbc..00000000000 --- a/converter/ps2_usb/keymap_jis.c +++ /dev/null @@ -1,34 +0,0 @@ -/* - * JIS layout Japanese keyboard - */ -#include "keymap_common.h" - -const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - /* 0: JIS LAYOUT - * ,---. ,---------------. ,---------------. ,---------------. ,-----------. ,-----------. - * |Esc| |F1 |F2 |F3 |F4 | |F5 |F6 |F7 |F8 | |F9 |F10|F11|F12| |PrS|ScL|Pau| |Pwr|Slp|Wak| - * `---' `---------------' `---------------' `---------------' `-----------' `-----------' - * ,-----------------------------------------------------------. ,-----------. ,---------------. - * | `| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =| JY|Bsp| |Ins|Hom|PgU| |NmL| /| *| -| - * |-----------------------------------------------------------| |-----------| |---------------| - * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| Ret | |Del|End|PgD| | 7| 8| 9| | - * |------------------------------------------------------` | `-----------' |-----------| +| - * |CapsLo| A| S| D| F| G| H| J| K| L| ;| :| \| | | 4| 5| 6| | - * |-----------------------------------------------------------| ,---. |---------------| - * |Shift | Z| X| C| V| B| N| M| ,| ,| /| RO|Shift | |Up | | 1| 2| 3| | - * |-----------------------------------------------------------| ,-----------. |-----------|Ent| - * |Ctrl |Gui |Alt |MHEN| Space |HENK|KANA|Alt |Gui |Menu|Ctrl| |Lef|Dow|Rig| | 0| .| | - * `-----------------------------------------------------------' `-----------' `---------------' - */ - KEYMAP_JIS( - ESC, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, PSCR,SLCK,BRK, - GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, JYEN,BSPC, INS, HOME,PGUP, NLCK,PSLS,PAST,PMNS, - TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC,RBRC, DEL, END, PGDN, P7, P8, P9, - CAPS,A, S, D, F, G, H, J, K, L, SCLN,QUOT,BSLS, ENT, P4, P5, P6, PPLS, - LSFT,Z, X, C, V, B, N, M, COMM,DOT, SLSH,RO, RSFT, UP, P1, P2, P3, - LCTL,LGUI,LALT, MHEN,SPC, HENK,KANA, RALT,RGUI,APP, RCTL, LEFT,DOWN,RGHT, P0, PDOT,PENT - ), -}; - -const uint16_t PROGMEM fn_actions[] = { -}; diff --git a/converter/ps2_usb/keymap_plain.c b/converter/ps2_usb/keymap_plain.c deleted file mode 100644 index 51b2fddb5b2..00000000000 --- a/converter/ps2_usb/keymap_plain.c +++ /dev/null @@ -1,32 +0,0 @@ -#include "keymap_common.h" - - -const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - /* 0: default - * ,---. ,---------------. ,---------------. ,---------------. ,-----------. ,-----------. - * |Esc| |F1 |F2 |F3 |F4 | |F5 |F6 |F7 |F8 | |F9 |F10|F11|F12| |PrS|ScL|Pau| |Pwr|Slp|Wak| - * `---' `---------------' `---------------' `---------------' `-----------' `-----------' - * ,-----------------------------------------------------------. ,-----------. ,---------------. - * | `| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Backspa| |Ins|Hom|PgU| |NmL| /| *| -| - * |-----------------------------------------------------------| |-----------| |---------------| - * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \| |Del|End|PgD| | 7| 8| 9| | - * |-----------------------------------------------------------| `-----------' |-----------| +| - * |CapsLo| A| S| D| F| G| H| J| K| L| ;| '|Return | | 4| 5| 6| | - * |-----------------------------------------------------------| ,---. |---------------| - * |Shift | Z| X| C| V| B| N| M| ,| ,| /|Shift | |Up | | 1| 2| 3| | - * |-----------------------------------------------------------| ,-----------. |-----------|Ent| - * |Ctrl |Gui |Alt | Space |Alt |Gui |Menu|Ctrl| |Lef|Dow|Rig| | 0| .| | - * `-----------------------------------------------------------' `-----------' `---------------' - */ - KEYMAP( - ESC, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, PSCR,SLCK,BRK, - GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, BSPC, INS, HOME,PGUP, NLCK,PSLS,PAST,PMNS, - TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC,RBRC,BSLS, DEL, END, PGDN, P7, P8, P9, - CAPS,A, S, D, F, G, H, J, K, L, SCLN,QUOT, ENT, P4, P5, P6, PPLS, - LSFT,Z, X, C, V, B, N, M, COMM,DOT, SLSH, RSFT, UP, P1, P2, P3, - LCTL,LGUI,LALT, SPC, RALT,RGUI,APP, RCTL, LEFT,DOWN,RGHT, P0, PDOT,PENT - ), -}; - -const uint16_t PROGMEM fn_actions[] = { -}; diff --git a/converter/ps2_usb/keymap_spacefn.c b/converter/ps2_usb/keymap_spacefn.c deleted file mode 100644 index bffd2bc606f..00000000000 --- a/converter/ps2_usb/keymap_spacefn.c +++ /dev/null @@ -1,61 +0,0 @@ -/* - * SpaceFN layout - * http://geekhack.org/index.php?topic=51069.0 - */ -#include "keymap_common.h" - - -const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - /* 0: default - * ,---. ,---------------. ,---------------. ,---------------. ,-----------. ,-----------. - * |Esc| |F1 |F2 |F3 |F4 | |F5 |F6 |F7 |F8 | |F9 |F10|F11|F12| |PrS|ScL|Pau| |Pwr|Slp|Wak| - * `---' `---------------' `---------------' `---------------' `-----------' `-----------' - * ,-----------------------------------------------------------. ,-----------. ,---------------. - * | `| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Backspa| |Ins|Hom|PgU| |NmL| /| *| -| - * |-----------------------------------------------------------| |-----------| |---------------| - * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \| |Del|End|PgD| | 7| 8| 9| | - * |-----------------------------------------------------------| `-----------' |-----------| +| - * |CapsLo| A| S| D| F| G| H| J| K| L| ;| '|Return | | 4| 5| 6| | - * |-----------------------------------------------------------| ,---. |---------------| - * |Shift | Z| X| C| V| B| N| M| ,| ,| /|Shift | |Up | | 1| 2| 3| | - * |-----------------------------------------------------------| ,-----------. |-----------|Ent| - * |Ctrl |Gui |Alt | Space |Alt |Gui |Menu|Ctrl| |Lef|Dow|Rig| | 0| .| | - * `-----------------------------------------------------------' `-----------' `---------------' - */ - KEYMAP( - ESC, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, PSCR,SLCK,BRK, - ESC, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, BSPC, INS, HOME,PGUP, NLCK,PSLS,PAST,PMNS, - TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC,RBRC,BSLS, DEL, END, PGDN, P7, P8, P9, - CAPS,A, S, D, F, G, H, J, K, L, SCLN,QUOT, ENT, P4, P5, P6, PPLS, - LSFT,Z, X, C, V, B, N, M, COMM,DOT, SLSH, RSFT, UP, P1, P2, P3, - LCTL,LGUI,LALT, FN0, RALT,RGUI,APP, RCTL, LEFT,DOWN,RGHT, P0, PDOT,PENT - ), - - /* 1: SpaceFN - * ,-----------------------------------------------------------. - * |` | F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12|Delete | - * |-----------------------------------------------------------| - * | | | |Esc| | | |Hom|Up |End|Psc|Slk|Pau|Ins | - * |-----------------------------------------------------------| - * | | | | | | |PgU|Lef|Dow|Rig| | | | - * |-----------------------------------------------------------| - * | | | | | |Spc|PgD|` |~ | |Men| | - * |-----------------------------------------------------------| - * | | | | | | | | | - * `-----------------------------------------------------------' - */ - KEYMAP( - ESC, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, PSCR,SLCK,BRK, - GRV, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, DEL, INS, HOME,PGUP, NLCK,PSLS,PAST,PMNS, - TRNS,TRNS,TRNS,ESC, TRNS,TRNS,TRNS,HOME,UP, END, PSCR,SLCK,PAUS,INS, DEL, END, PGDN, P7, P8, P9, - TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,PGUP,LEFT,DOWN,RGHT,TRNS,TRNS, TRNS, P4, P5, P6, PPLS, - TRNS,TRNS,TRNS,TRNS,TRNS,SPC, PGDN,GRV, FN1, TRNS,APP, TRNS, UP, P1, P2, P3, - TRNS,TRNS,TRNS, TRNS, TRNS,TRNS,TRNS,TRNS, LEFT,DOWN,RGHT, P0, PDOT,PENT - ), -}; - -const uint16_t PROGMEM fn_actions[] = { - [0] = ACTION_LAYER_TAP_KEY(1, KC_SPACE), - [1] = ACTION_MODS_KEY(MOD_LSFT, KC_GRV), // tilde -}; - diff --git a/converter/ps2_usb/led.c b/converter/ps2_usb/led.c deleted file mode 100644 index e448e84ec73..00000000000 --- a/converter/ps2_usb/led.c +++ /dev/null @@ -1,33 +0,0 @@ -/* -Copyright 2011 Jun Wako - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#include "stdint.h" -#include "ps2.h" -#include "led.h" - - -void led_set(uint8_t usb_led) -{ - uint8_t ps2_led = 0; - if (usb_led & (1< - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#include -#include -#include "action.h" -#include "print.h" -#include "util.h" -#include "debug.h" -#include "ps2.h" -#include "matrix.h" - - -static void matrix_make(uint8_t code); -static void matrix_break(uint8_t code); -static void matrix_clear(void); -#ifdef MATRIX_HAS_GHOST -static bool matrix_has_ghost_in_row(uint8_t row); -#endif - - -/* - * Matrix Array usage: - * 'Scan Code Set 2' is assigned into 256(32x8)cell matrix. - * Hmm, it is very sparse and not efficient :( - * - * Notes: - * Both 'Hanguel/English'(F1) and 'Hanja'(F2) collide with 'Delete'(E0 71) and 'Down'(E0 72). - * These two Korean keys need exceptional handling and are not supported for now. Sorry. - * - * 8bit wide - * +---------+ - * 0| | - * :| XX | 00-7F for normal codes(without E0-prefix) - * f|_________| - * 10| | - * :| E0 YY | 80-FF for E0-prefixed codes - * 1f| | (|0x80) is used as matrix position. - * +---------+ - * - * Exceptions: - * 0x83: F7(0x83) This is a normal code but beyond 0x7F. - * 0xFC: PrintScreen - * 0xFE: Pause - */ -static uint8_t matrix[MATRIX_ROWS]; -#define ROW(code) (code>>3) -#define COL(code) (code&0x07) - -// matrix positions for exceptional keys -#define F7 (0x83) -#define PRINT_SCREEN (0xFC) -#define PAUSE (0xFE) - -static bool is_modified = false; - - -inline -uint8_t matrix_rows(void) -{ - return MATRIX_ROWS; -} - -inline -uint8_t matrix_cols(void) -{ - return MATRIX_COLS; -} - -void matrix_init(void) -{ - debug_enable = true; - ps2_host_init(); - - // initialize matrix state: all keys off - for (uint8_t i=0; i < MATRIX_ROWS; i++) matrix[i] = 0x00; - - return; -} - -/* - * PS/2 Scan Code Set 2: Exceptional Handling - * - * There are several keys to be handled exceptionally. - * The scan code for these keys are varied or prefix/postfix'd - * depending on modifier key state. - * - * Keyboard Scan Code Specification: - * http://www.microsoft.com/whdc/archive/scancode.mspx - * http://download.microsoft.com/download/1/6/1/161ba512-40e2-4cc9-843a-923143f3456c/scancode.doc - * - * - * 1) Insert, Delete, Home, End, PageUp, PageDown, Up, Down, Right, Left - * a) when Num Lock is off - * modifiers | make | break - * ----------+---------------------------+---------------------- - * Ohter | | - * LShift | E0 F0 12 | E0 12 - * RShift | E0 F0 59 | E0 59 - * L+RShift | E0 F0 12 E0 F0 59 | E0 59 E0 12 - * - * b) when Num Lock is on - * modifiers | make | break - * ----------+---------------------------+---------------------- - * Other | E0 12 | E0 F0 12 - * Shift'd | | - * - * Handling: These prefix/postfix codes are ignored. - * - * - * 2) Keypad / - * modifiers | make | break - * ----------+---------------------------+---------------------- - * Ohter | | - * LShift | E0 F0 12 | E0 12 - * RShift | E0 F0 59 | E0 59 - * L+RShift | E0 F0 12 E0 F0 59 | E0 59 E0 12 - * - * Handling: These prefix/postfix codes are ignored. - * - * - * 3) PrintScreen - * modifiers | make | break - * ----------+--------------+----------------------------------- - * Other | E0 12 E0 7C | E0 F0 7C E0 F0 12 - * Shift'd | E0 7C | E0 F0 7C - * Control'd | E0 7C | E0 F0 7C - * Alt'd | 84 | F0 84 - * - * Handling: These prefix/postfix codes are ignored, and both scan codes - * 'E0 7C' and 84 are seen as PrintScreen. - * - * 4) Pause - * modifiers | make(no break code) - * ----------+-------------------------------------------------- - * Other | E1 14 77 E1 F0 14 F0 77 - * Control'd | E0 7E E0 F0 7E - * - * Handling: Both code sequences are treated as a whole. - * And we need a ad hoc 'pseudo break code' hack to get the key off - * because it has no break code. - * - */ -uint8_t matrix_scan(void) -{ - - // scan code reading states - static enum { - INIT, - F0, - E0, - E0_F0, - // Pause - E1, - E1_14, - E1_14_77, - E1_14_77_E1, - E1_14_77_E1_F0, - E1_14_77_E1_F0_14, - E1_14_77_E1_F0_14_F0, - // Control'd Pause - E0_7E, - E0_7E_E0, - E0_7E_E0_F0, - } state = INIT; - - - is_modified = false; - - // 'pseudo break code' hack - if (matrix_is_on(ROW(PAUSE), COL(PAUSE))) { - matrix_break(PAUSE); - } - - uint8_t code = ps2_host_recv(); - if (code) xprintf("%i\r\n", code); - if (!ps2_error) { - switch (state) { - case INIT: - switch (code) { - case 0xE0: - state = E0; - break; - case 0xF0: - state = F0; - break; - case 0xE1: - state = E1; - break; - case 0x83: // F7 - matrix_make(F7); - state = INIT; - break; - case 0x84: // Alt'd PrintScreen - matrix_make(PRINT_SCREEN); - state = INIT; - break; - case 0x00: // Overrun [3]p.25 - matrix_clear(); - clear_keyboard(); - print("Overrun\n"); - state = INIT; - break; - default: // normal key make - if (code < 0x80) { - matrix_make(code); - } else { - matrix_clear(); - clear_keyboard(); - xprintf("unexpected scan code at INIT: %02X\n", code); - } - state = INIT; - } - break; - case E0: // E0-Prefixed - switch (code) { - case 0x12: // to be ignored - case 0x59: // to be ignored - state = INIT; - break; - case 0x7E: // Control'd Pause - state = E0_7E; - break; - case 0xF0: - state = E0_F0; - break; - default: - if (code < 0x80) { - matrix_make(code|0x80); - } else { - matrix_clear(); - clear_keyboard(); - xprintf("unexpected scan code at E0: %02X\n", code); - } - state = INIT; - } - break; - case F0: // Break code - switch (code) { - case 0x83: // F7 - matrix_break(F7); - state = INIT; - break; - case 0x84: // Alt'd PrintScreen - matrix_break(PRINT_SCREEN); - state = INIT; - break; - case 0xF0: - matrix_clear(); - clear_keyboard(); - xprintf("unexpected scan code at F0: F0(clear and cont.)\n"); - break; - default: - if (code < 0x80) { - matrix_break(code); - } else { - matrix_clear(); - clear_keyboard(); - xprintf("unexpected scan code at F0: %02X\n", code); - } - state = INIT; - } - break; - case E0_F0: // Break code of E0-prefixed - switch (code) { - case 0x12: // to be ignored - case 0x59: // to be ignored - state = INIT; - break; - default: - if (code < 0x80) { - matrix_break(code|0x80); - } else { - matrix_clear(); - clear_keyboard(); - xprintf("unexpected scan code at E0_F0: %02X\n", code); - } - state = INIT; - } - break; - // following are states of Pause - case E1: - switch (code) { - case 0x14: - state = E1_14; - break; - default: - state = INIT; - } - break; - case E1_14: - switch (code) { - case 0x77: - state = E1_14_77; - break; - default: - state = INIT; - } - break; - case E1_14_77: - switch (code) { - case 0xE1: - state = E1_14_77_E1; - break; - default: - state = INIT; - } - break; - case E1_14_77_E1: - switch (code) { - case 0xF0: - state = E1_14_77_E1_F0; - break; - default: - state = INIT; - } - break; - case E1_14_77_E1_F0: - switch (code) { - case 0x14: - state = E1_14_77_E1_F0_14; - break; - default: - state = INIT; - } - break; - case E1_14_77_E1_F0_14: - switch (code) { - case 0xF0: - state = E1_14_77_E1_F0_14_F0; - break; - default: - state = INIT; - } - break; - case E1_14_77_E1_F0_14_F0: - switch (code) { - case 0x77: - matrix_make(PAUSE); - state = INIT; - break; - default: - state = INIT; - } - break; - // Following are states of Control'd Pause - case E0_7E: - if (code == 0xE0) - state = E0_7E_E0; - else - state = INIT; - break; - case E0_7E_E0: - if (code == 0xF0) - state = E0_7E_E0_F0; - else - state = INIT; - break; - case E0_7E_E0_F0: - if (code == 0x7E) - matrix_make(PAUSE); - state = INIT; - break; - default: - state = INIT; - } - } - - // TODO: request RESEND when error occurs? -/* - if (PS2_IS_FAILED(ps2_error)) { - uint8_t ret = ps2_host_send(PS2_RESEND); - xprintf("Resend: %02X\n", ret); - } -*/ - return 1; -} - -bool matrix_is_modified(void) -{ - return is_modified; -} - -inline -bool matrix_has_ghost(void) -{ -#ifdef MATRIX_HAS_GHOST - for (uint8_t i = 0; i < MATRIX_ROWS; i++) { - if (matrix_has_ghost_in_row(i)) - return true; - } -#endif - return false; -} - -inline -bool matrix_is_on(uint8_t row, uint8_t col) -{ - return (matrix[row] & (1<> 8) & 0xFF) -/* USB vendor ID for the device, low byte first. If you have registered your - * own Vendor ID, define it here. Otherwise you may use one of obdev's free - * shared VID/PID pairs. Be sure to read USB-IDs-for-free.txt for rules! - * *** IMPORTANT NOTE *** - * This template uses obdev's shared VID/PID pair for Vendor Class devices - * with libusb: 0x16c0/0x5dc. Use this VID/PID pair ONLY if you understand - * the implications! - */ -#define USB_CFG_DEVICE_ID (PRODUCT_ID & 0xFF), ((PRODUCT_ID >> 8) & 0xFF) -/* This is the ID of the product, low byte first. It is interpreted in the - * scope of the vendor ID. If you have registered your own VID with usb.org - * or if you have licensed a PID from somebody else, define it here. Otherwise - * you may use one of obdev's free shared VID/PID pairs. See the file - * USB-IDs-for-free.txt for details! - * *** IMPORTANT NOTE *** - * This template uses obdev's shared VID/PID pair for Vendor Class devices - * with libusb: 0x16c0/0x5dc. Use this VID/PID pair ONLY if you understand - * the implications! - */ -#define USB_CFG_DEVICE_VERSION 0x00, 0x01 -/* Version number of the device: Minor number first, then major number. - */ -#define USB_CFG_VENDOR_NAME 't', '.', 'm', '.', 'k', '.' -#define USB_CFG_VENDOR_NAME_LEN 6 -/* These two values define the vendor name returned by the USB device. The name - * must be given as a list of characters under single quotes. The characters - * are interpreted as Unicode (UTF-16) entities. - * If you don't want a vendor name string, undefine these macros. - * ALWAYS define a vendor name containing your Internet domain name if you use - * obdev's free shared VID/PID pair. See the file USB-IDs-for-free.txt for - * details. - */ -#define USB_CFG_DEVICE_NAME 'P', 'S', '/', '2', ' ', 'k', 'e', 'y', 'b', 'o', 'a', 'r', 'd', ' ', 'c', 'o', 'n', 'v', 'e', 'r', 't', 'e', 'r' -#define USB_CFG_DEVICE_NAME_LEN 23 -/* Same as above for the device name. If you don't want a device name, undefine - * the macros. See the file USB-IDs-for-free.txt before you assign a name if - * you use a shared VID/PID. - */ -/*#define USB_CFG_SERIAL_NUMBER 'N', 'o', 'n', 'e' */ -/*#define USB_CFG_SERIAL_NUMBER_LEN 0 */ -/* Same as above for the serial number. If you don't want a serial number, - * undefine the macros. - * It may be useful to provide the serial number through other means than at - * compile time. See the section about descriptor properties below for how - * to fine tune control over USB descriptors such as the string descriptor - * for the serial number. - */ -#define USB_CFG_DEVICE_CLASS 0 -#define USB_CFG_DEVICE_SUBCLASS 0 -/* See USB specification if you want to conform to an existing device class. - * Class 0xff is "vendor specific". - */ -#define USB_CFG_INTERFACE_CLASS 3 /* HID */ -#define USB_CFG_INTERFACE_SUBCLASS 1 /* Boot */ -#define USB_CFG_INTERFACE_PROTOCOL 1 /* Keyboard */ -/* See USB specification if you want to conform to an existing device class or - * protocol. The following classes must be set at interface level: - * HID class is 3, no subclass and protocol required (but may be useful!) - * CDC class is 2, use subclass 2 and protocol 1 for ACM - */ -#define USB_CFG_HID_REPORT_DESCRIPTOR_LENGTH 0 -/* Define this to the length of the HID report descriptor, if you implement - * an HID device. Otherwise don't define it or define it to 0. - * If you use this define, you must add a PROGMEM character array named - * "usbHidReportDescriptor" to your code which contains the report descriptor. - * Don't forget to keep the array and this define in sync! - */ - -/* #define USB_PUBLIC static */ -/* Use the define above if you #include usbdrv.c instead of linking against it. - * This technique saves a couple of bytes in flash memory. - */ - -/* ------------------- Fine Control over USB Descriptors ------------------- */ -/* If you don't want to use the driver's default USB descriptors, you can - * provide our own. These can be provided as (1) fixed length static data in - * flash memory, (2) fixed length static data in RAM or (3) dynamically at - * runtime in the function usbFunctionDescriptor(). See usbdrv.h for more - * information about this function. - * Descriptor handling is configured through the descriptor's properties. If - * no properties are defined or if they are 0, the default descriptor is used. - * Possible properties are: - * + USB_PROP_IS_DYNAMIC: The data for the descriptor should be fetched - * at runtime via usbFunctionDescriptor(). If the usbMsgPtr mechanism is - * used, the data is in FLASH by default. Add property USB_PROP_IS_RAM if - * you want RAM pointers. - * + USB_PROP_IS_RAM: The data returned by usbFunctionDescriptor() or found - * in static memory is in RAM, not in flash memory. - * + USB_PROP_LENGTH(len): If the data is in static memory (RAM or flash), - * the driver must know the descriptor's length. The descriptor itself is - * found at the address of a well known identifier (see below). - * List of static descriptor names (must be declared PROGMEM if in flash): - * char usbDescriptorDevice[]; - * char usbDescriptorConfiguration[]; - * char usbDescriptorHidReport[]; - * char usbDescriptorString0[]; - * int usbDescriptorStringVendor[]; - * int usbDescriptorStringDevice[]; - * int usbDescriptorStringSerialNumber[]; - * Other descriptors can't be provided statically, they must be provided - * dynamically at runtime. - * - * Descriptor properties are or-ed or added together, e.g.: - * #define USB_CFG_DESCR_PROPS_DEVICE (USB_PROP_IS_RAM | USB_PROP_LENGTH(18)) - * - * The following descriptors are defined: - * USB_CFG_DESCR_PROPS_DEVICE - * USB_CFG_DESCR_PROPS_CONFIGURATION - * USB_CFG_DESCR_PROPS_STRINGS - * USB_CFG_DESCR_PROPS_STRING_0 - * USB_CFG_DESCR_PROPS_STRING_VENDOR - * USB_CFG_DESCR_PROPS_STRING_PRODUCT - * USB_CFG_DESCR_PROPS_STRING_SERIAL_NUMBER - * USB_CFG_DESCR_PROPS_HID - * USB_CFG_DESCR_PROPS_HID_REPORT - * USB_CFG_DESCR_PROPS_UNKNOWN (for all descriptors not handled by the driver) - * - * Note about string descriptors: String descriptors are not just strings, they - * are Unicode strings prefixed with a 2 byte header. Example: - * int serialNumberDescriptor[] = { - * USB_STRING_DESCRIPTOR_HEADER(6), - * 'S', 'e', 'r', 'i', 'a', 'l' - * }; - */ - -#define USB_CFG_DESCR_PROPS_DEVICE 0 -#define USB_CFG_DESCR_PROPS_CONFIGURATION USB_PROP_IS_DYNAMIC -//#define USB_CFG_DESCR_PROPS_CONFIGURATION 0 -#define USB_CFG_DESCR_PROPS_STRINGS 0 -#define USB_CFG_DESCR_PROPS_STRING_0 0 -#define USB_CFG_DESCR_PROPS_STRING_VENDOR 0 -#define USB_CFG_DESCR_PROPS_STRING_PRODUCT 0 -#define USB_CFG_DESCR_PROPS_STRING_SERIAL_NUMBER 0 -//#define USB_CFG_DESCR_PROPS_HID USB_PROP_IS_DYNAMIC -#define USB_CFG_DESCR_PROPS_HID 0 -#define USB_CFG_DESCR_PROPS_HID_REPORT USB_PROP_IS_DYNAMIC -//#define USB_CFG_DESCR_PROPS_HID_REPORT 0 -#define USB_CFG_DESCR_PROPS_UNKNOWN 0 - -/* ----------------------- Optional MCU Description ------------------------ */ - -/* The following configurations have working defaults in usbdrv.h. You - * usually don't need to set them explicitly. Only if you want to run - * the driver on a device which is not yet supported or with a compiler - * which is not fully supported (such as IAR C) or if you use a differnt - * interrupt than INT0, you may have to define some of these. - */ -/* #define USB_INTR_CFG MCUCR */ -/* #define USB_INTR_CFG_SET ((1 << ISC00) | (1 << ISC01)) */ -/* #define USB_INTR_CFG_CLR 0 */ -/* #define USB_INTR_ENABLE GIMSK */ -/* #define USB_INTR_ENABLE_BIT INT0 */ -/* #define USB_INTR_PENDING GIFR */ -/* #define USB_INTR_PENDING_BIT INTF0 */ -/* #define USB_INTR_VECTOR INT0_vect */ - -#endif /* __usbconfig_h_included__ */ diff --git a/converter/serialmouse_usb/Makefile b/converter/serialmouse_usb/Makefile deleted file mode 100644 index 34f550b3146..00000000000 --- a/converter/serialmouse_usb/Makefile +++ /dev/null @@ -1,106 +0,0 @@ -# -# Makefile for Teensy -# -# Target file name (without extension). -TARGET = serialmouse_usb - -# Directory common source filess exist -TMK_DIR = ../../tmk_core - -# Directory keyboard dependent files exist -TARGET_DIR = . - -# project specific files -SRC = keymap.c \ - matrix.c \ - led.c - -CONFIG_H = config.h - - -# MCU name -#MCU = at90usb1287 -MCU = atmega32u4 - -# Processor frequency. -# This will define a symbol, F_CPU, in all source code files equal to the -# processor frequency in Hz. You can then use this symbol in your source code to -# calculate timings. Do NOT tack on a 'UL' at the end, this will be done -# automatically to create a 32-bit value in your source code. -# -# This will be an integer division of F_USB below, as it is sourced by -# F_USB after it has run through any CPU prescalers. Note that this value -# does not *change* the processor frequency - it should merely be updated to -# reflect the processor speed set externally so that the code can use accurate -# software delays. -F_CPU = 16000000 - - -# -# LUFA specific -# -# Target architecture (see library "Board Types" documentation). -ARCH = AVR8 - -# Input clock frequency. -# This will define a symbol, F_USB, in all source code files equal to the -# input clock frequency (before any prescaling is performed) in Hz. This value may -# differ from F_CPU if prescaling is used on the latter, and is required as the -# raw input clock is fed directly to the PLL sections of the AVR for high speed -# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' -# at the end, this will be done automatically to create a 32-bit value in your -# source code. -# -# If no clock division is performed on the input clock inside the AVR (via the -# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. -F_USB = $(F_CPU) - -# Interrupt driven control endpoint task(+60) -#OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT - - -# Boot Section Size in *bytes* -# Teensy halfKay 512 -# Teensy++ halfKay 1024 -# Atmel DFU loader 4096 -# LUFA bootloader 4096 -# USBaspLoader 2048 -OPT_DEFS += -DBOOTLOADER_SIZE=512 - - -# Build Options -# comment out to disable the options. -# -#BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000) -#MOUSEKEY_ENABLE = yes # Mouse keys(+4700) -#EXTRAKEY_ENABLE = yes # Audio control and System control(+450) -CONSOLE_ENABLE = yes # Console for debug(+400) -#COMMAND_ENABLE = yes # Commands for debug and configuration -#NKRO_ENABLE = yes # USB Nkey Rollover - not yet supported in LUFA - - -# Serial Mouse Options -# You can choose a mouse protocol and the implementation of -# the underlying serial connection. -# -SERIAL_MOUSE_MICROSOFT_ENABLE = yes # Enable support for Microsoft-compatible mice -#SERIAL_MOUSE_MOUSESYSTEMS_ENABLE = yes # Enable support for Mousesystems-compatible mice -#SERIAL_MOUSE_USE_UART = yes # use hardware UART for serial connection -SERIAL_MOUSE_USE_SOFT = yes # use software serial implementation - -# Optional serial mouse driver features -# Support scrolling while holding the middle mouse button -# (currently only supported for Mousesystems mice): -#OPT_DEFS += -DSERIAL_MOUSE_CENTER_SCROLL - -# Optimize size but this may cause error "relocation truncated to fit" -#EXTRALDFLAGS = -Wl,--relax - -# Search Path -VPATH += $(TARGET_DIR) -VPATH += $(TMK_DIR) - -include $(TMK_DIR)/protocol.mk -include $(TMK_DIR)/protocol/lufa.mk -include $(TMK_DIR)/common.mk -include $(TMK_DIR)/rules.mk diff --git a/converter/serialmouse_usb/README.md b/converter/serialmouse_usb/README.md deleted file mode 100644 index ef8a006716e..00000000000 --- a/converter/serialmouse_usb/README.md +++ /dev/null @@ -1,11 +0,0 @@ -Serial mouse converter -====================== -See https://github.com/tmk/tmk_keyboard/pull/131 - - -Supported protocols -------------------- -### Microsoft -Not tested. - -### Mousesystems diff --git a/converter/serialmouse_usb/config.h b/converter/serialmouse_usb/config.h deleted file mode 100644 index b257d997cfa..00000000000 --- a/converter/serialmouse_usb/config.h +++ /dev/null @@ -1,119 +0,0 @@ -/* -Copyright 2012 Jun Wako - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#ifndef CONFIG_H -#define CONFIG_H - -#include - -#define VENDOR_ID 0xFEED -#define PRODUCT_ID 0x2222 -#define DEVICE_VER 0x0001 -#define MANUFACTURER t.m.k. -#define PRODUCT serial mouse converter -#define DESCRIPTION convert serial mouse into USB - - -/* matrix size */ -#define MATRIX_ROWS 0 -#define MATRIX_COLS 0 - - -/* key combination for command */ -#define IS_COMMAND() false - - - -#ifdef SERIAL_MOUSE_MICROSOFT - /* - * Serial(USART) configuration (for Microsoft serial mice) - * asynchronous, positive logic, 1200baud, bit order: LSB first - * 1-start bit, 7-data bit, no parity, 1-stop bit - */ - #define SERIAL_UART_BAUD 1200 - #define SERIAL_UART_DATA UDR1 - #define SERIAL_UART_UBRR ((F_CPU/(16UL*SERIAL_UART_BAUD))-1) - #define SERIAL_UART_RXD_VECT USART1_RX_vect - #define SERIAL_UART_TXD_READY (UCSR1A&(1<>8); /* baud rate */ \ - UCSR1B |= (1<>8); /* baud rate */ \ - UCSR1B |= (1< - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ -#include -#include -#include "keymap.h" - - -/* translates key to keycode */ -uint8_t keymap_key_to_keycode(uint8_t layer, keypos_t key) -{ - return KC_NO; -} - -/* translates Fn keycode to action */ -action_t keymap_fn_to_action(uint8_t keycode) -{ - return (action_t){}; -} - diff --git a/converter/serialmouse_usb/keymap_common.c b/converter/serialmouse_usb/keymap_common.c deleted file mode 100644 index 55a13793cbb..00000000000 --- a/converter/serialmouse_usb/keymap_common.c +++ /dev/null @@ -1,30 +0,0 @@ -/* -Copyright 2011,2012,2013 Jun Wako - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ -#include "keymap_common.h" - - -/* translates key to keycode */ -uint8_t keymap_key_to_keycode(uint8_t layer, keypos_t key) -{ - return pgm_read_byte(&keymaps[(layer)][(key.row)][(key.col)]); -} - -/* translates Fn keycode to action */ -action_t keymap_fn_to_action(uint8_t keycode) -{ - return (action_t){ .code = pgm_read_word(&fn_actions[FN_INDEX(keycode)]) }; -} diff --git a/converter/serialmouse_usb/keymap_common.h b/converter/serialmouse_usb/keymap_common.h deleted file mode 100644 index 216a8dc020c..00000000000 --- a/converter/serialmouse_usb/keymap_common.h +++ /dev/null @@ -1,174 +0,0 @@ -/* -Copyright 2011,2012,2013 Jun Wako - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ -#ifndef KEYMAP_COMMON_H -#define KEYMAP_COMMON_H - -#include -#include -#include -#include "keycode.h" -#include "action.h" -#include "action_macro.h" -#include "report.h" -#include "print.h" -#include "debug.h" -#include "keymap.h" - - -// 32*8(256) byte array which converts PS/2 code into USB code -extern const uint8_t keymaps[][MATRIX_ROWS][MATRIX_COLS]; -extern const uint16_t fn_actions[]; - - -/* All keys */ -#define KEYMAP_ALL( \ - K76,K05,K06,K04,K0C,K03,K0B,K83,K0A,K01,K09,K78,K07, KFC,K7E,KFE, \ - K0E,K16,K1E,K26,K25,K2E,K36,K3D,K3E,K46,K45,K4E,K55,K66, KF0,KEC,KFD, K77,KCA,K7C,K7B, \ - K0D,K15,K1D,K24,K2D,K2C,K35,K3C,K43,K44,K4D,K54,K5B,K5D, KF1,KE9,KFA, K6C,K75,K7D, \ - K58,K1C,K1B,K23,K2B,K34,K33,K3B,K42,K4B,K4C,K52, K5A, K6B,K73,K74,K79, \ - K12,K1A,K22,K21,K2A,K32,K31,K3A,K41,K49,K4A, K59, KF5, K69,K72,K7A, \ - K14,K9F,K11, K29, K91,KA7,KAF,K94, KEB,KF2,KF4, K70, K71,KDA, \ - \ - K61, /* for European ISO */ \ - K51, K13, K6A, K64, K67, /* for Japanese JIS */ \ - K08, K10, K18, K20, K28, K30, K38, K40, K48, K50, K57, K5F, /* F13-24 */ \ - KB7, KBF, KDE, /* System Power, Sleep, Wake */ \ - KA3, KB2, KA1, /* Mute, Volume Up, Volume Down */ \ - KCD, K95, KBB, KB4, KD0, /* Next, Previous, Stop, Pause, Media Select */ \ - KC8, KAB, KC0, /* Mail, Calculator, My Computer */ \ - K90, KBA, KB8, KB0, /* WWW Search, Home, Back, Forward */ \ - KA8, KA0, K98 /* WWW Stop, Refresh, Favorites */ \ -) { \ - { KC_NO, KC_##K01, KC_NO, KC_##K03, KC_##K04, KC_##K05, KC_##K06, KC_##K07 }, \ - { KC_##K08, KC_##K09, KC_##K0A, KC_##K0B, KC_##K0C, KC_##K0D, KC_##K0E, KC_NO }, \ - { KC_##K10, KC_##K11, KC_##K12, KC_##K13, KC_##K14, KC_##K15, KC_##K16, KC_NO }, \ - { KC_##K18, KC_NO, KC_##K1A, KC_##K1B, KC_##K1C, KC_##K1D, KC_##K1E, KC_NO }, \ - { KC_##K20, KC_##K21, KC_##K22, KC_##K23, KC_##K24, KC_##K25, KC_##K26, KC_NO }, \ - { KC_##K28, KC_##K29, KC_##K2A, KC_##K2B, KC_##K2C, KC_##K2D, KC_##K2E, KC_NO }, \ - { KC_##K30, KC_##K31, KC_##K32, KC_##K33, KC_##K34, KC_##K35, KC_##K36, KC_NO }, \ - { KC_##K38, KC_NO, KC_##K3A, KC_##K3B, KC_##K3C, KC_##K3D, KC_##K3E, KC_NO }, \ - { KC_##K40, KC_##K41, KC_##K42, KC_##K43, KC_##K44, KC_##K45, KC_##K46, KC_NO }, \ - { KC_##K48, KC_##K49, KC_##K4A, KC_##K4B, KC_##K4C, KC_##K4D, KC_##K4E, KC_NO }, \ - { KC_##K50, KC_##K51, KC_##K52, KC_NO, KC_##K54, KC_##K55, KC_NO, KC_##K57 }, \ - { KC_##K58, KC_##K59, KC_##K5A, KC_##K5B, KC_NO, KC_##K5D, KC_NO, KC_##K5F }, \ - { KC_NO, KC_##K61, KC_NO, KC_NO, KC_##K64, KC_NO, KC_##K66, KC_##K67 }, \ - { KC_NO, KC_##K69, KC_##K6A, KC_##K6B, KC_##K6C, KC_NO, KC_NO, KC_NO }, \ - { KC_##K70, KC_##K71, KC_##K72, KC_##K73, KC_##K74, KC_##K75, KC_##K76, KC_##K77 }, \ - { KC_##K78, KC_##K79, KC_##K7A, KC_##K7B, KC_##K7C, KC_##K7D, KC_##K7E, KC_NO }, \ - { KC_NO, KC_NO, KC_NO, KC_##K83, KC_NO, KC_NO, KC_NO, KC_NO }, \ - { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, \ - { KC_##K90, KC_##K91, KC_NO, KC_NO, KC_##K94, KC_##K95, KC_NO, KC_NO }, \ - { KC_##K98, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_##K9F }, \ - { KC_##KA0, KC_##KA1, KC_NO, KC_##KA3, KC_NO, KC_NO, KC_NO, KC_##KA7 }, \ - { KC_##KA8, KC_NO, KC_NO, KC_##KAB, KC_NO, KC_NO, KC_NO, KC_##KAF }, \ - { KC_##KB0, KC_NO, KC_##KB2, KC_NO, KC_##KB4, KC_NO, KC_NO, KC_##KB7 }, \ - { KC_##KB8, KC_NO, KC_##KBA, KC_##KBB, KC_NO, KC_NO, KC_NO, KC_##KBF }, \ - { KC_##KC0, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, \ - { KC_##KC8, KC_NO, KC_##KCA, KC_NO, KC_NO, KC_##KCD, KC_NO, KC_NO }, \ - { KC_##KD0, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, \ - { KC_NO, KC_NO, KC_##KDA, KC_NO, KC_NO, KC_NO, KC_##KDE, KC_NO }, \ - { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, \ - { KC_NO, KC_##KE9, KC_NO, KC_##KEB, KC_##KEC, KC_NO, KC_NO, KC_NO }, \ - { KC_##KF0, KC_##KF1, KC_##KF2, KC_NO, KC_##KF4, KC_##KF5, KC_NO, KC_NO }, \ - { KC_NO, KC_NO, KC_##KFA, KC_NO, KC_##KFC, KC_##KFD, KC_##KFE, KC_NO }, \ -} - -/* US layout */ -#define KEYMAP( \ - K76,K05,K06,K04,K0C,K03,K0B,K83,K0A,K01,K09,K78,K07, KFC,K7E,KFE, \ - K0E,K16,K1E,K26,K25,K2E,K36,K3D,K3E,K46,K45,K4E,K55,K66, KF0,KEC,KFD, K77,KCA,K7C,K7B, \ - K0D,K15,K1D,K24,K2D,K2C,K35,K3C,K43,K44,K4D,K54,K5B,K5D, KF1,KE9,KFA, K6C,K75,K7D, \ - K58,K1C,K1B,K23,K2B,K34,K33,K3B,K42,K4B,K4C,K52, K5A, K6B,K73,K74,K79, \ - K12,K1A,K22,K21,K2A,K32,K31,K3A,K41,K49,K4A, K59, KF5, K69,K72,K7A, \ - K14,K9F,K11, K29, K91,KA7,KAF,K94, KEB,KF2,KF4, K70, K71,KDA \ -) \ -KEYMAP_ALL( \ - K76,K05,K06,K04,K0C,K03,K0B,K83,K0A,K01,K09,K78,K07, KFC,K7E,KFE, \ - K0E,K16,K1E,K26,K25,K2E,K36,K3D,K3E,K46,K45,K4E,K55,K66, KF0,KEC,KFD, K77,KCA,K7C,K7B, \ - K0D,K15,K1D,K24,K2D,K2C,K35,K3C,K43,K44,K4D,K54,K5B,K5D, KF1,KE9,KFA, K6C,K75,K7D, \ - K58,K1C,K1B,K23,K2B,K34,K33,K3B,K42,K4B,K4C,K52, K5A, K6B,K73,K74,K79, \ - K12,K1A,K22,K21,K2A,K32,K31,K3A,K41,K49,K4A, K59, KF5, K69,K72,K7A, \ - K14,K9F,K11, K29, K91,KA7,KAF,K94, KEB,KF2,KF4, K70, K71,KDA, \ - \ - NUBS, \ - RO, KANA, JYEN, HENK, MHEN, \ - F13, F14, F15, F16, F17, F18, F19, F20, F21, F22, F23, F24, \ - SYSTEM_POWER, SYSTEM_SLEEP, SYSTEM_WAKE, \ - AUDIO_MUTE, AUDIO_VOL_UP, AUDIO_VOL_DOWN, \ - MEDIA_NEXT_TRACK, MEDIA_PREV_TRACK, MEDIA_STOP, MEDIA_PLAY_PAUSE, MEDIA_SELECT, \ - MAIL, CALCULATOR, MY_COMPUTER, \ - WWW_SEARCH, WWW_HOME, WWW_BACK, WWW_FORWARD, \ - WWW_STOP, WWW_REFRESH, WWW_FAVORITES \ -) - -/* ISO layout */ -#define KEYMAP_ISO( \ - K76,K05,K06,K04,K0C,K03,K0B,K83,K0A,K01,K09,K78,K07, KFC,K7E,KFE, \ - K0E,K16,K1E,K26,K25,K2E,K36,K3D,K3E,K46,K45,K4E,K55,K66, KF0,KEC,KFD, K77,KCA,K7C,K7B, \ - K0D,K15,K1D,K24,K2D,K2C,K35,K3C,K43,K44,K4D,K54,K5B, KF1,KE9,KFA, K6C,K75,K7D, \ - K58,K1C,K1B,K23,K2B,K34,K33,K3B,K42,K4B,K4C,K52,K5D,K5A, K6B,K73,K74,K79, \ - K12,K61,K1A,K22,K21,K2A,K32,K31,K3A,K41,K49,K4A, K59, KF5, K69,K72,K7A, \ - K14,K9F,K11, K29, K91,KA7,KAF,K94, KEB,KF2,KF4, K70, K71,KDA \ -) \ -KEYMAP_ALL( \ - K76,K05,K06,K04,K0C,K03,K0B,K83,K0A,K01,K09,K78,K07, KFC,K7E,KFE, \ - K0E,K16,K1E,K26,K25,K2E,K36,K3D,K3E,K46,K45,K4E,K55,K66, KF0,KEC,KFD, K77,KCA,K7C,K7B, \ - K0D,K15,K1D,K24,K2D,K2C,K35,K3C,K43,K44,K4D,K54,K5B,K5D, KF1,KE9,KFA, K6C,K75,K7D, \ - K58,K1C,K1B,K23,K2B,K34,K33,K3B,K42,K4B,K4C,K52, K5A, K6B,K73,K74,K79, \ - K12,K1A,K22,K21,K2A,K32,K31,K3A,K41,K49,K4A, K59, KF5, K69,K72,K7A, \ - K14,K9F,K11, K29, K91,KA7,KAF,K94, KEB,KF2,KF4, K70, K71,KDA, \ - \ - K61, \ - RO, KANA, JYEN, HENK, MHEN, \ - F13, F14, F15, F16, F17, F18, F19, F20, F21, F22, F23, F24, \ - SYSTEM_POWER, SYSTEM_SLEEP, SYSTEM_WAKE, \ - AUDIO_MUTE, AUDIO_VOL_UP, AUDIO_VOL_DOWN, \ - MEDIA_NEXT_TRACK, MEDIA_PREV_TRACK, MEDIA_STOP, MEDIA_PLAY_PAUSE, MEDIA_SELECT, \ - MAIL, CALCULATOR, MY_COMPUTER, \ - WWW_SEARCH, WWW_HOME, WWW_BACK, WWW_FORWARD, \ - WWW_STOP, WWW_REFRESH, WWW_FAVORITES \ -) - -/* JIS layout */ -#define KEYMAP_JIS( \ - K76,K05,K06,K04,K0C,K03,K0B,K83,K0A,K01,K09,K78,K07, KFC,K7E,KFE, \ - K0E,K16,K1E,K26,K25,K2E,K36,K3D,K3E,K46,K45,K4E,K55,K6A,K66, KF0,KEC,KFD, K77,KCA,K7C,K7B, \ - K0D,K15,K1D,K24,K2D,K2C,K35,K3C,K43,K44,K4D,K54,K5B, KF1,KE9,KFA, K6C,K75,K7D, \ - K58,K1C,K1B,K23,K2B,K34,K33,K3B,K42,K4B,K4C,K52,K5D, K5A, K6B,K73,K74,K79, \ - K12,K1A,K22,K21,K2A,K32,K31,K3A,K41,K49,K4A,K51, K59, KF5, K69,K72,K7A, \ - K14,K9F,K11, K67,K29,K64,K13, K91,KA7,KAF,K94, KEB,KF2,KF4, K70, K71,KDA \ -) \ -KEYMAP_ALL( \ - K76,K05,K06,K04,K0C,K03,K0B,K83,K0A,K01,K09,K78,K07, KFC,K7E,KFE, \ - K0E,K16,K1E,K26,K25,K2E,K36,K3D,K3E,K46,K45,K4E,K55,K66, KF0,KEC,KFD, K77,KCA,K7C,K7B, \ - K0D,K15,K1D,K24,K2D,K2C,K35,K3C,K43,K44,K4D,K54,K5B,K5D, KF1,KE9,KFA, K6C,K75,K7D, \ - K58,K1C,K1B,K23,K2B,K34,K33,K3B,K42,K4B,K4C,K52, K5A, K6B,K73,K74,K79, \ - K12,K1A,K22,K21,K2A,K32,K31,K3A,K41,K49,K4A, K59, KF5, K69,K72,K7A, \ - K14,K9F,K11, K29, K91,KA7,KAF,K94, KEB,KF2,KF4, K70, K71,KDA, \ - \ - NUBS, \ - K51, K13, K6A, K64, K67, \ - F13, F14, F15, F16, F17, F18, F19, F20, F21, F22, F23, F24, \ - SYSTEM_POWER, SYSTEM_SLEEP, SYSTEM_WAKE, \ - AUDIO_MUTE, AUDIO_VOL_UP, AUDIO_VOL_DOWN, \ - MEDIA_NEXT_TRACK, MEDIA_PREV_TRACK, MEDIA_STOP, MEDIA_PLAY_PAUSE, MEDIA_SELECT, \ - MAIL, CALCULATOR, MY_COMPUTER, \ - WWW_SEARCH, WWW_HOME, WWW_BACK, WWW_FORWARD, \ - WWW_STOP, WWW_REFRESH, WWW_FAVORITES \ -) - -#endif diff --git a/converter/serialmouse_usb/led.c b/converter/serialmouse_usb/led.c deleted file mode 100644 index f76545f0ba6..00000000000 --- a/converter/serialmouse_usb/led.c +++ /dev/null @@ -1,24 +0,0 @@ -/* -Copyright 2011 Jun Wako - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#include "stdint.h" -#include "led.h" - - -void led_set(uint8_t usb_led) -{ -} diff --git a/converter/serialmouse_usb/matrix.c b/converter/serialmouse_usb/matrix.c deleted file mode 100644 index 0e0d87f80e5..00000000000 --- a/converter/serialmouse_usb/matrix.c +++ /dev/null @@ -1,83 +0,0 @@ -/* -Copyright 2011 Jun Wako - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#include -#include -#include -#include -#include "action.h" -#include "print.h" -#include "util.h" -#include "debug.h" -#include "matrix.h" - - -inline -uint8_t matrix_rows(void) -{ - return MATRIX_ROWS; -} - -inline -uint8_t matrix_cols(void) -{ - return MATRIX_COLS; -} - -void matrix_init(void) -{ - debug_enable = true; - debug_mouse=true; - return; -} - -uint8_t matrix_scan(void) -{ - return 0; -} - -bool matrix_is_modified(void) -{ - return false; -} - -inline -bool matrix_has_ghost(void) -{ - return false; -} - -inline -bool matrix_is_on(uint8_t row, uint8_t col) -{ - return false; -} - -inline -uint8_t matrix_get_row(uint8_t row) -{ - return 0; -} - -void matrix_print(void) -{ -} - -uint8_t matrix_key_count(void) -{ - return 0; -} diff --git a/converter/sun_usb/Makefile b/converter/sun_usb/Makefile deleted file mode 100644 index f046bfdd36b..00000000000 --- a/converter/sun_usb/Makefile +++ /dev/null @@ -1,85 +0,0 @@ -# Target file name (without extension). -TARGET = sun_usb - -# Directory common source filess exist -TMK_DIR = ../../tmk_core - -# Directory keyboard dependent files exist -TARGET_DIR = . - -# keyboard dependent files -SRC = keymap.c \ - matrix.c \ - led.c \ - command_extra.c \ - protocol/serial_soft.c - -CONFIG_H = config.h - - -# MCU name, you MUST set this to match the board you are using -# type "make clean" after changing this, so all files will be rebuilt -#MCU = at90usb162 # Teensy 1.0 -#MCU = atmega32u4 # Teensy 2.0 -#MCU = at90usb646 # Teensy++ 1.0 -#MCU = at90usb1286 # Teensy++ 2.0 -MCU = atmega32u2 - - -# Processor frequency. -# Normally the first thing your program should do is set the clock prescaler, -# so your program will run at the correct speed. You should also set this -# variable to same clock speed. The _delay_ms() macro uses this, and many -# examples use this variable to calculate timings. Do not add a "UL" here. -F_CPU = 16000000 - - -# -# LUFA specific -# -# Target architecture (see library "Board Types" documentation). -ARCH = AVR8 - -# Input clock frequency. -# This will define a symbol, F_USB, in all source code files equal to the -# input clock frequency (before any prescaling is performed) in Hz. This value may -# differ from F_CPU if prescaling is used on the latter, and is required as the -# raw input clock is fed directly to the PLL sections of the AVR for high speed -# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' -# at the end, this will be done automatically to create a 32-bit value in your -# source code. -# -# If no clock division is performed on the input clock inside the AVR (via the -# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. -F_USB = $(F_CPU) - -# Interrupt driven control endpoint task -OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT - - -# Build Options -# *Comment out* to disable the options. -# -MOUSEKEY_ENABLE = yes # Mouse keys -EXTRAKEY_ENABLE = yes # Audio control and System control -CONSOLE_ENABLE = yes # Console for debug -COMMAND_ENABLE = yes # Commands for debug and configuration -#NKRO_ENABLE = yes # USB Nkey Rollover - - -# Boot Section Size in bytes -# Teensy halfKay 512 -# Atmel DFU loader 4096 -# LUFA bootloader 4096 -OPT_DEFS += -DBOOTLOADER_SIZE=4096 - - -# Search Path -VPATH += $(TARGET_DIR) -VPATH += $(TMK_DIR) - - -include $(TMK_DIR)/protocol/lufa.mk -include $(TMK_DIR)/protocol.mk -include $(TMK_DIR)/common.mk -include $(TMK_DIR)/rules.mk diff --git a/converter/sun_usb/README b/converter/sun_usb/README deleted file mode 100644 index 98340dd3154..00000000000 --- a/converter/sun_usb/README +++ /dev/null @@ -1,106 +0,0 @@ -Sun to USB keyboard protocol converter -====================================== -Target MCU is ATMega32u4 but other USB capable AVR will also work. - -This converter will work with Sun Type 2-5 Keyboards. - - -Tested on: -Sun Type 3 Keyboard: http://blog.daveastels.com.s3-website-us-west-2.amazonaws.com/2014/12/27/type-3-keyboard.html -CTCSP SHORT TYPE KEYBOARD(Type 5): http://imgur.com/a/QIv6p - - -Keymap of Type 3(keymap_sun3.c) were impoted from dastels's repository. -https://github.com/dastels/tmk_keyboard/tree/master/converter/sun3_usb - - - -Connector ---------- - 8Pin mini DIN - ___ ___ - / |_| \ - / 8 7 6 \ - | 5 4 3 | - \_ 2 1 _/ - \_____/ - (receptacle) - - Wiring: - Pin mini DIN MCU - ---------------------------------- - 1 GND GND - 2 GND GND - 3 5V - 4 RX/TX(Mouse) - 5 RX PD3 - 6 TX PD2 - 7 GND GND - 8 5V VCC - - -Protocol --------- -Signal: Asynchronous, Negative logic, 1200baud, No Flow control -Frame format: 1-Start bit, 8-Data bits, No-Parity, 1-Stop bit - - AVR USART engine expects positive logic while Sun keyboard signal is negative. - To use AVR UART engine you need external inverter in front of RX and TX pin. - Otherwise you can software serial routine to communicate the keyboard. - -This converter uses software method, you doesn't need any inverter part. - - -Commands From System To Keyboard - 0x01 Reset - Keyboard responds with following byte sequence: - Success: 0xFF 0x04 0x7F - Fail: 0x7E 0x01 0x7F - 0x02 Bell On - 0x03 Bell Off - 0x0A Click On - 0x0B Click Off - 0x0E LED - followed by LED status byte: - bit: 3 2 1 0 - LED: CapsLk ScrLk Compose NumLk - 0x0F Layout - Keyboard responds with 'Layout Response' 0xFE 0xXX - -Commands From Keyboard To System - 0x7F Idle - means no keys pressed. - 0xFE Layout Response - 0xFF Reset Response(followed by 0x04) - -Reference - http://kentie.net/article/sunkbd/page2.htm - http://kentie.net/article/sunkbd/KBD.pdf - - -Build Firmware --------------- -Just use 'make' - $ cd sun_usb - $ make -Then, load the binary to MCU with your favorite programmer. - - -Sun commands ------------- -You can send Sun protocol commands with TMK `Magic` key combo. By default `Magic` key is `LShift` + `RShift`, `LAlt` + `RAlt' or `LMeta` + `RMeta`. -https://github.com/tmk/tmk_keyboard#magic-commands - -Following Sun specific commands are available. For example, to send 'Bell On' you can press `LShift` + `RShift` + `Up` keys simultaneously. - -``` ------ Sun converter Help ----- -Up: Bell On -Down: Bell Off -Left: Click On -Right: Click Off -PgUp: LED all On -PgDown: LED all On -Insert: Layout -Delete: Reset -``` diff --git a/converter/sun_usb/command_extra.c b/converter/sun_usb/command_extra.c deleted file mode 100644 index aba3fe6da38..00000000000 --- a/converter/sun_usb/command_extra.c +++ /dev/null @@ -1,61 +0,0 @@ -#include "stdbool.h" -#include "stdint.h" -#include "keycode.h" -#include "serial.h" -#include "print.h" -#include "command.h" - -bool command_extra(uint8_t code) -{ - switch (code) { - case KC_H: - case KC_SLASH: /* ? */ - print("\n\n----- Sun converter Help -----\n"); - print("Up: Bell On\n"); - print("Down: Bell Off\n"); - print("Left: Click On\n"); - print("Right: Click Off\n"); - print("PgUp: LED all On\n"); - print("PgDown: LED all On\n"); - print("Insert: Layout\n"); - print("Delete: Reset\n"); - return false; - case KC_DEL: - print("Reset\n"); - serial_send(0x01); - break; - case KC_UP: - print("Bell On\n"); - serial_send(0x02); - break; - case KC_DOWN: - print("Bell Off\n"); - serial_send(0x03); - break; - case KC_LEFT: - print("Click On\n"); - serial_send(0x0A); - break; - case KC_RIGHT: - print("Click Off\n"); - serial_send(0x0B); - break; - case KC_PGUP: - print("LED all on\n"); - serial_send(0x0E); - serial_send(0xFF); - break; - case KC_PGDOWN: - print("LED all off\n"); - serial_send(0x0E); - serial_send(0x00); - break; - case KC_INSERT: - print("layout\n"); - serial_send(0x0F); - break; - default: - return false; - } - return true; -} diff --git a/converter/sun_usb/config.h b/converter/sun_usb/config.h deleted file mode 100644 index 66036da931b..00000000000 --- a/converter/sun_usb/config.h +++ /dev/null @@ -1,95 +0,0 @@ -/* -Copyright 2012 Jun Wako - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#ifndef CONFIG_H -#define CONFIG_H - -#define VENDOR_ID 0xFEED -#define PRODUCT_ID 0x3333 -#define DEVICE_VER 0x0100 -#define MANUFACTURER t.m.k. -#define PRODUCT Sun keyboard converter -#define DESCRIPTION converts Sun keyboard protocol into USB - -/* matrix size */ -#define MATRIX_ROWS 16 -#define MATRIX_COLS 8 - -/* key combination for command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LALT) | MOD_BIT(KC_RALT)) || \ - keyboard_report->mods == (MOD_BIT(KC_LGUI) | MOD_BIT(KC_RGUI)) || \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - -/* legacy keymap support */ -#define USE_LEGACY_KEYMAP - - -/* Serial(USART) configuration - * asynchronous, negative logic, 1200baud, no flow control - * 1-start bit, 8-data bit, non parity, 1-stop bit - */ -#define SERIAL_SOFT_BAUD 1200 -#define SERIAL_SOFT_PARITY_NONE -#define SERIAL_SOFT_BIT_ORDER_LSB -#define SERIAL_SOFT_LOGIC_NEGATIVE -/* RXD Port */ -#define SERIAL_SOFT_RXD_ENABLE -#define SERIAL_SOFT_RXD_DDR DDRD -#define SERIAL_SOFT_RXD_PORT PORTD -#define SERIAL_SOFT_RXD_PIN PIND -#define SERIAL_SOFT_RXD_BIT 2 -#define SERIAL_SOFT_RXD_VECT INT2_vect -/* RXD Interupt */ -#ifdef SERIAL_SOFT_LOGIC_NEGATIVE -/* enable interrupt: INT2(rising edge) */ -#define INTR_TRIG_EDGE ((1< - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#include -#include -#include -#include "keycode.h" -#include "util.h" -#include "keymap.h" - - - - -/* Sun type 5 keyboard -,-------. ,---, ,---------------. ,---------------. ,---------------. ,-----------. ,---------------. -| 76 | | | | 05| 06| 08| 0A| | 0C| 0E| 10| 11| | 12| 07| 09| 0B| | 16| 17| 15| | 2D| 02| 04| 30| -`-------' `---' `---------------' `---------------' `---------------' `-----------' `---------------' -,-------. ,-----------------------------------------------------------. ,-----------. ,---------------. -| 01| 03| | 1D| 1E| 1F| 20| 21| 22| 23| 24| 25| 26| 27| 28| 29| 58| 2A| | 2C| 34| 60| | 62| 2E| 2F| 47| -|-------| |-----------------------------------------------------------| |------------ |---------------| -| 19| 1A| | 35 | 36| 37| 38| 39| 3A| 3B| 3C| 3D| 3E| 3F| 40| 41| 2B | | 42| 4A| 7B| | 44| 45| 46| | -|-------| |-----------------------------------------------------------| `-----------' |-----------| 7D| -| 31| 33| | 4C | 4D| 4E| 4F| 50| 51| 52| 53| 54| 55| 56| 57| 59 | | 5B| 5C| 5D| | -|-------| |-----------------------------------------------------------| ,---. |-----------|---| -| 48| 49| | 63 | 64| 65| 66| 67| 68| 69| 6A| 6B| 6C| 6D| 6E | | 14| | 70| 71| 72| | -|-------| |-----------------------------------------------------------| .-----------. |-----------| 5A| -| 5F| 61| | 77 | 13| 78 |*73 | 79 |*74 |*75| 7A | 43| 0D| | 18| 1B| 1C| | 5E | 32| | -`-------' `-----------------------------------------------------------' `-----------' `---------------' -*/ -#define KEYMAP( \ - K76, K05,K06,K08,K0A, K0C,K0E,K10,K11, K12,K07,K09,K0B, K16,K17,K15, K2D,K02,K04,K30, \ - K01,K03, K1D,K1E,K1F,K20,K21,K22,K23,K24,K25,K26,K27,K28,K29,K58,K2A, K2C,K34,K60, K62,K2E,K2F,K47, \ - K19,K1A, K35, K36,K37,K38,K39,K3A,K3B,K3C,K3D,K3E,K3F,K40,K41, K2B, K42,K4A,K7B, K44,K45,K46,K7D, \ - K31,K33, K4C, K4D,K4E,K4F,K50,K51,K52,K53,K54,K55,K56,K57, K59, K5B,K5C,K5D, \ - K48,K49, K63, K64,K65,K66,K67,K68,K69,K6A,K6B,K6C,K6D, K6E, K14, K70,K71,K72,K5A, \ - K5F,K61, K77,K13, K78, K73, K79, K74, K75, K7A, K43, K0D, K18,K1B,K1C, K5E, K32 \ -) { \ - { KC_NO, KC_##K01, KC_##K02, KC_##K03, KC_##K04, KC_##K05, KC_##K06, KC_##K07 }, \ - { KC_##K08, KC_##K09, KC_##K0A, KC_##K0B, KC_##K0C, KC_##K0D, KC_##K0E, KC_NO, }, \ - { KC_##K10, KC_##K11, KC_##K12, KC_##K13, KC_##K14, KC_##K15, KC_##K16, KC_##K17 }, \ - { KC_##K18, KC_##K19, KC_##K1A, KC_##K1B, KC_##K1C, KC_##K1D, KC_##K1E, KC_##K1F }, \ - { KC_##K20, KC_##K21, KC_##K22, KC_##K23, KC_##K24, KC_##K25, KC_##K26, KC_##K27 }, \ - { KC_##K28, KC_##K29, KC_##K2A, KC_##K2B, KC_##K2C, KC_##K2D, KC_##K2E, KC_##K2F }, \ - { KC_##K30, KC_##K31, KC_##K32, KC_##K33, KC_##K34, KC_##K35, KC_##K36, KC_##K37 }, \ - { KC_##K38, KC_##K39, KC_##K3A, KC_##K3B, KC_##K3C, KC_##K3D, KC_##K3E, KC_##K3F }, \ - { KC_##K40, KC_##K41, KC_##K42, KC_##K43, KC_##K44, KC_##K45, KC_##K46, KC_##K47 }, \ - { KC_##K48, KC_##K49, KC_##K4A, KC_NO, KC_##K4C, KC_##K4D, KC_##K4E, KC_##K4F }, \ - { KC_##K50, KC_##K51, KC_##K52, KC_##K53, KC_##K54, KC_##K55, KC_##K56, KC_##K57 }, \ - { KC_##K58, KC_##K59, KC_##K5A, KC_##K5B, KC_##K5C, KC_##K5D, KC_##K5E, KC_##K5F }, \ - { KC_##K60, KC_##K61, KC_##K62, KC_##K63, KC_##K64, KC_##K65, KC_##K66, KC_##K67 }, \ - { KC_##K68, KC_##K69, KC_##K6A, KC_##K6B, KC_##K6C, KC_##K6D, KC_##K6E, KC_NO }, \ - { KC_##K70, KC_##K71, KC_##K72, KC_##K73, KC_##K74, KC_##K75, KC_##K76, KC_##K77 }, \ - { KC_##K78, KC_##K79, KC_##K7A, KC_##K7B, KC_NO, KC_##K7D, KC_NO, KC_NO } \ -} - -/* CTCSP SHORT TYPE KEYBOARD */ -#define SHORT_TYPE( \ - K01, K05,K06,K08,K0A,K0C,K0E, K61,K49,K33, K30, K2C,K34,K60, \ - K10,K11,K12,K07,K09,K0B, K42,K4A,K7B, \ - K1D,K1E,K1F,K20,K21,K22,K23,K24,K25,K26,K27,K28,K29,K58,K2A, \ - K35, K36,K37,K38,K39,K3A,K3B,K3C,K3D,K3E,K3F,K40,K41, K2B, \ - K4C, K4D,K4E,K4F,K50,K51,K52,K53,K54,K55,K56,K57, K59, \ - K63, K64,K65,K66,K67,K68,K69,K6A,K6B,K6C,K6D, K0D,K14,K6E, \ - K77,K13, K78, K79, K7A,K43,K62,K18,K1B,K1C \ -) KEYMAP( \ - HELP, K05,K06,K08,K0A, K0C,K0E,K10,K11, K12,K07,K09,K0B, PSCR,SLCK,PAUS, MUTE,VOLD,VOLU,K30, \ - K01, AGAIN, K1D,K1E,K1F,K20,K21,K22,K23,K24,K25,K26,K27,K28,K29,K58,K2A, K2C, K34, K60, K62, PSLS,PAST,PMNS, \ - MENU, UNDO, K35, K36,K37,K38,K39,K3A,K3B,K3C,K3D,K3E,K3F,K40,K41, K2B, K42, K4A, K7B, P7, P8, P9, PPLS, \ - SELECT, K33, K4C, K4D,K4E,K4F,K50,K51,K52,K53,K54,K55,K56,K57, K59, P4, P5, P6, \ - EXECUTE,K49, K63, K64,K65,K66,K67,K68,K69,K6A,K6B,K6C,K6D, K6E, K14, P1, P2, P3, PENT, \ - FIND, K61, K77,K13, K78, HENK, K79, MHEN, KANA, K7A,K43,K0D, K18, K1B, K1C, P0, PDOT \ -) - - -// Assign Fn key(0-7) to a layer to which switch with the Fn key pressed. -static const uint8_t PROGMEM fn_layer[] = { - 2, // Fn0 - 3, // Fn1 - 4, // Fn2 - 0, // Fn3 - 0, // Fn4 - 0, // Fn5 - 0, // Fn6 - 0 // Fn7 -}; - -// Assign Fn key(0-7) to a keycode sent when release Fn key without use of the layer. -// See layer.c for details. -static const uint8_t PROGMEM fn_keycode[] = { - KC_NO, // Fn0 - KC_SCLN, // Fn1 - KC_SLSH, // Fn2 - KC_NO, // Fn3 - KC_NO, // Fn4 - KC_NO, // Fn5 - KC_NO, // Fn6 - KC_NO // Fn7 -}; - - -static const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -/* - KEYMAP( - HELP, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10,F11,F12, PSCR,SLCK,PAUS, MUTE,VOLD,VOLU,PWR, - STOP, AGAIN, ESC,1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, BSLS,GRV, INS, HOME,PGUP, NLCK,PSLS,PAST,PMNS, - MENU, UNDO, TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC,RBRC, BSPC, DEL, END, PGDN, P7, P8, P9, PPLS, - SELECT, COPY, LCTL, A, S, D, F, G, H, J, K, L, SCLN,QUOT, ENT, P4, P5, P6, - EXECUTE,PASTE, LSFT, Z, X, C, V, B, N, M, COMM,DOT,SLSH, RSFT, UP, P1, P2, P3, PENT, - FIND, CUT, CAPS, LALT, LGUI,HENK, SPC, MHEN,KANA,RGUI,APP, RALT, LEFT,DOWN,RGHT, P0, PDOT - ), -*/ - // 0: default - SHORT_TYPE( - STOP, F1,F2,F3,F4, F5, F6, CUT,PASTE,COPY,PWR, INS, HOME,PGUP, - F7,F8,F9,F10,F11,F12, DEL, END, PGDN, - ESC, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, BSLS,GRV, - TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC,RBRC, BSPC, - LCTL, A, S, D, F, G, H, J, K, L, SCLN,QUOT, ENT, - LSFT, Z, X, C, V, B, N, M, COMM,DOT, SLSH, RALT,UP, RSFT, - CAPS,LALT,LGUI, SPC, RGUI,APP, NLCK,LEFT,DOWN,RGHT - ), - // 1: with layer keys - SHORT_TYPE( - ESC, F1,F2,F3,F4, F5, F6, CUT,PASTE,COPY,PWR, INS, HOME,PGUP, - F7,F8,F9,F10,F11,F12, DEL, END, PGDN, - ESC, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, BSLS,GRV, - TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC,RBRC, BSPC, - LCTL, A, S, D, F, G, H, J, K, L, FN1, QUOT, ENT, - LSFT, Z, X, C, V, B, N, M, COMM,DOT, FN2, RSFT,UP, FN0, - CAPS,LALT,LGUI, SPC, RGUI,RALT,FN0, LEFT,DOWN,RGHT - ), - // 2: HHKB - SHORT_TYPE( - ESC, F1,F2,F3,F4, F5, F6, CUT,PASTE,COPY,PWR, INS, HOME,PGUP, - F7,F8,F9,F10,F11,F12, DEL, END, PGDN, - GRV, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, INS, DEL, - CAPS, NO, NO, NO, NO, NO, NO, NO, PSCR,SLCK,PAUS,UP, NO, BSPC, - LCTL, VOLD,VOLU,MUTE,NO, NO, NO, NO, HOME,PGUP,LEFT,RGHT, ENT, - LSFT, Z, X, C, V, B, NO, NO, END, PGDN,DOWN, RSFT,PGUP,FN0, - CAPS,LALT,LGUI, SPC, RGUI,RALT,FN0, HOME,PGDN,END - ), - // 3: Mousekey - SHORT_TYPE( - ESC, F1,F2,F3,F4, F5, F6, CUT,PASTE,COPY,PWR, INS, HOME,PGUP, - F7,F8,F9,F10,F11,F12, DEL, END, PGDN, - GRV, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, INS, DEL, - CAPS, NO, NO, NO, NO, NO, WH_L,WH_D,WH_U,WH_R,NO, NO, NO, BSPC, - LCTL, NO, ACL0,ACL1,ACL2,NO, MS_L,MS_D,MS_U,MS_R,FN1, NO, ENT, - LSFT, NO, NO, NO, NO, BTN3,BTN2,BTN1,NO, NO, NO, RSFT,UP, NO, - CAPS,LALT,LGUI, BTN1, RGUI,RALT,NO, LEFT,DOWN,RGHT - ), - // 4: Cursor - SHORT_TYPE( - ESC, F1,F2,F3,F4, F5, F6, CUT,PASTE,COPY,PWR, INS, HOME,PGUP, - F7,F8,F9,F10,F11,F12, DEL, END, PGDN, - GRV, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, INS, DEL, - CAPS, NO, NO, NO, NO, NO, HOME,PGDN,PGUP,END, NO, NO, NO, BSPC, - LCTL, NO, NO, NO, NO, NO, LEFT,DOWN,UP, RGHT,NO, NO, ENT, - LSFT, NO, NO, NO, NO, NO, HOME,PGDN,PGUP,END, FN2, RSFT,UP, NO, - CAPS,LALT,LGUI, BTN1, RGUI,RALT,NO, LEFT,DOWN,RGHT - ), -}; - - -uint8_t keymap_get_keycode(uint8_t layer, uint8_t row, uint8_t col) -{ - return pgm_read_byte(&keymaps[(layer)][(row)][(col)]); -} - -uint8_t keymap_fn_layer(uint8_t index) -{ - return pgm_read_byte(&fn_layer[index]); -} - -uint8_t keymap_fn_keycode(uint8_t index) -{ - return pgm_read_byte(&fn_keycode[index]); -} diff --git a/converter/sun_usb/keymap_sun3.c b/converter/sun_usb/keymap_sun3.c deleted file mode 100644 index 273cd9442f2..00000000000 --- a/converter/sun_usb/keymap_sun3.c +++ /dev/null @@ -1,173 +0,0 @@ -/* -Copyright 2012 Jun Wako - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#include -#include -#include -#include "keycode.h" -#include "util.h" -#include "keymap.h" - - -/* Sun type 3 keyboard -,-------. ,-----------------------------------------------------------. ,-----------. -| 01| 03| | 05| 06| 08| 0A| 0C| 0E| 10| 11| 12| 2B| | 15| 16| 17| -|-------| |-----------------------------------------------------------| |-----------| -| 19| 1A| | 1D| 1E| 1F| 20| 21| 22| 23| 24| 25| 26| 27| 28| 29| 58| 2A| | 2D| 2E| 2F| -|-------| |-----------------------------------------------------------| |-----------| -| 31| 33| | 35 | 36| 37| 38| 39| 3A| 3B| 3C| 3D| 3E| 3F| 40| 41| 42 | | 44| 45| 46| -|-------| |-----------------------------------------------------------| |-----------| -| 48| 49| | 4C | 4D| 4E| 4F| 50| 51| 52| 53| 54| 55| 56| 57| 59 | | 5B| 5C| 5D| -|-------| |-----------------------------------------------------------| |-----------| -| 5F| 61| | 63 | 64| 65| 66| 67| 68| 69| 6A| 6B| 6C| 6D| 6E| 6F| | 70| 71| 72| -`-------' |-----------------------------------------------------------| `-----------' - | 77 | 78 | 79 | 7A | 13 | - `-----------------------------------------------------------' -*/ - - -#define KEYMAP( \ - K01,K03, K05,K06, K08, K0A, K0C, K0E, K10,K11,K12,K2B, K15,K16,K17, \ - K19,K1A, K1D,K1E,K1F,K20,K21,K22,K23,K24,K25,K26,K27,K28,K29,K58,K2A, K2D,K2E,K2F, \ - K31,K33, K35, K36,K37,K38,K39,K3A,K3B,K3C,K3D,K3E,K3F,K40,K41, K42, K44,K45,K46, \ - K48,K49, K4C, K4D,K4E,K4F,K50,K51,K52,K53,K54,K55,K56,K57, K59, K5B,K5C,K5D, \ - K5F,K61, K63, K64,K65,K66,K67,K68,K69,K6A,K6B,K6C,K6D, K6E,K6F, K70,K71,K72, \ - K77,K78, K79, K7A,K13 \ -) { \ - { KC_NO, KC_##K01, KC_NO, KC_##K03, KC_NO, KC_##K05, KC_##K06, KC_NO }, \ - { KC_##K08, KC_NO, KC_##K0A, KC_NO, KC_##K0C, KC_NO, KC_##K0E, KC_NO }, \ - { KC_##K10, KC_##K11, KC_##K12, KC_##K13, KC_NO, KC_##K15, KC_##K16, KC_##K17 }, \ - { KC_NO, KC_##K19, KC_##K1A, KC_NO, KC_NO, KC_##K1D, KC_##K1E, KC_##K1F }, \ - { KC_##K20, KC_##K21, KC_##K22, KC_##K23, KC_##K24, KC_##K25, KC_##K26, KC_##K27 }, \ - { KC_##K28, KC_##K29, KC_##K2A, KC_##K2B, KC_NO, KC_##K2D, KC_##K2E, KC_##K2F }, \ - { KC_NO, KC_##K31, KC_NO, KC_##K33, KC_NO, KC_##K35, KC_##K36, KC_##K37 }, \ - { KC_##K38, KC_##K39, KC_##K3A, KC_##K3B, KC_##K3C, KC_##K3D, KC_##K3E, KC_##K3F }, \ - { KC_##K40, KC_##K41, KC_##K42, KC_NO, KC_##K44, KC_##K45, KC_##K46, KC_NO }, \ - { KC_##K48, KC_##K49, KC_NO, KC_NO, KC_##K4C, KC_##K4D, KC_##K4E, KC_##K4F }, \ - { KC_##K50, KC_##K51, KC_##K52, KC_##K53, KC_##K54, KC_##K55, KC_##K56, KC_##K57 }, \ - { KC_##K58, KC_##K59, KC_NO, KC_##K5B, KC_##K5C, KC_##K5D, KC_NO, KC_##K5F }, \ - { KC_NO, KC_##K61, KC_NO, KC_##K63, KC_##K64, KC_##K65, KC_##K66, KC_##K67 }, \ - { KC_##K68, KC_##K69, KC_##K6A, KC_##K6B, KC_##K6C, KC_##K6D, KC_##K6E, KC_##K6F }, \ - { KC_##K70, KC_##K71, KC_##K72, KC_NO, KC_NO, KC_NO, KC_NO, KC_##K77 }, \ - { KC_##K78, KC_##K79, KC_##K7A, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO } \ -} - -// Assign Fn key(0-7) to a layer to which switch with the Fn key pressed. -static const uint8_t PROGMEM fn_layer[] = { - 2, // Fn0 - 3, // Fn1 - 4, // Fn2 - 0, // Fn3 - 0, // Fn4 - 0, // Fn5 - 0, // Fn6 - 0 // Fn7 -}; - -// Assign Fn key(0-7) to a keycode sent when release Fn key without use of the layer. -// See layer.c for details. -static const uint8_t PROGMEM fn_keycode[] = { - KC_NO, // Fn0 - KC_SCLN, // Fn1 - KC_SLSH, // Fn2 - KC_NO, // Fn3 - KC_NO, // Fn4 - KC_NO, // Fn5 - KC_NO, // Fn6 - KC_NO // Fn7 -}; - - -static const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - - KEYMAP( - F10, F11, F1, F2, F3, F4, F5, F6, F7, F8, F9, BSPC, VOLD, MUTE, VOLU, - F12, F13, ESC, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0,MINS, EQL, BSLS, GRV, MPRV, MPLY, MNXT, - F14, F15, TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC,RBRC, DEL, HOME, UP, PGUP, - F16, F17, LCTL, A, S, D, F, G, H, J, K, L, SCLN,QUOT, ENT, LEFT, INSERT, RIGHT, - F18, F19, LSFT, Z, X, C, V, B, N, M, COMM,DOT,SLSH, RSFT,RCTL, END, DOWN, PGDOWN, - LGUI, LALT, SPC, RALT,RGUI - ), - /* - // 0: default - SHORT_TYPE( - STOP, F1,F2,F3,F4, F5, F6, CUT,PASTE,COPY,PWR, INS, HOME,PGUP, - F7,F8,F9,F10,F11,F12, DEL, END, PGDN, - ESC, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, BSLS,GRV, - TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC,RBRC, BSPC, - LCTL, A, S, D, F, G, H, J, K, L, SCLN,QUOT, ENT, - LSFT, Z, X, C, V, B, N, M, COMM,DOT, SLSH, RALT,UP, RSFT, - CAPS,LALT,LGUI, SPC, RGUI,APP, NLCK,LEFT,DOWN,RGHT - ), - // 1: with layer keys - SHORT_TYPE( - ESC, F1,F2,F3,F4, F5, F6, CUT,PASTE,COPY,PWR, INS, HOME,PGUP, - F7,F8,F9,F10,F11,F12, DEL, END, PGDN, - ESC, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, BSLS,GRV, - TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC,RBRC, BSPC, - LCTL, A, S, D, F, G, H, J, K, L, FN1, QUOT, ENT, - LSFT, Z, X, C, V, B, N, M, COMM,DOT, FN2, RSFT,UP, FN0, - CAPS,LALT,LGUI, SPC, RGUI,RALT,FN0, LEFT,DOWN,RGHT - ), - // 2: HHKB - SHORT_TYPE( - ESC, F1,F2,F3,F4, F5, F6, CUT,PASTE,COPY,PWR, INS, HOME,PGUP, - F7,F8,F9,F10,F11,F12, DEL, END, PGDN, - GRV, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, INS, DEL, - CAPS, NO, NO, NO, NO, NO, NO, NO, PSCR,SLCK,PAUS,UP, NO, BSPC, - LCTL, VOLD,VOLU,MUTE,NO, NO, NO, NO, HOME,PGUP,LEFT,RGHT, ENT, - LSFT, Z, X, C, V, B, NO, NO, END, PGDN,DOWN, RSFT,PGUP,FN0, - CAPS,LALT,LGUI, SPC, RGUI,RALT,FN0, HOME,PGDN,END - ), - // 3: Mousekey - SHORT_TYPE( - ESC, F1,F2,F3,F4, F5, F6, CUT,PASTE,COPY,PWR, INS, HOME,PGUP, - F7,F8,F9,F10,F11,F12, DEL, END, PGDN, - GRV, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, INS, DEL, - CAPS, NO, NO, NO, NO, NO, WH_L,WH_D,WH_U,WH_R,NO, NO, NO, BSPC, - LCTL, NO, ACL0,ACL1,ACL2,NO, MS_L,MS_D,MS_U,MS_R,FN1, NO, ENT, - LSFT, NO, NO, NO, NO, BTN3,BTN2,BTN1,NO, NO, NO, RSFT,UP, NO, - CAPS,LALT,LGUI, BTN1, RGUI,RALT,NO, LEFT,DOWN,RGHT - ), - // 4: Cursor - SHORT_TYPE( - ESC, F1,F2,F3,F4, F5, F6, CUT,PASTE,COPY,PWR, INS, HOME,PGUP, - F7,F8,F9,F10,F11,F12, DEL, END, PGDN, - GRV, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, INS, DEL, - CAPS, NO, NO, NO, NO, NO, HOME,PGDN,PGUP,END, NO, NO, NO, BSPC, - LCTL, NO, NO, NO, NO, NO, LEFT,DOWN,UP, RGHT,NO, NO, ENT, - LSFT, NO, NO, NO, NO, NO, HOME,PGDN,PGUP,END, FN2, RSFT,UP, NO, - CAPS,LALT,LGUI, BTN1, RGUI,RALT,NO, LEFT,DOWN,RGHT - ), - */ -}; - - -uint8_t keymap_get_keycode(uint8_t layer, uint8_t row, uint8_t col) -{ - return pgm_read_byte(&keymaps[(layer)][(row)][(col)]); -} - -uint8_t keymap_fn_layer(uint8_t index) -{ - return pgm_read_byte(&fn_layer[index]); -} - -uint8_t keymap_fn_keycode(uint8_t index) -{ - return pgm_read_byte(&fn_keycode[index]); -} diff --git a/converter/sun_usb/led.c b/converter/sun_usb/led.c deleted file mode 100644 index 809398faa58..00000000000 --- a/converter/sun_usb/led.c +++ /dev/null @@ -1,35 +0,0 @@ -/* -Copyright 2012 Jun Wako - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#include "stdint.h" -#include "serial.h" -#include "led.h" -#include "debug.h" - - -void led_set(uint8_t usb_led) -{ - uint8_t sun_led = 0; - if (usb_led & (1< - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#include -#include -#include -#include -#include "print.h" -#include "util.h" -#include "matrix.h" -#include "debug.h" -#include "protocol/serial.h" - - -/* - * Matrix Array usage: - * - * ROW: 16(4bits) - * COL: 8(3bits) - * - * 8bit wide - * +---------+ - * 0|00 ... 07| - * 1|08 ... 0F| - * :| ... | - * :| ... | - * E|70 ... 77| - * F|78 ... 7F| - * +---------+ - */ -static uint8_t matrix[MATRIX_ROWS]; -#define ROW(code) ((code>>3)&0xF) -#define COL(code) (code&0x07) - -static bool is_modified = false; - - -inline -uint8_t matrix_rows(void) -{ - return MATRIX_ROWS; -} - -inline -uint8_t matrix_cols(void) -{ - return MATRIX_COLS; -} - -void matrix_init(void) -{ - DDRD |= (1<<6); - PORTD |= (1<<6); - //debug_enable = true; - - serial_init(); - - // initialize matrix state: all keys off - for (uint8_t i=0; i < MATRIX_ROWS; i++) matrix[i] = 0x00; - - // wait for keyboard coming up - // otherwise LED status update fails - print("Reseting "); - while (1) { - print("."); - while (serial_recv()); - serial_send(0x01); - _delay_ms(500); - if (serial_recv() == 0xFF) { - _delay_ms(500); - if (serial_recv() == 0x04) - break; - } - } - print(" Done\n"); - return; -} - -uint8_t matrix_scan(void) -{ - is_modified = false; - - uint8_t code; - code = serial_recv(); - if (!code) return 0; - - debug_hex(code); debug(" "); - - switch (code) { - case 0xFF: // reset success: FF 04 - print("reset: "); - _delay_ms(500); - code = serial_recv(); - xprintf("%02X\n", code); - if (code == 0x04) { - // LED status - led_set(host_keyboard_leds()); - } - return 0; - case 0xFE: // layout: FE - print("layout: "); - _delay_ms(500); - xprintf("%02X\n", serial_recv()); - return 0; - case 0x7E: // reset fail: 7E 01 - print("reset fail: "); - _delay_ms(500); - xprintf("%02X\n", serial_recv()); - return 0; - case 0x7F: - // all keys up - for (uint8_t i=0; i < MATRIX_ROWS; i++) matrix[i] = 0x00; - return 0; - } - - if (code&0x80) { - // break code - if (matrix_is_on(ROW(code), COL(code))) { - matrix[ROW(code)] &= ~(1< - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#ifndef CONFIG_H -#define CONFIG_H - - -#define VENDOR_ID 0xFEED -#define PRODUCT_ID 0x6535 -#define DEVICE_VER 0x0100 -#define MANUFACTURER t.m.k. -#define PRODUCT 70% IBM Terminal Keyboard Converter w/ Bluetooth -#define DESCRIPTION USB converter for IBM Terminal Keyboard w/ Bluetooth - - -/* matrix size */ -#define MATRIX_ROWS 17 // keycode bit: 3-0 -#define MATRIX_COLS 8 // keycode bit: 6-4 - - -/* legacy keymap support */ -// #define USE_LEGACY_KEYMAP - - -/* key combination for command */ -#define IS_COMMAND() ( \ - (keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) || \ - (keyboard_report->mods == (MOD_BIT(KC_RALT) | MOD_BIT(KC_RCTL))) \ -) - -/* USART configuration - * asynchronous, 9600baud, 8-data bit, non parity, 1-stop bit, no flow control - */ -#ifdef __AVR_ATmega32U4__ - #define SERIAL_UART_BAUD 9600 - #define SERIAL_UART_DATA UDR1 - #define SERIAL_UART_UBRR ((F_CPU/(16UL*SERIAL_UART_BAUD))-1) - #define SERIAL_UART_RXD_VECT USART1_RX_vect - #define SERIAL_UART_TXD_READY (UCSR1A&(1<>8); /* baud rate */ \ - UCSR1B = (1< - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#include -#include -#include -#include "keycode.h" -#include "print.h" -#include "debug.h" -#include "util.h" -#include "keymap.h" - - - - -/* - * IBM Terminal keyboard 6110345(122keys)/1392595(102keys) - * http://geekhack.org/showthread.php?10737-What-Can-I-Do-With-a-Terminal-Model-M - * http://www.seasip.info/VintagePC/ibm_1391406.html - * - * Keymap array: - * 8 bytes - * +---------+ - * 0| | - * :| | 0x00-0x87 - * ;| | - * 17| | - * +---------+ - */ -#define KEYMAP( \ - K08,K10,K18,K20,K28,K30,K38,K40,K48,K50,K57,K5F, \ - K07,K0F,K17,K1F,K27,K2F,K37,K3F,K47,K4F,K56,K5E, \ - \ - K05,K06, K0E,K16,K1E,K26,K25,K2E,K36,K3D,K3E,K46,K45,K4E,K55,K5D,K66, K67,K6E,K6F, K76,K77,K7E,K84, \ - K04,K0C, K0D,K15,K1D,K24,K2D,K2C,K35,K3C,K43,K44,K4D,K54,K5B, K5C, K64,K65,K6D, K6C,K75,K7D,K7C, \ - K03,K0B, K14,K1C,K1B,K23,K2B,K34,K33,K3B,K42,K4B,K4C,K52, K53,K5A, K63, K6B,K73,K74,K7B, \ - K83,K0A, K12,K13,K1A,K22,K21,K2A,K32,K31,K3A,K41,K49,K4A, K51,K59, K61,K62,K6A, K69,K72,K7A,K79, \ - K01,K09, K11, K19, K29, K39, K58, K60, K68,K70,K71,K78 \ -) { \ - { KC_NO, KC_##K01, KC_NO, KC_##K03, KC_##K04, KC_##K05, KC_##K06, KC_##K07 }, \ - { KC_##K08, KC_##K09, KC_##K0A, KC_##K0B, KC_##K0C, KC_##K0D, KC_##K0E, KC_##K0F }, \ - { KC_##K10, KC_##K11, KC_##K12, KC_##K13, KC_##K14, KC_##K15, KC_##K16, KC_##K17 }, \ - { KC_##K18, KC_##K19, KC_##K1A, KC_##K1B, KC_##K1C, KC_##K1D, KC_##K1E, KC_##K1F }, \ - { KC_##K20, KC_##K21, KC_##K22, KC_##K23, KC_##K24, KC_##K25, KC_##K26, KC_##K27 }, \ - { KC_##K28, KC_##K29, KC_##K2A, KC_##K2B, KC_##K2C, KC_##K2D, KC_##K2E, KC_##K2F }, \ - { KC_##K30, KC_##K31, KC_##K32, KC_##K33, KC_##K34, KC_##K35, KC_##K36, KC_##K37 }, \ - { KC_##K38, KC_##K39, KC_##K3A, KC_##K3B, KC_##K3C, KC_##K3D, KC_##K3E, KC_##K3F }, \ - { KC_##K40, KC_##K41, KC_##K42, KC_##K43, KC_##K44, KC_##K45, KC_##K46, KC_##K47 }, \ - { KC_##K48, KC_##K49, KC_##K4A, KC_##K4B, KC_##K4C, KC_##K4D, KC_##K4E, KC_##K4F }, \ - { KC_##K50, KC_##K51, KC_##K52, KC_##K53, KC_##K54, KC_##K55, KC_##K56, KC_##K57 }, \ - { KC_##K58, KC_##K59, KC_##K5A, KC_##K5B, KC_##K5C, KC_##K5D, KC_##K5E, KC_##K5F }, \ - { KC_##K60, KC_##K61, KC_##K62, KC_##K63, KC_##K64, KC_##K65, KC_##K66, KC_##K67 }, \ - { KC_##K68, KC_##K69, KC_##K6A, KC_##K6B, KC_##K6C, KC_##K6D, KC_##K6E, KC_##K6F }, \ - { KC_##K70, KC_##K71, KC_##K72, KC_##K73, KC_##K74, KC_##K75, KC_##K76, KC_##K77 }, \ - { KC_##K78, KC_##K79, KC_##K7A, KC_##K7B, KC_##K7C, KC_##K7D, KC_##K7E, KC_NO }, \ - { KC_NO, KC_NO, KC_NO, KC_##K83, KC_##K84, KC_NO, KC_NO, KC_NO, }, \ -} - -static const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - /* 0: default - * ,---. ,---------------. ,---------------. ,---------------. ,-----------. - * |Esc| |F1 |F2 |F3 |F4 | |F5 |F6 |F7 |F8 | |F9 |F10|F11|F12| |PrS|ScL|Pau| - * `---' `---------------' `---------------' `---------------' `-----------' - * ,-----------------------------------------------------------. ,-----------. ,---------------. - * | `| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =| \|BS | |Ins|Hom|PgU| |NmL| /| *| -| - * |-----------------------------------------------------------| |-----------| |---------------| - * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \| |Del|End|PgD| | 7| 8| 9| | - * |-----------------------------------------------------------| `-----------' |-----------| +| - * |CapsLo| A| S| D| F| G| H| J| K| L| ;| '| #|Retu| | 4| 5| 6| | - * |-----------------------------------------------------------| ,---. |---------------| - * |Shif| \| Z| X| C| V| B| N| M| ,| ,| /|Shift | |Up | | 1| 2| 3| | - * |-----------------------------------------------------------| ,-----------. |-----------|Ent| - * |Ctrl| |Alt | Space |Alt | |Ctrl| |Lef|Dow|Rig| | 0| .| | - * `----' `---------------------------------------' `----' `-----------' `---------------' - */ -/* - KEYMAP( - F13, F14, F15, F16, F17, F18, F19, F20, F21, F22, F23, F24, - F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, - - PSCR,ESC, GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, JYEN,BSPC, INS, HOME,PGUP, NLCK,PSLS,PAST,PMNS, - SLCK,INT4, TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC,RBRC, BSLS, DEL, END, PGDN, P7, P8, P9, PPLS, - PAUS,INT5, CAPS,A, S, D, F, G, H, J, K, L, SCLN,QUOT, NUHS,ENT, UP, P4, P5, P6, PCMM, - APP, INT6, LSFT,NUBS,Z, X, C, V, B, N, M, COMM,DOT, SLSH, RO, RSFT, LEFT,INT2,RGHT, P1, P2, P3, PENT, - RGUI,LGUI, LCTL, LALT, SPC, RALT, RCTL, DOWN, NO, P0, PDOT,NO - ), -*/ - /* - KEYMAP( - TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, - TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, - - TRNS,TRNS, TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, TRNS,TRNS,TRNS, TRNS,TRNS,TRNS,TRNS, - TRNS,TRNS, TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, TRNS, TRNS,TRNS,TRNS, TRNS,TRNS,TRNS,TRNS, - TRNS,TRNS, TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, TRNS,TRNS, TRNS, TRNS,TRNS,TRNS,TRNS, - TRNS,TRNS, TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, TRNS,TRNS, TRNS,TRNS,TRNS, TRNS,TRNS,TRNS,TRNS, - TRNS,TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS,TRNS,TRNS,TRNS - ), - */ - // pseudo ANSI - - KEYMAP( - FN0, NO, NO, NO, NO, NO, NO, NO, NO, NO, NO, NO, - PSCR,PAUS,PGUP,PGDN,HOME,END, INS, DEL, LEFT,DOWN,UP, RGHT, - - NO, NO, ESC, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, GRV, BSPC, NO, NO, NO, NO, NO, NO, NO, - NO, NO, TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC,RBRC, BSLS, NO, NO, NO, NO, NO, NO, NO, - NO, NO, LCTL,A, S, D, F, G, H, J, K, L, SCLN,QUOT, BSLS,ENT, NO, NO, NO, NO, NO, - NO, NO, LSFT,FN1 ,Z, X, C, V, B, N, M, COMM,DOT, SLSH, FN1, RSFT, NO, NO, NO, NO, NO, NO, NO, - NO, NO, LCTL, LALT, SPC, LGUI, APP, NO, NO, NO, NO, NO - ), - - // Momentary Function Layer - KEYMAP( - TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, - TRNS,MUTE,VOLD,VOLU,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, - - TRNS,TRNS, TRNS,F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, INS, DEL, TRNS,TRNS,TRNS, TRNS,TRNS,TRNS,TRNS, - TRNS,TRNS, TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,HOME,UP ,END, TRNS, TRNS,TRNS,TRNS, TRNS,TRNS,TRNS,TRNS, - TRNS,TRNS, TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,MS_L,MS_D,MS_U,MS_R,LEFT,DOWN, RGHT,TRNS, TRNS, TRNS,TRNS,TRNS,TRNS, - TRNS,TRNS, TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,PGUP,PGDN,TRNS, TRNS,RSFT, TRNS,TRNS,TRNS, TRNS,TRNS,TRNS,TRNS, - TRNS,TRNS, BTN2, TRNS, BTN1, RALT, RCTL, TRNS, TRNS,TRNS,TRNS,TRNS - ), - - // Mouse Layer - KEYMAP( - FN0, TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, - TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, - - TRNS,TRNS, TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,NO, TRNS, NO, NO, NO, NO, NO, NO, NO, - TRNS,TRNS, TRNS,NO, NO, MS_U,NO, NO, WH_L,WH_D,WH_U,WH_R,NO, NO, NO, TRNS, NO, NO, NO, NO, NO, NO, NO, - TRNS,TRNS, BTN2,BTN1,MS_L,MS_D,MS_R,NO, MS_L,MS_D,MS_U,MS_R,NO, NO, NO, ENT, NO, NO, NO, NO, NO, - TRNS,TRNS, TRNS,TRNS,NO, NO, NO, NO, NO, NO, NO, NO, NO, NO, NO, RSFT, NO, NO, NO, NO, NO, NO, NO, - TRNS,TRNS, TRNS, TRNS, BTN1, BTN2, TRNS, NO, NO, NO, NO, NO - ), - - // vi Layer - KEYMAP( - FN0, TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, - TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, - - TRNS,TRNS, TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,NO, TRNS, NO, NO, NO, NO, NO, NO, NO, - TRNS,TRNS, TRNS,HOME,PGDN,UP, PGUP,END, HOME,PGDN,PGUP,END, NO, NO, NO, TRNS, NO, NO, NO, NO, NO, NO, NO, - TRNS,TRNS, TRNS,NO, LEFT,DOWN,RGHT,NO, LEFT,DOWN,UP, RGHT,NO, NO, NO, ENT, NO, NO, NO, NO, NO, - TRNS,TRNS, TRNS,TRNS,NO, NO, NO, NO, NO, NO, NO, NO, NO, NO, NO, RSFT, NO, NO, NO, NO, NO, NO, NO, - TRNS,TRNS, TRNS, TRNS, SPC, RALT, RCTL, NO, NO, NO, NO, NO - ), - - // num lock layer - KEYMAP( - FN0, TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, - TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, - - TRNS,TRNS, TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, TRNS,TRNS,TRNS, TRNS,TRNS,TRNS,TRNS, - TRNS,TRNS, TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, TRNS, TRNS,TRNS,TRNS, TRNS,TRNS,TRNS,TRNS, - TRNS,TRNS, TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, TRNS,TRNS, TRNS, TRNS,TRNS,TRNS,TRNS, - TRNS,TRNS, TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, TRNS,TRNS, TRNS,TRNS,TRNS, TRNS,TRNS,TRNS,TRNS, - TRNS,TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS,TRNS,TRNS,TRNS - ), - -}; - - -static const uint16_t fn_actions[] PROGMEM = { - [0] = ACTION_DEFAULT_LAYER_SET(0), - [1] = ACTION_LAYER_MOMENTARY(1), - [2] = ACTION_LAYER_MOMENTARY(2), //ACTION_LAYER_ON(2, ON_RELEASE), - [3] = KC_NO, //ACTION_LAYER_ON(3, ON_RELEASE), - [4] = KC_NO, //ACTION_LAYER_ON(4, ON_RELEASE), - [5] = KC_NO, - [6] = KC_NO, - [7] = KC_NO, -}; - -/* -enum macro_id { - MS_UL, - MS_UR, - MS_DL, - MS_DR, -}; - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - keyevent_t event = record->event; - - switch (id) { - case MS_UL: - return (event.pressed ? MACRO( D(MS_L), D(MS_U), END ) : MACRO( U(MS_L), U(MS_U), END ) ); - case MS_UR: - return (event.pressed ? MACRO( D(MS_R), D(MS_U), END ) : MACRO( U(MS_L), U(MS_U), END ) ); - case MS_DL: - return (event.pressed ? MACRO( D(MS_L), D(MS_D), END ) : MACRO( U(MS_L), U(MS_U), END ) ); - case MS_DR: - return (event.pressed ? MACRO( D(MS_R), D(MS_D), END ) : MACRO( U(MS_L), U(MS_U), END ) ); - } - return MACRO_NONE; -} -*/ - -uint8_t keymap_key_to_keycode(uint8_t layer, keypos_t key) -{ - return pgm_read_byte(&keymaps[(layer)][(key.row)][(key.col)]); -} - -action_t keymap_fn_to_action(uint8_t keycode) -{ - action_t action; - action.code = pgm_read_word(&fn_actions[FN_INDEX(keycode)]); - return action; -} diff --git a/converter/terminal_bluefruit/led.c b/converter/terminal_bluefruit/led.c deleted file mode 100644 index e5bf41d4ab3..00000000000 --- a/converter/terminal_bluefruit/led.c +++ /dev/null @@ -1,35 +0,0 @@ -/* -Converter for 70% IBM Terminal Keyboard -Author: Benjamin Gould, 2013 -Based on code Copyright 2011 Jun Wako - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#include "stdint.h" -#include "ps2.h" -#include "led.h" - - -void led_set(uint8_t usb_led) -{ - uint8_t ps2_led = 0; - if (usb_led & (1< - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#include -#include -#include -#include -#include "print.h" -#include "util.h" -#include "debug.h" -#include "ps2.h" -#include "matrix.h" - - -static void matrix_make(uint8_t code); -static void matrix_break(uint8_t code); -#ifdef MATRIX_HAS_GHOST -static bool matrix_has_ghost_in_row(uint8_t row); -#endif - - -/* - * Matrix Array usage: - * 'Scan Code Set 3' is assigned into 17x8 cell matrix. - * - * 8bit wide - * +---------+ - * 0| | - * :| | 0x00-0x87 - * ;| | - * 17| | - * +---------+ - */ -static uint8_t matrix[MATRIX_ROWS]; -#define ROW(code) (code>>3) -#define COL(code) (code&0x07) - -static bool is_modified = false; - - -inline -uint8_t matrix_rows(void) -{ - return MATRIX_ROWS; -} - -inline -uint8_t matrix_cols(void) -{ - return MATRIX_COLS; -} - -void matrix_init(void) -{ - debug_enable = true; - //debug_matrix = true; - //debug_keyboard = true; - //debug_mouse = false; - - ps2_host_init(); - - // initialize matrix state: all keys off - for (uint8_t i=0; i < MATRIX_ROWS; i++) matrix[i] = 0x00; - - return; -} - -uint8_t matrix_scan(void) -{ - - // scan code reading states - static enum { - RESET, - RESET_RESPONSE, - KBD_ID0, - KBD_ID1, - CONFIG, - READY, - F0, - } state = RESET; - - is_modified = false; - - uint8_t code; - if ((code = ps2_host_recv())) { - debug("r"); debug_hex(code); debug(" "); - } - - switch (state) { - case RESET: - debug("wFF "); - if (ps2_host_send(0xFF) == 0xFA) { - debug("[ack]\nRESET_RESPONSE: "); - state = RESET_RESPONSE; - } - break; - case RESET_RESPONSE: - if (code == 0xAA) { - debug("[ok]\nKBD_ID: "); - state = KBD_ID0; - } else if (code) { - debug("err\nRESET: "); - state = RESET; - } - break; - // after reset receive keyboad ID(2 bytes) - case KBD_ID0: - if (code) { - state = KBD_ID1; - } - break; - case KBD_ID1: - if (code) { - debug("\nCONFIG: "); - state = CONFIG; - } - break; - case CONFIG: - debug("wF8 "); - if (ps2_host_send(0xF8) == 0xFA) { - debug("[ack]\nREADY\n"); - state = READY; - } - break; - case READY: - switch (code) { - case 0x00: - break; - case 0xF0: - state = F0; - debug(" "); - break; - default: // normal key make - if (code < 0x88) { - matrix_make(code); - } else { - debug("unexpected scan code at READY: "); debug_hex(code); debug("\n"); - } - state = READY; - debug("\n"); - } - break; - case F0: // Break code - switch (code) { - case 0x00: - break; - default: - if (code < 0x88) { - matrix_break(code); - } else { - debug("unexpected scan code at F0: "); debug_hex(code); debug("\n"); - } - state = READY; - debug("\n"); - } - break; - } - return 1; -} - -bool matrix_is_modified(void) -{ - return is_modified; -} - -inline -bool matrix_has_ghost(void) -{ -#ifdef MATRIX_HAS_GHOST - for (uint8_t i = 0; i < MATRIX_ROWS; i++) { - if (matrix_has_ghost_in_row(i)) - return true; - } -#endif - return false; -} - -inline -bool matrix_is_on(uint8_t row, uint8_t col) -{ - return (matrix[row] & (1< - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#ifndef CONFIG_H -#define CONFIG_H - - -#define VENDOR_ID 0xFEED -#define PRODUCT_ID 0x6535 -#define DEVICE_VER 0x0100 -#define MANUFACTURER t.m.k. -#define PRODUCT PS/2(Set3)-USB Keyboard converter(IBM 122keys) -#define DESCRIPTION USB converter for IBM Terminal Keyboard 122keys - - -/* matrix size */ -#define MATRIX_ROWS 17 // keycode bit: 3-0 -#define MATRIX_COLS 8 // keycode bit: 6-4 - - -/* legacy keymap support */ -#define USE_LEGACY_KEYMAP - - -/* key combination for command */ -#define IS_COMMAND() ( \ - (keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) || \ - (keyboard_report->mods == (MOD_BIT(KC_RALT) | MOD_BIT(KC_RCTL))) \ -) - - -/* - * PS/2 USART configuration for ATMega32U4 - */ -#ifdef PS2_USE_USART -/* XCK for clock line */ -#define PS2_CLOCK_PORT PORTD -#define PS2_CLOCK_PIN PIND -#define PS2_CLOCK_DDR DDRD -#define PS2_CLOCK_BIT 5 -/* RXD for data line */ -#define PS2_DATA_PORT PORTD -#define PS2_DATA_PIN PIND -#define PS2_DATA_DDR DDRD -#define PS2_DATA_BIT 2 - -/* synchronous, odd parity, 1-bit stop, 8-bit data, sample at falling edge */ -/* set DDR of CLOCK as input to be slave */ -#define PS2_USART_INIT() do { \ - PS2_CLOCK_DDR &= ~(1< - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#include -#include -#include -#include "keycode.h" -#include "print.h" -#include "debug.h" -#include "util.h" -#include "keymap.h" - - - - -/* - * IBM Terminal keyboard 6110345(122keys)/1392595(102keys) - * http://geekhack.org/showthread.php?10737-What-Can-I-Do-With-a-Terminal-Model-M - * http://www.seasip.info/VintagePC/ibm_1391406.html - * - * Keymap array: - * 8 bytes - * +---------+ - * 0| | - * :| | 0x00-0x87 - * ;| | - * 17| | - * +---------+ - */ -#define KEYMAP( \ - K08,K10,K18,K20,K28,K30,K38,K40,K48,K50,K57,K5F, \ - K07,K0F,K17,K1F,K27,K2F,K37,K3F,K47,K4F,K56,K5E, \ - \ - K05,K06, K0E,K16,K1E,K26,K25,K2E,K36,K3D,K3E,K46,K45,K4E,K55,K5D,K66, K67,K6E,K6F, K76,K77,K7E,K84, \ - K04,K0C, K0D,K15,K1D,K24,K2D,K2C,K35,K3C,K43,K44,K4D,K54,K5B, K5C, K64,K65,K6D, K6C,K75,K7D,K7C, \ - K03,K0B, K14,K1C,K1B,K23,K2B,K34,K33,K3B,K42,K4B,K4C,K52, K53,K5A, K63, K6B,K73,K74,K7B, \ - K83,K0A, K12,K13,K1A,K22,K21,K2A,K32,K31,K3A,K41,K49,K4A, K51,K59, K61,K62,K6A, K69,K72,K7A,K79, \ - K01,K09, K11, K19, K29, K39, K58, K60, K68,K70,K71,K78 \ -) { \ - { KC_NO, KC_##K01, KC_NO, KC_##K03, KC_##K04, KC_##K05, KC_##K06, KC_##K07 }, \ - { KC_##K08, KC_##K09, KC_##K0A, KC_##K0B, KC_##K0C, KC_##K0D, KC_##K0E, KC_##K0F }, \ - { KC_##K10, KC_##K11, KC_##K12, KC_##K13, KC_##K14, KC_##K15, KC_##K16, KC_##K17 }, \ - { KC_##K18, KC_##K19, KC_##K1A, KC_##K1B, KC_##K1C, KC_##K1D, KC_##K1E, KC_##K1F }, \ - { KC_##K20, KC_##K21, KC_##K22, KC_##K23, KC_##K24, KC_##K25, KC_##K26, KC_##K27 }, \ - { KC_##K28, KC_##K29, KC_##K2A, KC_##K2B, KC_##K2C, KC_##K2D, KC_##K2E, KC_##K2F }, \ - { KC_##K30, KC_##K31, KC_##K32, KC_##K33, KC_##K34, KC_##K35, KC_##K36, KC_##K37 }, \ - { KC_##K38, KC_##K39, KC_##K3A, KC_##K3B, KC_##K3C, KC_##K3D, KC_##K3E, KC_##K3F }, \ - { KC_##K40, KC_##K41, KC_##K42, KC_##K43, KC_##K44, KC_##K45, KC_##K46, KC_##K47 }, \ - { KC_##K48, KC_##K49, KC_##K4A, KC_##K4B, KC_##K4C, KC_##K4D, KC_##K4E, KC_##K4F }, \ - { KC_##K50, KC_##K51, KC_##K52, KC_##K53, KC_##K54, KC_##K55, KC_##K56, KC_##K57 }, \ - { KC_##K58, KC_##K59, KC_##K5A, KC_##K5B, KC_##K5C, KC_##K5D, KC_##K5E, KC_##K5F }, \ - { KC_##K60, KC_##K61, KC_##K62, KC_##K63, KC_##K64, KC_##K65, KC_##K66, KC_##K67 }, \ - { KC_##K68, KC_##K69, KC_##K6A, KC_##K6B, KC_##K6C, KC_##K6D, KC_##K6E, KC_##K6F }, \ - { KC_##K70, KC_##K71, KC_##K72, KC_##K73, KC_##K74, KC_##K75, KC_##K76, KC_##K77 }, \ - { KC_##K78, KC_##K79, KC_##K7A, KC_##K7B, KC_##K7C, KC_##K7D, KC_##K7E, KC_NO }, \ - { KC_NO, KC_NO, KC_NO, KC_##K83, KC_##K84, KC_NO, KC_NO, KC_NO, }, \ -} - -/* - * IBM Terminal keyboard 1399625, 101-key - */ -#define KEYMAP_101( \ - K08, K07,K0F,K17,K1F,K27,K2F,K37,K3F,K47,K4F,K56,K5E, K57,K5F,K62, \ - \ - K0E,K16,K1E,K26,K25,K2E,K36,K3D,K3E,K46,K45,K4E,K55,K66, K67,K6E,K6F, K76,K77,K7E,K84, \ - K0D,K15,K1D,K24,K2D,K2C,K35,K3C,K43,K44,K4D,K54,K5B,K5C, K64,K65,K6D, K6C,K75,K7D, \ - K14,K1C,K1B,K23,K2B,K34,K33,K3B,K42,K4B,K4C,K52, K5A, K6B,K73,K74,K7C, \ - K12, K1A,K22,K21,K2A,K32,K31,K3A,K41,K49,K4A, K59, K63, K69,K72,K7A, \ - K11, K19, K29, K39, K58, K61,K60,K6A, K70, K71,K79 \ -) { \ - { KC_NO, KC_NO , KC_NO, KC_NO , KC_NO , KC_NO , KC_NO , KC_##K07 }, \ - { KC_##K08, KC_NO , KC_NO , KC_NO , KC_NO , KC_##K0D, KC_##K0E, KC_##K0F }, \ - { KC_NO , KC_##K11, KC_##K12, KC_NO , KC_##K14, KC_##K15, KC_##K16, KC_##K17 }, \ - { KC_NO , KC_##K19, KC_##K1A, KC_##K1B, KC_##K1C, KC_##K1D, KC_##K1E, KC_##K1F }, \ - { KC_NO , KC_##K21, KC_##K22, KC_##K23, KC_##K24, KC_##K25, KC_##K26, KC_##K27 }, \ - { KC_NO , KC_##K29, KC_##K2A, KC_##K2B, KC_##K2C, KC_##K2D, KC_##K2E, KC_##K2F }, \ - { KC_NO , KC_##K31, KC_##K32, KC_##K33, KC_##K34, KC_##K35, KC_##K36, KC_##K37 }, \ - { KC_NO , KC_##K39, KC_##K3A, KC_##K3B, KC_##K3C, KC_##K3D, KC_##K3E, KC_##K3F }, \ - { KC_NO , KC_##K41, KC_##K42, KC_##K43, KC_##K44, KC_##K45, KC_##K46, KC_##K47 }, \ - { KC_NO , KC_##K49, KC_##K4A, KC_##K4B, KC_##K4C, KC_##K4D, KC_##K4E, KC_##K4F }, \ - { KC_NO , KC_NO , KC_##K52, KC_NO , KC_##K54, KC_##K55, KC_##K56, KC_##K57 }, \ - { KC_##K58, KC_##K59, KC_##K5A, KC_##K5B, KC_##K5C, KC_NO , KC_##K5E, KC_##K5F }, \ - { KC_##K60, KC_##K61, KC_##K62, KC_##K63, KC_##K64, KC_##K65, KC_##K66, KC_##K67 }, \ - { KC_NO , KC_##K69, KC_##K6A, KC_##K6B, KC_##K6C, KC_##K6D, KC_##K6E, KC_##K6F }, \ - { KC_##K70, KC_##K71, KC_##K72, KC_##K73, KC_##K74, KC_##K75, KC_##K76, KC_##K77 }, \ - { KC_NO , KC_##K79, KC_##K7A, KC_NO , KC_##K7C, KC_##K7D, KC_##K7E, KC_NO }, \ - { KC_NO, KC_NO, KC_NO, KC_NO , KC_##K84, KC_NO, KC_NO, KC_NO, }, \ -} - -// Assign Fn key(0-7) to a layer to which switch with the Fn key pressed. -static const uint8_t PROGMEM fn_layer[] = { - 0, // Fn0 - 0, // Fn1 - 0, // Fn2 - 0, // Fn3 - 0, // Fn4 - 0, // Fn5 - 0, // Fn6 - 0 // Fn7 -}; - -// Assign Fn key(0-7) to a keycode sent when release Fn key without use of the layer. -// See layer.c for details. -static const uint8_t PROGMEM fn_keycode[] = { - KC_NO, // Fn0 - KC_NO, // Fn1 - KC_NO, // Fn2 - KC_NO, // Fn3 - KC_NO, // Fn4 - KC_NO, // Fn5 - KC_NO, // Fn6 - KC_NO // Fn7 -}; - - -static const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - /* 0: default - * ,---. ,---------------. ,---------------. ,---------------. ,-----------. - * |Esc| |F1 |F2 |F3 |F4 | |F5 |F6 |F7 |F8 | |F9 |F10|F11|F12| |PrS|ScL|Pau| - * `---' `---------------' `---------------' `---------------' `-----------' - * ,-----------------------------------------------------------. ,-----------. ,---------------. - * | `| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =| \|BS | |Ins|Hom|PgU| |NmL| /| *| -| - * |-----------------------------------------------------------| |-----------| |---------------| - * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \| |Del|End|PgD| | 7| 8| 9| | - * |-----------------------------------------------------------| `-----------' |-----------| +| - * |CapsLo| A| S| D| F| G| H| J| K| L| ;| '| #|Retu| | 4| 5| 6| | - * |-----------------------------------------------------------| ,---. |---------------| - * |Shif| \| Z| X| C| V| B| N| M| ,| ,| /|Shift | |Up | | 1| 2| 3| | - * |-----------------------------------------------------------| ,-----------. |-----------|Ent| - * |Ctrl| |Alt | Space |Alt | |Ctrl| |Lef|Dow|Rig| | 0| .| | - * `----' `---------------------------------------' `----' `-----------' `---------------' - */ -/* - KEYMAP( - F13, F14, F15, F16, F17, F18, F19, F20, F21, F22, F23, F24, - F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, - - PSCR,ESC, GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, JYEN,BSPC, INS, HOME,PGUP, NLCK,PSLS,PAST,PMNS, - SLCK,INT4, TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC,RBRC, BSLS, DEL, END, PGDN, P7, P8, P9, PPLS, - PAUS,INT5, CAPS,A, S, D, F, G, H, J, K, L, SCLN,QUOT, NUHS,ENT, UP, P4, P5, P6, PCMM, - APP, INT6, LSFT,NUBS,Z, X, C, V, B, N, M, COMM,DOT, SLSH, RO, RSFT, LEFT,INT2,RGHT, P1, P2, P3, PENT, - RGUI,LGUI, LCTL, LALT, SPC, RALT, RCTL, DOWN, NO, P0, PDOT,NO - ), -*/ - // pseudo ANSI - KEYMAP( - F13, F14, F15, F16, F17, F18, F19, F20, F21, F22, F23, F24, - F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, - - PSCR,ESC, ESC, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, NO, BSPC, INS, HOME,PGUP, NLCK,PSLS,PAST,PMNS, - SLCK,INT4, TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC,RBRC, NO, DEL, END, PGDN, P7, P8, P9, PPLS, - PAUS,INT5, LCTL,A, S, D, F, G, H, J, K, L, SCLN,QUOT, BSLS,ENT, UP, P4, P5, P6, PCMM, - APP, INT6, LSFT,LSFT,Z, X, C, V, B, N, M, COMM,DOT, SLSH, NO, RSFT, LEFT,INT2,RGHT, P1, P2, P3, PENT, - RGUI,LGUI, LCTL, LALT, SPC, LGUI, GRV, DOWN, NO, P0, PDOT,NO - ), - -/* 101-key keymaps - */ - /* 0: default - * ,---. ,---------------. ,---------------. ,---------------. ,-----------. - * |Esc| |F1 |F2 |F3 |F4 | |F5 |F6 |F7 |F8 | |F9 |F10|F11|F12| |PrS|ScL|Pau| - * `---' `---------------' `---------------' `---------------' `-----------' - * ,-----------------------------------------------------------. ,-----------. ,---------------. - * | `| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Backspa| |Ins|Hom|PgU| |NmL| /| *| -| - * |-----------------------------------------------------------| |-----------| |---------------| - * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \| |Del|End|PgD| | 7| 8| 9| | - * |-----------------------------------------------------------| `-----------' |-----------| +| - * |CapsLo| A| S| D| F| G| H| J| K| L| ;| '|Return | | 4| 5| 6| | - * |-----------------------------------------------------------| ,---. |---------------| - * |Shift | Z| X| C| V| B| N| M| ,| ,| /|Shift | |Up | | 1| 2| 3| | - * |-----------------------------------------------------------| ,-----------. |-----------|Ent| - * |Ctrl| |Alt | Space |Alt | |Ctrl| |Lef|Dow|Rig| | 0| .| | - * `----' `---------------------------------------' `----' `-----------' `---------------' - */ -/* - KEYMAP_101( - ESC, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, PSCR,SLCK, BRK, - - GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0,MINS, EQL,BSPC, INS,HOME,PGUP, NLCK,PSLS,PAST,PMNS, - TAB, Q, W, E, R, T, Y, U, I, O, P,LBRC,RBRC,BSLS, DEL, END,PGDN, P7, P8, P9, - CAPS, A, S, D, F, G, H, J, K, L,SCLN,QUOT, ENT, P4, P5, P6,PPLS, - LSFT, Z, X, C, V, B, N, M,COMM, DOT,SLSH, RSFT, UP, P1, P2, P3, - LCTL, LALT, SPC, RALT, RCTL, LEFT,DOWN,RGHT, P0, PDOT,PENT - ), -*/ -}; - - -uint8_t keymap_get_keycode(uint8_t layer, uint8_t row, uint8_t col) -{ - return pgm_read_byte(&keymaps[(layer)][(row)][(col)]); -} - -uint8_t keymap_fn_layer(uint8_t index) -{ - return pgm_read_byte(&fn_layer[index]); -} - -uint8_t keymap_fn_keycode(uint8_t index) -{ - return pgm_read_byte(&fn_keycode[index]); -} diff --git a/converter/terminal_usb/led.c b/converter/terminal_usb/led.c deleted file mode 100644 index e448e84ec73..00000000000 --- a/converter/terminal_usb/led.c +++ /dev/null @@ -1,33 +0,0 @@ -/* -Copyright 2011 Jun Wako - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#include "stdint.h" -#include "ps2.h" -#include "led.h" - - -void led_set(uint8_t usb_led) -{ - uint8_t ps2_led = 0; - if (usb_led & (1< - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#include -#include -#include -#include -#include "print.h" -#include "util.h" -#include "debug.h" -#include "ps2.h" -#include "matrix.h" - - -static void matrix_make(uint8_t code); -static void matrix_break(uint8_t code); -#ifdef MATRIX_HAS_GHOST -static bool matrix_has_ghost_in_row(uint8_t row); -#endif - - -/* - * Matrix Array usage: - * 'Scan Code Set 3' is assigned into 17x8 cell matrix. - * - * 8bit wide - * +---------+ - * 0| | - * :| | 0x00-0x87 - * ;| | - * 17| | - * +---------+ - */ -static uint8_t matrix[MATRIX_ROWS]; -#define ROW(code) (code>>3) -#define COL(code) (code&0x07) - -static bool is_modified = false; - - -inline -uint8_t matrix_rows(void) -{ - return MATRIX_ROWS; -} - -inline -uint8_t matrix_cols(void) -{ - return MATRIX_COLS; -} - -void matrix_init(void) -{ - debug_enable = true; - //debug_matrix = true; - //debug_keyboard = true; - //debug_mouse = false; - - ps2_host_init(); - - // initialize matrix state: all keys off - for (uint8_t i=0; i < MATRIX_ROWS; i++) matrix[i] = 0x00; - - return; -} - -uint8_t matrix_scan(void) -{ - - // scan code reading states - static enum { - RESET, - RESET_RESPONSE, - KBD_ID0, - KBD_ID1, - CONFIG, - READY, - F0, - } state = RESET; - - is_modified = false; - - uint8_t code; - if ((code = ps2_host_recv())) { - debug("r"); debug_hex(code); debug(" "); - } - - switch (state) { - case RESET: - debug("wFF "); - if (ps2_host_send(0xFF) == 0xFA) { - debug("[ack]\nRESET_RESPONSE: "); - state = RESET_RESPONSE; - } - break; - case RESET_RESPONSE: - if (code == 0xAA) { - debug("[ok]\nKBD_ID: "); - state = KBD_ID0; - } else if (code) { - debug("err\nRESET: "); - state = RESET; - } - break; - // after reset receive keyboad ID(2 bytes) - case KBD_ID0: - if (code) { - state = KBD_ID1; - } - break; - case KBD_ID1: - if (code) { - debug("\nCONFIG: "); - state = CONFIG; - } - break; - case CONFIG: - debug("wF8 "); - if (ps2_host_send(0xF8) == 0xFA) { - debug("[ack]\nREADY\n"); - state = READY; - } - break; - case READY: - switch (code) { - case 0x00: - break; - case 0xF0: - state = F0; - debug(" "); - break; - default: // normal key make - if (code < 0x88) { - matrix_make(code); - } else { - debug("unexpected scan code at READY: "); debug_hex(code); debug("\n"); - } - state = READY; - debug("\n"); - } - break; - case F0: // Break code - switch (code) { - case 0x00: - break; - default: - if (code < 0x88) { - matrix_break(code); - } else { - debug("unexpected scan code at F0: "); debug_hex(code); debug("\n"); - } - state = READY; - debug("\n"); - } - break; - } - return 1; -} - -bool matrix_is_modified(void) -{ - return is_modified; -} - -inline -bool matrix_has_ghost(void) -{ -#ifdef MATRIX_HAS_GHOST - for (uint8_t i = 0; i < MATRIX_ROWS; i++) { - if (matrix_has_ghost_in_row(i)) - return true; - } -#endif - return false; -} - -inline -bool matrix_is_on(uint8_t row, uint8_t col) -{ - return (matrix[row] & (1< - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#ifndef CONFIG_H -#define CONFIG_H - - -#define VENDOR_ID 0xFEED -#define PRODUCT_ID 0x005B -#define DEVICE_VER 0x0814 -#define MANUFACTURER t.m.k. -#define PRODUCT USB to USB keyboard converter - - -#define DESCRIPTION Product from t.m.k. keyboard firmware project - - -/* matrix size */ -#define MATRIX_ROWS 32 -#define MATRIX_COLS 8 - -/* key combination for command */ -#define IS_COMMAND() (keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) - -#endif diff --git a/converter/usb_usb/keymap.c b/converter/usb_usb/keymap.c deleted file mode 100644 index 5397de519fa..00000000000 --- a/converter/usb_usb/keymap.c +++ /dev/null @@ -1,115 +0,0 @@ -/* -Copyright 2012 Jun Wako - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#include "keymap_common.h" - - -const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - /* 0: plain Qwerty without layer switching - * ,---. ,---------------. ,---------------. ,---------------. ,-----------. ,-----------. - * |Esc| |F1 |F2 |F3 |F4 | |F5 |F6 |F7 |F8 | |F9 |F10|F11|F12| |PrS|ScL|Pau| |Pwr|Slp|Wak| - * `---' `---------------' `---------------' `---------------' `-----------' `-----------' - * ,-----------------------------------------------------------. ,-----------. ,---------------. - * | `| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Backspa| |Ins|Hom|PgU| |NmL| /| *| -| - * |-----------------------------------------------------------| |-----------| |---------------| - * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \| |Del|End|PgD| | 7| 8| 9| | - * |-----------------------------------------------------------| `-----------' |-----------| +| - * |CapsLo| A| S| D| F| G| H| J| K| L| ;| '|Return | | 4| 5| 6| | - * |-----------------------------------------------------------| ,---. |---------------| - * |Shift | Z| X| C| V| B| N| M| ,| ,| /|Shift | |Up | | 1| 2| 3| | - * |-----------------------------------------------------------| ,-----------. |-----------|Ent| - * |Ctrl |Gui |Alt | Space |Alt |Gui |Menu|Ctrl| |Lef|Dow|Rig| | 0| .| | - * `-----------------------------------------------------------' `-----------' `---------------' - */ - KEYMAP( - ESC, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, PSCR,SLCK,PAUS, - GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, BSPC, INS, HOME,PGUP, NLCK,PSLS,PAST,PMNS, - TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC,RBRC,BSLS, DEL, END, PGDN, P7, P8, P9, - CAPS,A, S, D, F, G, H, J, K, L, SCLN,QUOT, ENT, P4, P5, P6, PPLS, - LSFT,Z, X, C, V, B, N, M, COMM,DOT, SLSH, RSFT, UP, P1, P2, P3, - LCTL,LGUI,LALT, SPC, RALT,RGUI,APP, RCTL, LEFT,DOWN,RGHT, P0, PDOT,PENT - ), - - /* 1: Colemak http://colemak.com - * ,-----------------------------------------------------------. - * | `| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Backspa| - * |-----------------------------------------------------------| - * |Tab | Q| W| F| P| G| J| L| U| Y| ;| [| ]| \| - * |-----------------------------------------------------------| - * |BackSp| A| R| S| T| D| H| N| E| I| O| '|Return | - * |-----------------------------------------------------------| - * |Shift | Z| X| C| V| B| K| M| ,| ,| /|Shift | - * |-----------------------------------------------------------| - * |Ctrl |Gui |Alt | Space |Alt |Gui |Menu|Ctrl| - * `----------------------------------------------------------' - */ - KEYMAP( - ESC, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, PSCR,SLCK,PAUS, - GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, BSPC, INS, HOME,PGUP, NLCK,PSLS,PAST,PMNS, - TAB, Q, W, F, P, G, J, L, U, Y, SCLN,LBRC,RBRC,BSLS, DEL, END, PGDN, P7, P8, P9, - BSPC,A, R, S, T, D, H, N, E, I, O, QUOT, ENT, P4, P5, P6, PPLS, - LSFT,Z, X, C, V, B, K, M, COMM,DOT, SLSH, RSFT, UP, P1, P2, P3, - LCTL,LGUI,LALT, SPC, RALT,RGUI,APP, RCTL, LEFT,DOWN,RGHT, P0, PDOT,PENT - ), - - /* 2: Dvorak http://en.wikipedia.org/wiki/Dvorak_Simplified_Keyboard - * ,-----------------------------------------------------------. - * | `| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| [| ]|Backspa| - * |-----------------------------------------------------------| - * |Tab | '| ,| .| P| Y| F| G| C| R| L| /| =| \| - * |-----------------------------------------------------------| - * |BackSp| A| O| E| U| I| D| H| T| N| S| -|Return | - * |-----------------------------------------------------------| - * |Shift | ;| Q| J| K| X| B| M| Wl V| Z|Shift | - * |-----------------------------------------------------------| - * |Ctrl |Gui |Alt | Space |Alt |Gui |Menu|Ctrl| - * `-----------------------------------------------------------' - */ - KEYMAP( - ESC, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, PSCR,SLCK,PAUS, - GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, LBRC,RBRC,BSPC, INS, HOME,PGUP, NLCK,PSLS,PAST,PMNS, - TAB, QUOT,COMM,DOT, P, Y, F, G, C, R, L, SLSH,EQL, BSLS, DEL, END, PGDN, P7, P8, P9, - CAPS,A, O, E, U, I, D, H, T, N, S, MINS, ENT, P4, P5, P6, PPLS, - LSFT,SCLN,Q, J, K, X, B, M, W, V, Z, RSFT, UP, P1, P2, P3, - LCTL,LGUI,LALT, SPC, RALT,RGUI,APP, RCTL, LEFT,DOWN,RGHT, P0, PDOT,PENT - ), - - /* 3: Workman http://viralintrospection.wordpress.com/2010/09/06/a-different-philosophy-in-designing-keyboard-layouts/ - * ,-----------------------------------------------------------. - * | `| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Backspa| - * |-----------------------------------------------------------| - * |Tab | Q| D| R| W| B| J| F| U| P| ;| [| ]| \| - * |-----------------------------------------------------------| - * |CapsLo| A| S| H| T| G| Y| N| E| O| I| '|Return | - * |-----------------------------------------------------------| - * |Shift | Z| X| M| C| V| K| L| ,| ,| /|Shift | - * |-----------------------------------------------------------| - * |Ctrl |Gui |Alt | Space |Alt |Gui |Menu|Ctrl| - * `-----------------------------------------------------------' - */ - KEYMAP( - ESC, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, PSCR,SLCK,PAUS, - GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, BSPC, INS, HOME,PGUP, NLCK,PSLS,PAST,PMNS, - TAB, Q, D, R, W, B, J, F, U, P, SCLN,LBRC,RBRC,BSLS, DEL, END, PGDN, P7, P8, P9, - BSPC,A, S, H, T, G, Y, N, E, O, I, QUOT, ENT, P4, P5, P6, PPLS, - LSFT,Z, X, M, C, V, K, L, COMM,DOT, SLSH, RSFT, UP, P1, P2, P3, - LCTL,LGUI,LALT, SPC, RALT,RGUI,APP, RCTL, LEFT,DOWN,RGHT, P0, PDOT,PENT - ), -}; - -const uint16_t PROGMEM fn_actions[] = { -}; diff --git a/converter/usb_usb/keymap_common.c b/converter/usb_usb/keymap_common.c deleted file mode 100644 index 8ab5ba923ed..00000000000 --- a/converter/usb_usb/keymap_common.c +++ /dev/null @@ -1,31 +0,0 @@ -/* -Copyright 2014 Jun Wako - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ -#include "keymap_common.h" -#include "progmem.h" - - -/* translates key to keycode */ -uint8_t keymap_key_to_keycode(uint8_t layer, keypos_t key) -{ - return pgm_read_byte(&keymaps[(layer)][(key.row)][(key.col)]); -} - -/* translates Fn keycode to action */ -action_t keymap_fn_to_action(uint8_t keycode) -{ - return (action_t){ .code = pgm_read_word(&fn_actions[FN_INDEX(keycode)]) }; -} diff --git a/converter/usb_usb/keymap_common.h b/converter/usb_usb/keymap_common.h deleted file mode 100644 index 435d83fdc7a..00000000000 --- a/converter/usb_usb/keymap_common.h +++ /dev/null @@ -1,77 +0,0 @@ -/* -Copyright 2014 Jun Wako - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ -#ifndef KEYMAP_COMMON_H -#define KEYMAP_COMMON_H - -#include -#include -#include "keycode.h" -#include "action.h" -#include "action_macro.h" -#include "report.h" -#include "print.h" -#include "debug.h" -#include "keymap.h" - - -extern const uint8_t keymaps[][MATRIX_ROWS][MATRIX_COLS]; -extern const uint16_t fn_actions[]; - - -#define KEYMAP( \ - K29,K3A,K3B,K3C,K3D,K3E,K3F,K40,K41,K42,K43,K44,K45, K46,K47,K48, \ - K35,K1E,K1F,K20,K21,K22,K23,K24,K25,K26,K27,K2D,K2E,K2A, K49,K4A,K4B, K53,K54,K55,K56, \ - K2B,K14,K1A,K08,K15,K17,K1C,K18,K0C,K12,K13,K2F,K30,K31, K4C,K4D,K4E, K5F,K60,K61, \ - K39,K04,K16,K07,K09,K0A,K0B,K0D,K0E,K0F,K33,K34, K28, K5C,K5D,K5E,K57, \ - KE1,K1D,K1B,K06,K19,K05,K11,K10,K36,K37,K38, KE5, K52, K59,K5A,K5B, \ - KE0,KE3,KE2, K2C, KE6,KE7,K65,KE4, K50,K51,K4F, K62, K63,K58 \ -) { \ - { KC_NO, KC_NO, KC_NO, KC_NO, KC_##K04, KC_##K05, KC_##K06, KC_##K07 }, /* 00-07 */ \ - { KC_##K08, KC_##K09, KC_##K0A, KC_##K0B, KC_##K0C, KC_##K0D, KC_##K0E, KC_##K0F }, /* 08-0F */ \ - { KC_##K10, KC_##K11, KC_##K12, KC_##K13, KC_##K14, KC_##K15, KC_##K16, KC_##K17 }, /* 10-17 */ \ - { KC_##K18, KC_##K19, KC_##K1A, KC_##K1B, KC_##K1C, KC_##K1D, KC_##K1E, KC_##K1F }, /* 18-1F */ \ - { KC_##K20, KC_##K21, KC_##K22, KC_##K23, KC_##K24, KC_##K25, KC_##K26, KC_##K27 }, /* 20-27 */ \ - { KC_##K28, KC_##K29, KC_##K2A, KC_##K2B, KC_##K2C, KC_##K2D, KC_##K2E, KC_##K2F }, /* 28-2F */ \ - { KC_##K30, KC_##K31, KC_NO, KC_##K33, KC_##K34, KC_##K35, KC_##K36, KC_##K37 }, /* 30-37 */ \ - { KC_##K38, KC_##K39, KC_##K3A, KC_##K3B, KC_##K3C, KC_##K3D, KC_##K3E, KC_##K3F }, /* 38-3F */ \ - { KC_##K40, KC_##K41, KC_##K42, KC_##K43, KC_##K44, KC_##K45, KC_##K46, KC_##K47 }, /* 40-47 */ \ - { KC_##K48, KC_##K49, KC_##K4A, KC_##K4B, KC_##K4C, KC_##K4D, KC_##K4E, KC_##K4F }, /* 48-4F */ \ - { KC_##K50, KC_##K51, KC_##K52, KC_##K53, KC_##K54, KC_##K55, KC_##K56, KC_##K57 }, /* 50-57 */ \ - { KC_##K58, KC_##K59, KC_##K5A, KC_##K5B, KC_##K5C, KC_##K5D, KC_##K5E, KC_##K5F }, /* 58-5F */ \ - { KC_##K60, KC_##K61, KC_##K62, KC_##K63, KC_NO, KC_##K65, KC_NO, KC_NO }, /* 60-67 */ \ - { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, /* 68-6F */ \ - { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, /* 70-77 */ \ - { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, /* 78-7F */ \ - { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, /* 80-87 */ \ - { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, /* 88-8F */ \ - { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, /* 90-97 */ \ - { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, /* 98-9F */ \ - { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, /* A0-A7 */ \ - { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, /* A8-AF */ \ - { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, /* B0-B7 */ \ - { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, /* B8-BF */ \ - { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, /* C0-C7 */ \ - { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, /* C8-CF */ \ - { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, /* D0-D7 */ \ - { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, /* D8-DF */ \ - { KC_##KE0, KC_##KE1, KC_##KE2, KC_##KE3, KC_##KE4, KC_##KE5, KC_##KE6, KC_##KE7 }, /* E0-E7 */ \ - { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, /* E8-EF */ \ - { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, /* F0-F7 */ \ - { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, /* F8-FF */ \ -} - -#endif diff --git a/converter/usb_usb/keymap_hasu.c b/converter/usb_usb/keymap_hasu.c deleted file mode 100644 index de19e230762..00000000000 --- a/converter/usb_usb/keymap_hasu.c +++ /dev/null @@ -1,158 +0,0 @@ -#include "keymap_common.h" - -const uint8_t keymaps[][MATRIX_ROWS][MATRIX_COLS] PROGMEM = { - /* Layer 0: Default Layer - * ,-----------------------------------------------------------. - * |Esc| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =| \| `| - * |-----------------------------------------------------------| - * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]|Backs| - * |-----------------------------------------------------------| - * |Contro| A| S| D| F| G| H| J| K| L|Fn3| '|Fn6 | - * |-----------------------------------------------------------| - * |Fn7 | Z| X| C| V| B| N| M| ,| .|Fn2|Shift |Fn1| - * `-----------------------------------------------------------' - * |Gui|Alt | Fn4 |Fn5 |Gui| - * `-------------------------------------------' - */ - [0] = \ - KEYMAP( - ESC, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, PSCR,SLCK,BRK, - ESC, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, BSPC, INS, HOME,PGUP, NLCK,PSLS,PAST,PMNS, - TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC,RBRC,BSLS, DEL, END, PGDN, P7, P8, P9, - LCTL,A, S, D, F, G, H, J, K, L, FN3, QUOT, FN6, P4, P5, P6, PPLS, - FN7, Z, X, C, V, B, N, M, COMM,DOT, FN2, RSFT, UP, P1, P2, P3, - LCTL,LGUI,LALT, FN4, RALT,FN5, FN5, FN1, LEFT,DOWN,RGHT, P0, PDOT,PENT - ), - - /* Layer 1: HHKB mode[HHKB Fn] - * ,-----------------------------------------------------------. - * |Esc| F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12|Ins|Del| - * |-----------------------------------------------------------| - * |Caps | | | | | | | |Psc|Slk|Pus|Up | |Backs| - * |-----------------------------------------------------------| - * |Contro|VoD|VoU|Mut| | | *| /|Hom|PgU|Lef|Rig|Enter | - * |-----------------------------------------------------------| - * |Shift | | | | | | +| -|End|PgD|Dow|Shift | | - * `-----------------------------------------------------------' - * |Gui|Alt | Space |Alt |Gui| - * `-------------------------------------------' - */ - [1] = \ - KEYMAP( - ESC, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, PSCR,SLCK,BRK, - GRV, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, DEL, INS, HOME,PGUP, NLCK,PSLS,PAST,PMNS, - CAPS,NO, NO, NO, NO, NO, NO, NO, PSCR,SLCK,PAUS, UP, NO, BSLS, DEL, END, PGDN, P7, P8, P9, - LCTL,VOLD,VOLU,MUTE,NO, NO, PAST,PSLS,HOME,PGUP,LEFT,RGHT, ENT, P4, P5, P6, PPLS, - LSFT,NO, NO, NO, NO, NO, PPLS,PMNS,END, PGDN,DOWN, RSFT, UP, P1, P2, P3, - LCTL,LGUI,LALT, SPC, RALT,RGUI,APP, TRNS, LEFT,DOWN,RGHT, P0, PDOT,PENT - ), - - /* Layer 2: Vi mode[Slash] - * ,-----------------------------------------------------------. - * |Esc| F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12|Ins|Del| - * |-----------------------------------------------------------| - * |Tab |Hom|PgD|Up |PgU|End|Hom|PgD|PgUlEnd| | | |Backs| - * |-----------------------------------------------------------| - * |Contro| |Lef|Dow|Rig| |Lef|Dow|Up |Rig| | |Return | - * |-----------------------------------------------------------| - * |Shift | | | | | |Hom|PgD|PgUlEnd|Fn0|Shift | | - * `-----------------------------------------------------------' - * |Gui|Alt | Space |Alt |Gui| - * `-------------------------------------------' - */ - [2] = \ - KEYMAP( - ESC, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, PSCR,SLCK,BRK, - GRV, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, DEL, INS, HOME,PGUP, NLCK,PSLS,PAST,PMNS, - TAB, HOME,PGDN,UP, PGUP,END, HOME,PGDN,PGUP,END, NO, NO, NO, BSLS, DEL, END, PGDN, P7, P8, P9, - LCTL,NO, LEFT,DOWN,RGHT,NO, LEFT,DOWN,UP, RGHT,NO, NO, ENT, P4, P5, P6, PPLS, - LSFT,NO, NO, NO, NO, NO, HOME,PGDN,PGUP,END, TRNS, RSFT, UP, P1, P2, P3, - LCTL,LGUI,LALT, SPC, RALT,RGUI,APP, RCTL, LEFT,DOWN,RGHT, P0, PDOT,PENT - ), - - /* Layer 3: Mouse mode(IJKL)[Semicolon] - * ,-----------------------------------------------------------. - * |Esc| F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12|Ins|Del| - * |-----------------------------------------------------------| - * |Tab | | | | | |MwL|MwD|McU|MwU|MwR|Wbk|Wfr|Alt-T| - * |-----------------------------------------------------------| - * |Contro| | | | | |Mb2|McL|McD|McR|Fn | |Return | - * |-----------------------------------------------------------| - * |Shift | | | | |Mb3|Mb2|Mb1|Mb4|Mb5| |Shift | | - * `-----------------------------------------------------------' - * |Gui |Alt | Mb1 |Fn |Fn | - * `--------------------------------------------' - * Mc: Mouse Cursor / Mb: Mouse Button / Mw: Mouse Wheel8 - */ - [3] = \ - KEYMAP( - ESC, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, PSCR,SLCK,BRK, - GRV, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, FN8, INS, HOME,PGUP, NLCK,PSLS,PAST,PMNS, - FN8, NO, NO, NO, NO, NO, WH_L,WH_D,MS_U,WH_U,WH_R,WBAK,WFWD,FN8, DEL, END, PGDN, P7, P8, P9, - LCTL,ACL0,ACL1,ACL2,ACL2,NO, NO, MS_L,MS_D,MS_R,TRNS,NO, ENT, P4, P5, P6, PPLS, - LSFT,NO, NO, NO, NO, BTN3,BTN2,BTN1,BTN4,BTN5,NO, RSFT, UP, P1, P2, P3, - LCTL,LGUI,LALT, BTN1, RALT,TRNS,TRNS,RCTL, LEFT,DOWN,RGHT, P0, PDOT,PENT - ), - - /* Layer 5: Mouse mode(IJKL)[Space] - * ,-----------------------------------------------------------. - * |Esc| F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12|Ins|Del| - * |-----------------------------------------------------------| - * |Tab | | | | | |MwL|MwD|McU|MwU|MwR|Wbk|Wfr|Alt-T| - * |-----------------------------------------------------------| - * |Contro| | | | | |Mb2|McL|McD|McR|Mb1| |Return | - * |-----------------------------------------------------------| - * |Shift | | | | |Mb3|Mb2|Mb1|Mb4|Mb5| |Shift | | - * `-----------------------------------------------------------' - * |Gui |Alt | Mb1 |Fn |Fn | - * `--------------------------------------------' - * Mc: Mouse Cursor / Mb: Mouse Button / Mw: Mouse Wheel8 - */ - [4] = \ - KEYMAP( - ESC, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, PSCR,SLCK,BRK, - GRV, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, FN8, INS, HOME,PGUP, NLCK,PSLS,PAST,PMNS, - FN8, NO, NO, NO, NO, NO, WH_L,WH_D,MS_U,WH_U,WH_R,WBAK,WFWD,FN8, DEL, END, PGDN, P7, P8, P9, - LCTL,ACL0,ACL1,ACL2,ACL2,NO, NO, MS_L,MS_D,MS_R,BTN1,NO, ENT, P4, P5, P6, PPLS, - LSFT,NO, NO, NO, NO, BTN3,BTN2,BTN1,BTN4,BTN5,NO, RSFT, UP, P1, P2, P3, - LCTL,LGUI,LALT, TRNS, RALT,RGUI,APP, RCTL, LEFT,DOWN,RGHT, P0, PDOT,PENT - ), -}; - - -/* - * Macro definition - */ -enum macro_id { - ALT_TAB, -}; -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - switch (id) { - case ALT_TAB: - return (record->event.pressed ? - MACRO( D(LALT), D(TAB), END ) : - MACRO( U(TAB), END )); - } - return MACRO_NONE; -} - - -/* - * Fn action definition - */ -#ifdef KEYMAP_SECTION_ENABLE -const uint16_t fn_actions[] __attribute__ ((section (".keymap.fn_actions"))) = { -#else -const uint16_t fn_actions[] PROGMEM = { -#endif - [0] = ACTION_DEFAULT_LAYER_SET(0), // Default layer(not used) - [1] = ACTION_LAYER_TAP_TOGGLE(1), // HHKB layer(toggle with 5 taps) - [2] = ACTION_LAYER_TAP_KEY(2, KC_SLASH), // Cursor layer with Slash* - [3] = ACTION_LAYER_TAP_KEY(3, KC_SCLN), // Mousekey layer with Semicolon* - [4] = ACTION_LAYER_TAP_KEY(4, KC_SPC), // Mousekey layer with Space - [5] = ACTION_LAYER_MOMENTARY(3), // Mousekey layer - [6] = ACTION_MODS_TAP_KEY(MOD_RCTL, KC_ENT), // RControl with tap Enter - [7] = ACTION_MODS_ONESHOT(MOD_LSFT), // Oneshot Shift - [8] = ACTION_MACRO(ALT_TAB), // Application switching -}; diff --git a/converter/usb_usb/keymap_spacefn.c b/converter/usb_usb/keymap_spacefn.c deleted file mode 100644 index bffd2bc606f..00000000000 --- a/converter/usb_usb/keymap_spacefn.c +++ /dev/null @@ -1,61 +0,0 @@ -/* - * SpaceFN layout - * http://geekhack.org/index.php?topic=51069.0 - */ -#include "keymap_common.h" - - -const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - /* 0: default - * ,---. ,---------------. ,---------------. ,---------------. ,-----------. ,-----------. - * |Esc| |F1 |F2 |F3 |F4 | |F5 |F6 |F7 |F8 | |F9 |F10|F11|F12| |PrS|ScL|Pau| |Pwr|Slp|Wak| - * `---' `---------------' `---------------' `---------------' `-----------' `-----------' - * ,-----------------------------------------------------------. ,-----------. ,---------------. - * | `| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Backspa| |Ins|Hom|PgU| |NmL| /| *| -| - * |-----------------------------------------------------------| |-----------| |---------------| - * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \| |Del|End|PgD| | 7| 8| 9| | - * |-----------------------------------------------------------| `-----------' |-----------| +| - * |CapsLo| A| S| D| F| G| H| J| K| L| ;| '|Return | | 4| 5| 6| | - * |-----------------------------------------------------------| ,---. |---------------| - * |Shift | Z| X| C| V| B| N| M| ,| ,| /|Shift | |Up | | 1| 2| 3| | - * |-----------------------------------------------------------| ,-----------. |-----------|Ent| - * |Ctrl |Gui |Alt | Space |Alt |Gui |Menu|Ctrl| |Lef|Dow|Rig| | 0| .| | - * `-----------------------------------------------------------' `-----------' `---------------' - */ - KEYMAP( - ESC, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, PSCR,SLCK,BRK, - ESC, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, BSPC, INS, HOME,PGUP, NLCK,PSLS,PAST,PMNS, - TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC,RBRC,BSLS, DEL, END, PGDN, P7, P8, P9, - CAPS,A, S, D, F, G, H, J, K, L, SCLN,QUOT, ENT, P4, P5, P6, PPLS, - LSFT,Z, X, C, V, B, N, M, COMM,DOT, SLSH, RSFT, UP, P1, P2, P3, - LCTL,LGUI,LALT, FN0, RALT,RGUI,APP, RCTL, LEFT,DOWN,RGHT, P0, PDOT,PENT - ), - - /* 1: SpaceFN - * ,-----------------------------------------------------------. - * |` | F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12|Delete | - * |-----------------------------------------------------------| - * | | | |Esc| | | |Hom|Up |End|Psc|Slk|Pau|Ins | - * |-----------------------------------------------------------| - * | | | | | | |PgU|Lef|Dow|Rig| | | | - * |-----------------------------------------------------------| - * | | | | | |Spc|PgD|` |~ | |Men| | - * |-----------------------------------------------------------| - * | | | | | | | | | - * `-----------------------------------------------------------' - */ - KEYMAP( - ESC, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, PSCR,SLCK,BRK, - GRV, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, DEL, INS, HOME,PGUP, NLCK,PSLS,PAST,PMNS, - TRNS,TRNS,TRNS,ESC, TRNS,TRNS,TRNS,HOME,UP, END, PSCR,SLCK,PAUS,INS, DEL, END, PGDN, P7, P8, P9, - TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,PGUP,LEFT,DOWN,RGHT,TRNS,TRNS, TRNS, P4, P5, P6, PPLS, - TRNS,TRNS,TRNS,TRNS,TRNS,SPC, PGDN,GRV, FN1, TRNS,APP, TRNS, UP, P1, P2, P3, - TRNS,TRNS,TRNS, TRNS, TRNS,TRNS,TRNS,TRNS, LEFT,DOWN,RGHT, P0, PDOT,PENT - ), -}; - -const uint16_t PROGMEM fn_actions[] = { - [0] = ACTION_LAYER_TAP_KEY(1, KC_SPACE), - [1] = ACTION_MODS_KEY(MOD_LSFT, KC_GRV), // tilde -}; - diff --git a/converter/usb_usb/main.cpp b/converter/usb_usb/main.cpp deleted file mode 100644 index 652c8057346..00000000000 --- a/converter/usb_usb/main.cpp +++ /dev/null @@ -1,132 +0,0 @@ -#include -#include -#include -#include - -// USB HID host -#include "Usb.h" -#include "usbhub.h" -#include "hid.h" -#include "hidboot.h" -#include "parser.h" - -// LUFA -#include "lufa.h" - -#include "timer.h" -#include "sendchar.h" -#include "debug.h" -#include "keyboard.h" -#include "led.h" - - -/* LED ping configuration */ -#define TMK_LED -//#define LEONARDO_LED -#if defined(TMK_LED) -// For TMK converter and Teensy -#define LED_TX_INIT (DDRD |= (1<<6)) -#define LED_TX_ON (PORTD |= (1<<6)) -#define LED_TX_OFF (PORTD &= ~(1<<6)) -#define LED_TX_TOGGLE (PORTD ^= (1<<6)) -#elif defined(LEONARDO_LED) -// For Leonardo(TX LED) -#define LED_TX_INIT (DDRD |= (1<<5)) -#define LED_TX_ON (PORTD &= ~(1<<5)) -#define LED_TX_OFF (PORTD |= (1<<5)) -#define LED_TX_TOGGLE (PORTD ^= (1<<5)) -#else -#define LED_TX_INIT -#define LED_TX_ON -#define LED_TX_OFF -#define LED_TX_TOGGLE -#endif - - -static void LUFA_setup(void) -{ - /* Disable watchdog if enabled by bootloader/fuses */ - MCUSR &= ~(1 << WDRF); - wdt_disable(); - - /* Disable clock division */ - clock_prescale_set(clock_div_1); - - // Leonardo needs. Without this USB device is not recognized. - USB_Disable(); - - USB_Init(); - - // for Console_Task - USB_Device_EnableSOFEvents(); - print_set_sendchar(sendchar); -} - - - -/* - * USB Host Shield HID keyboard - */ -USB usb_host; -USBHub hub1(&usb_host); -HIDBoot kbd(&usb_host); -KBDReportParser kbd_parser; - - -void led_set(uint8_t usb_led) -{ - kbd.SetReport(0, 0, 2, 0, 1, &usb_led); -} - - - -int main(void) -{ - // LED for debug - LED_TX_INIT; - LED_TX_ON; - - debug_enable = true; - debug_keyboard = true; - - host_set_driver(&lufa_driver); - keyboard_init(); - - LUFA_setup(); - - // USB Host Shield setup - usb_host.Init(); - kbd.SetReportParser(0, (HIDReportParser*)&kbd_parser); - - /* NOTE: Don't insert time consuming job here. - * It'll cause unclear initialization failure when DFU reset(worm start). - */ - sei(); - - // wait for startup of sendchar routine - while (USB_DeviceState != DEVICE_STATE_Configured) ; - if (debug_enable) { - _delay_ms(1000); - } - - debug("init: done\n"); - -uint16_t timer; - for (;;) { - keyboard_task(); - -timer = timer_read(); - usb_host.Task(); -timer = timer_elapsed(timer); -if (timer > 100) { - debug("host.Task: "); debug_hex16(timer); debug("\n"); -} - -#if !defined(INTERRUPT_CONTROL_ENDPOINT) - // LUFA Task for control request - USB_USBTask(); -#endif - } - - return 0; -} diff --git a/converter/usb_usb/matrix.c b/converter/usb_usb/matrix.c deleted file mode 100644 index 83d5ab6c831..00000000000 --- a/converter/usb_usb/matrix.c +++ /dev/null @@ -1,133 +0,0 @@ -/* -Copyright 2011 Jun Wako - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#include -#include -#include "usb_hid.h" -#include "keycode.h" -#include "util.h" -#include "print.h" -#include "debug.h" -#include "matrix.h" - -/* KEY CODE to Matrix - * - * HID keycode(1 byte): - * Higher 5 bits indicates ROW and lower 3 bits COL. - * - * 7 6 5 4 3 2 1 0 - * +---------------+ - * | ROW | COL | - * +---------------+ - * - * Matrix space(32 * 8): - * 01234567 - * 0 +--------+ - * : | | - * : | | - * 31 +--------+ - */ -#define ROW_MASK 0xF8 -#define COL_MASK 0x07 -#define CODE(row, col) (((row) << 3) | (col)) -#define ROW(code) (((code) & ROW_MASK) >> 3) -#define COL(code) ((code) & COL_MASK) -#define ROW_BITS(code) (1 << COL(code)) - - -uint8_t matrix_rows(void) { return MATRIX_ROWS; } -uint8_t matrix_cols(void) { return MATRIX_COLS; } -void matrix_init(void) {} -bool matrix_has_ghost(void) { return false; } - -static bool matrix_is_mod =false; - -uint8_t matrix_scan(void) { - static uint16_t last_time_stamp = 0; - - if (last_time_stamp != usb_hid_time_stamp) { - last_time_stamp = usb_hid_time_stamp; - matrix_is_mod = true; - } else { - matrix_is_mod = false; - } - return 1; -} - -bool matrix_is_modified(void) { - - return matrix_is_mod; -} - -bool matrix_is_on(uint8_t row, uint8_t col) { - uint8_t code = CODE(row, col); - - if (IS_MOD(code)) { - if (usb_hid_keyboard_report.mods & ROW_BITS(code)) { - return true; - } - } - for (uint8_t i = 0; i < KEYBOARD_REPORT_KEYS; i++) { - if (usb_hid_keyboard_report.keys[i] == code) { - return true; - } - } - return false; -} - -uint8_t matrix_get_row(uint8_t row) { - uint8_t row_bits = 0; - - if (IS_MOD(CODE(row, 0)) && usb_hid_keyboard_report.mods) { - row_bits |= usb_hid_keyboard_report.mods; - } - - for (uint8_t i = 0; i < KEYBOARD_REPORT_KEYS; i++) { - if (IS_ANY(usb_hid_keyboard_report.keys[i])) { - if (row == ROW(usb_hid_keyboard_report.keys[i])) { - row_bits |= ROW_BITS(usb_hid_keyboard_report.keys[i]); - } - } - } - return row_bits; -} - -uint8_t matrix_key_count(void) { - uint8_t count = 0; - - count += bitpop(usb_hid_keyboard_report.mods); - for (uint8_t i = 0; i < KEYBOARD_REPORT_KEYS; i++) { - if (IS_ANY(usb_hid_keyboard_report.keys[i])) { - count++; - } - } - return count; -} - -void matrix_print(void) { - print("\nr/c 01234567\n"); - for (uint8_t row = 0; row < matrix_rows(); row++) { - phex(row); print(": "); - pbin_reverse(matrix_get_row(row)); -#ifdef MATRIX_HAS_GHOST - if (matrix_has_ghost_in_row(row)) { - print(" -# to submit bug reports. -#AVRDUDE_VERBOSE = -v -v - -AVRDUDE_FLAGS = -p $(MCU) -P $(AVRDUDE_PORT) -c $(AVRDUDE_PROGRAMMER) -#AVRDUDE_FLAGS = -p $(MCU) -c $(AVRDUDE_PROGRAMMER) -AVRDUDE_FLAGS += $(AVRDUDE_NO_VERIFY) -AVRDUDE_FLAGS += $(AVRDUDE_VERBOSE) -AVRDUDE_FLAGS += $(AVRDUDE_ERASE_COUNTER) - -#PROGRAM_CMD = $(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM) -#PROGRAM_CMD = teensy_loader_cli -mmcu=$(MCU) -w -v $(TARGET).hex -PROGRAM_CMD = dfu-programmer atmega32u4 flash $(TARGET).hex - - -# Search Path -VPATH += $(TARGET_DIR) -VPATH += $(TMK_DIR) - - -include $(TMK_DIR)/protocol/pjrc.mk -include $(TMK_DIR)/protocol.mk -include $(TMK_DIR)/common.mk -include $(TMK_DIR)/rules.mk diff --git a/converter/x68k_usb/README b/converter/x68k_usb/README deleted file mode 100644 index 516fcd249f8..00000000000 --- a/converter/x68k_usb/README +++ /dev/null @@ -1,151 +0,0 @@ -X68000 to USB keyboard protocol converter -========================================= -SHARP X68000 is a hobby computer released in Japan.(1987-93) -http://en.wikipedia.org/wiki/Sharp_X68000 - -X68000 keyboard has ALPS linear switches. -- DSETK0016CE01 green linear -- DSETK0022CE02 yellow linear -- DSETK0023CE03 yellow linear - - -Hardware --------- -Target MCU is ATMega32u4 but other USB capable AVR will also work. -You can use PJRC Teensy as development board. - http://www.pjrc.com/teensy/ - -Wiring: - Mini-DIN Teensy - ----------------------------------------------------- - pin1 +5V VCC - pin2 MOUSE - - pin3 RXD PD2(RXD) - pin4 TXD PD3(TXD) NOTE: Not supported yet. - pin5 READY - - pin6 REMOTE - - pin7 GND GND - - -Firmware --------- -Build: - $ cd x68k_usb - $ make - -And load the binary to MCU with your favorite programmer. -If you use Teensy you can load with PJRC Teensy Loader tool. - http://www.pjrc.com/teensy/loader.html - - -* * * * * * * * * * * * * * * * * * - - -X68000 Keyboard Protocol -======================== -http://kyoutan.jpn.org/uts/pc/pic/x68key/ - - -Connector ---------- -Mini DIN 7pin(female connector on computer side) - 7 6 5 - o o o - 4 o = o 3 - o o - 2 1 - - Mini-DIN - ------------- - pin1 +5V - pin2 MOUSE - pin3 RXD - pin4 TXD - pin5 READY - pin6 REMOTE - pin7 GND - - -Signaling ---------- -- TXD,RXD - Asynchronous, 2400baud, 1-startbit(L), 8-databit, 1-stopbit(H) - -- READY - ready/not ready(1/0) - - -Data from keyboard ------------------- -bit 7 make/break flag(0/1) -bit 6-0 following scan code - - -Data from computer ------------------- -- LED control ON/OFF(0/1) - bit 7 1(fixed) - bit 6 全角 - bit 5 ひらがな - bit 4 INS - bit 3 CAPS - bit 2 コード入力 - bit 1 ローマ字 - bit 0 かな - -- Repeat delay - bit 7 0(fixed) - bit 6 1(fixed) - bit 5 1(fixed) - bit 4 0(fixed) - bit 3-0 delay - REPEAT_DELAY = 200+delay*100 ms - default: 500ms - -- Repeat time - bit 7 0(fixed) - bit 6 1(fixed) - bit 5 1(fixed) - bit 4 1(fixed) - bit 3-0 time - REPEAT_TIME = 30+time^2*5 ms - default: 110ms - - -Scan Codes ----------- -,---. ,---. ,-------------------, ,-------------------. ,-----------. ,---------------. -| 61| | 62| | 63| 64| 65| 66| 67| | 68| 69| 6A| 6B| 6C| | 5A| 5B| 5C| | 5D| 52| 53| 54| -`---' `---' `-------------------' `-------------------' `-----------' `---------------' -,-----------------------------------------------------------. ,-----------. ,---------------. -| 01| 02| 03| 04| 05| 06| 07| 08| 09| 0A| 0B| 0C| 0D| 0E| 0F| | 36| 5E| 37| | 3F| 40| 41| 42| -|-----------------------------------------------------------| |------------ |---------------| -| 10 | 11| 12| 13| 14| 15| 16| 17| 18| 19| 1A| 1B| 1C| | | 38| 39| 3A| | 43| 44| 45| 46| -|------------------------------------------------------. 1D | `---=====---' |---------------| -| 71 | 1E| 1F| 20| 21| 2l| 23| 24| 25| 26| 27| 28| 29| | ___| 3C|___ | 47| 48| 49| 4A| -|-----------------------------------------------------------| | 3B|---| 3D| |-----------|---| -| 70 | 2A| 2B| 2C| 2D| 2E| 2F| 30| 31| 32| 33| 34| 70 | `---| 3E|---' | 4B| 4C| 4D| | -`-----------------------------------------------------------| .---=====---. |-----------| 4E| - | 5F| 55 | 56 | 35 | 57 | 58 | 59 | 60| | 72 | 73 | | 4F| 50| 51| | - `---------------------------------------------' `-----------' `---------------' - - - -LED Special Functions ---------------------- -http://homepage2.nifty.com/m_kamada/docs/unlistedx68k.htm#keyboard - -1. Random Illumination - Plug in with pressing F1, F2 and F3. - -2. Sequential Illumination - Plug in with pressing 記号入力(52), 登録(53) and HELP. - -3. Scan code Display - Plug in with pressing かな(5A), ローマ字(5B) and コード入力(5C). - You can see its scan code on LEDs by pressing a key. - +---------------------------------------------------+ - |bit|6 |5 |4 |3 |2 |1 |0 | - |---+----+--------+---+----+----------+--------+----| - |LED|全角|ひらがな|INS|CAPS|コード入力|ローマ字|かな| - +---------------------------------------------------+ diff --git a/converter/x68k_usb/config_pjrc.h b/converter/x68k_usb/config_pjrc.h deleted file mode 100644 index c49b4a73e1d..00000000000 --- a/converter/x68k_usb/config_pjrc.h +++ /dev/null @@ -1,67 +0,0 @@ -/* -Copyright 2012 Jun Wako - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#ifndef CONFIG_H -#define CONFIG_H - - -#define VENDOR_ID 0xFEED -#define PRODUCT_ID 0x6800 -#define MANUFACTURER t.m.k. -#define PRODUCT SHARP X68000 keyboard converter -#define DESCRIPTION converts SHARP X68000 keyboard protocol into USB - - -/* matrix size */ -#define MATRIX_ROWS 16 -#define MATRIX_COLS 8 - - -/* key combination for command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LALT) | MOD_BIT(KC_RALT)) || \ - keyboard_report->mods == (MOD_BIT(KC_LGUI) | MOD_BIT(KC_RGUI)) || \ - keyboard_report->mods == (MOD_BIT(KC_LCTL) | MOD_BIT(KC_RCTL)) \ -) - -/* legacy keymap support */ -#define USE_LEGACY_KEYMAP - - -/* USART configuration - * asynchronous, 2400baud, 8-data bit, non parity, 1-stop bit, no flow control - */ -#ifdef __AVR_ATmega32U4__ - #define SERIAL_UART_BAUD 2400 - #define SERIAL_UART_DATA UDR1 - #define SERIAL_UART_UBRR ((F_CPU/(16UL*SERIAL_UART_BAUD))-1) - #define SERIAL_UART_RXD_VECT USART1_RX_vect - #define SERIAL_UART_TXD_READY (UCSR1A&(1<>8); /* baud rate */ \ - UCSR1B = (1< - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#include -#include -#include -#include "keycode.h" -#include "util.h" -#include "keymap.h" - - - - -// Following macros help you to define a keymap with the form of actual keyboard layout. - -/* X68000 Keyboard Scan codes - ,---. ,---. ,-------------------, ,-------------------. ,-----------. ,---------------. - | 61| | 62| | 63| 64| 65| 66| 67| | 68| 69| 6A| 6B| 6C| | 5A| 5B| 5C| | 5D| 52| 53| 54| - `---' `---' `-------------------' `-------------------' `-----------' `---------------' - ,-----------------------------------------------------------. ,-----------. ,---------------. - | 01| 02| 03| 04| 05| 06| 07| 08| 09| 0A| 0B| 0C| 0D| 0E| 0F| | 36| 5E| 37| | 3F| 40| 41| 42| - |-----------------------------------------------------------| |------------ |---------------| - | 10 | 11| 12| 13| 14| 15| 16| 17| 18| 19| 1A| 1B| 1C| | | 38| 39| 3A| | 43| 44| 45| 46| - |------------------------------------------------------. 1D | `---=====---' |---------------| - | 71 | 1E| 1F| 20| 21| 2l| 23| 24| 25| 26| 27| 28| 29| | ___| 3C|___ | 47| 48| 49| 4A| - |-----------------------------------------------------------| | 3B|---| 3D| |-----------|---| - | 70 | 2A| 2B| 2C| 2D| 2E| 2F| 30| 31| 32| 33| 34| 70 | `---| 3E|---' | 4B| 4C| 4D| | - `-----------------------------------------------------------| .---=====---. |-----------| 4E| - | 5F| 55 | 56 | 35 | 57 | 58 | 59 | 60| | 72 | 73 | | 4F| 50| 51| | - `---------------------------------------------' `-----------' `---------------' -*/ -#define KEYMAP( \ - K61,K62, K63,K64,K65,K66,K67, K68,K69,K6A,K6B,K6C, K5A,K5B,K5C, K5D,K52,K53,K54, \ - K01,K02,K03,K04,K05,K06,K07,K08,K09,K0A,K0B,K0C,K0D,K0E,K0F, K36,K5E,K37, K3F,K40,K41,K42, \ - K10,K11,K12,K13,K14,K15,K16,K17,K18,K19,K1A,K1B,K1C, K1D, K38,K39,K3A, K43,K44,K45,K46, \ - K71,K1E,K1F,K20,K21,K22,K23,K24,K25,K26,K27,K28,K29, K3C, K47,K48,K49,K4A, \ - K70,K2A,K2B,K2C,K2D,K2E,K2F,K30,K31,K32,K33,K34, K3B,K3E,K3D, K4B,K4C,K4D,K4E, \ - K5F,K55,K56, K35, K57,K58,K59,K60, K72, K73, K4F,K50,K51 \ -) { \ - { KC_NO, KC_##K01, KC_##K02, KC_##K03, KC_##K04, KC_##K05, KC_##K06, KC_##K07 }, \ - { KC_##K08, KC_##K09, KC_##K0A, KC_##K0B, KC_##K0C, KC_##K0D, KC_##K0E, KC_##K0F }, \ - { KC_##K10, KC_##K11, KC_##K12, KC_##K13, KC_##K14, KC_##K15, KC_##K16, KC_##K17 }, \ - { KC_##K18, KC_##K19, KC_##K1A, KC_##K1B, KC_##K1C, KC_##K1D, KC_##K1E, KC_##K1F }, \ - { KC_##K20, KC_##K21, KC_##K22, KC_##K23, KC_##K24, KC_##K25, KC_##K26, KC_##K27 }, \ - { KC_##K28, KC_##K29, KC_##K2A, KC_##K2B, KC_##K2C, KC_##K2D, KC_##K2E, KC_##K2F }, \ - { KC_##K30, KC_##K31, KC_##K32, KC_##K33, KC_##K34, KC_##K35, KC_##K36, KC_##K37 }, \ - { KC_##K38, KC_##K39, KC_##K3A, KC_##K3B, KC_##K3C, KC_##K3D, KC_##K3E, KC_##K3F }, \ - { KC_##K40, KC_##K41, KC_##K42, KC_##K43, KC_##K44, KC_##K45, KC_##K46, KC_##K47 }, \ - { KC_##K48, KC_##K49, KC_##K4A, KC_##K4B, KC_##K4C, KC_##K4D, KC_##K4E, KC_##K4F }, \ - { KC_##K50, KC_##K51, KC_##K52, KC_##K53, KC_##K54, KC_##K55, KC_##K56, KC_##K57 }, \ - { KC_##K58, KC_##K59, KC_##K5A, KC_##K5B, KC_##K5C, KC_##K5D, KC_##K5E, KC_##K5F }, \ - { KC_##K60, KC_##K61, KC_##K62, KC_##K63, KC_##K64, KC_##K65, KC_##K66, KC_##K67 }, \ - { KC_##K68, KC_##K69, KC_##K6A, KC_##K6B, KC_##K6C, KC_NO, KC_NO, KC_NO }, \ - { KC_##K70, KC_##K71, KC_##K72, KC_##K73, KC_NO, KC_NO, KC_NO, KC_NO, }, \ - { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO } \ -} - - -// Assign Fn key(0-7) to a layer to which switch with the Fn key pressed. -static const uint8_t PROGMEM fn_layer[] = { - 0, // Fn0 - 0, // Fn1 - 0, // Fn2 - 0, // Fn3 - 0, // Fn4 - 0, // Fn5 - 0, // Fn6 - 0 // Fn7 -}; - -// Assign Fn key(0-7) to a keycode sent when release Fn key without use of the layer. -// See layer.c for details. -static const uint8_t PROGMEM fn_keycode[] = { - KC_NO, // Fn0 - KC_NO, // Fn1 - KC_NO, // Fn2 - KC_NO, // Fn3 - KC_NO, // Fn4 - KC_NO, // Fn5 - KC_NO, // Fn6 - KC_NO // Fn7 -}; - - -static const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -/* X68000 Keyboard Scan codes - ,---. ,---. ,-------------------, ,-------------------. ,-----------. ,---------------. - | 61| | 62| | 63| 64| 65| 66| 67| | 68| 69| 6A| 6B| 6C| | 5A| 5B| 5C| | 5D| 52| 53| 54| - `---' `---' `-------------------' `-------------------' `-----------' `---------------' - ,-----------------------------------------------------------. ,-----------. ,---------------. - | 01| 02| 03| 04| 05| 06| 07| 08| 09| 0A| 0B| 0C| 0D| 0E| 0F| | 36| 5E| 37| | 3F| 40| 41| 42| - |-----------------------------------------------------------| |------------ |---------------| - | 10 | 11| 12| 13| 14| 15| 16| 17| 18| 19| 1A| 1B| 1C| | | 38| 39| 3A| | 43| 44| 45| 46| - |------------------------------------------------------. 1D | `---=====---' |---------------| - | 71 | 1E| 1F| 20| 21| 2l| 23| 24| 25| 26| 27| 28| 29| | ___| 3C|___ | 47| 48| 49| 4A| - |-----------------------------------------------------------| | 3B|---| 3D| |-----------|---| - | 70 | 2A| 2B| 2C| 2D| 2E| 2F| 30| 31| 32| 33| 34| 70 | `---| 3E|---' | 4B| 4C| 4D| | - `-----------------------------------------------------------| .---=====---. |-----------| 4E| - | 5F| 55 | 56 | 35 | 57 | 58 | 59 | 60| | 72 | 73 | | 4F| 50| 51| | - `---------------------------------------------' `-----------' `---------------' -*/ - /* ANSI */ - KEYMAP( - F16, F17, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, PSCR,SLCK,PAUS, CAPS,F11, F12, F13, - ESC, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, BSLS,BSPC, HOME,INS, DEL, NLCK,PSLS,PAST,PMNS, - TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC,RBRC, ENT, PGDN,PGUP,END, P7, P8, P9, PPLS, - LCTL,A, S, D, F, G, H, J, K, L, SCLN,QUOT,F18, UP, P4, P5, P6, PEQL, - LSFT,Z, X, C, V, B, N, M, COMM,DOT, SLSH,GRV, LEFT,DOWN,RGHT, P1, P2, P3, PENT, - F19, LGUI,LALT, SPC, RALT,RGUI,RCTL,APP, F14, F15, P0, PCMM,PDOT - ), - /* JIS */ - KEYMAP( - F16, F17, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, PSCR,SLCK,PAUS, CAPS,F11, F12, F13, - ESC, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, JYEN,BSPC, HOME,INS, DEL, NLCK,PSLS,PAST,PMNS, - TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC,RBRC, ENT, PGDN,PGUP,END, P7, P8, P9, PPLS, - LCTL,A, S, D, F, G, H, J, K, L, SCLN,QUOT,NUHS, UP, P4, P5, P6, PEQL, - LSFT,Z, X, C, V, B, N, M, COMM,DOT, SLSH,RO, LEFT,DOWN,RGHT, P1, P2, P3, PENT, - LGUI,LALT,MHEN, SPC, HENK,KANA,APP, ZKHK, F14, F15, P0, PCMM,PDOT - ), -}; - - -uint8_t keymap_get_keycode(uint8_t layer, uint8_t row, uint8_t col) -{ - return pgm_read_byte(&keymaps[(layer)][(row)][(col)]); -} - -uint8_t keymap_fn_layer(uint8_t index) -{ - return pgm_read_byte(&fn_layer[index]); -} - -uint8_t keymap_fn_keycode(uint8_t index) -{ - return pgm_read_byte(&fn_keycode[index]); -} diff --git a/converter/x68k_usb/led.c b/converter/x68k_usb/led.c deleted file mode 100644 index ccc38699c76..00000000000 --- a/converter/x68k_usb/led.c +++ /dev/null @@ -1,43 +0,0 @@ -/* -Copyright 2012 Jun Wako - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#include "stdint.h" -#include "serial.h" -#include "led.h" -#include "debug.h" - - -void led_set(uint8_t usb_led) -{ - /* X68000 LED bits 0: on, 1: off - * bit 7 1(fixed) - * bit 6 全角 - * bit 5 ひらがな - * bit 4 INS - * bit 3 CAPS - * bit 2 コード入力 - * bit 1 ローマ字 - * bit 0 かな - */ - uint8_t led = 0xFF; - if (usb_led&(1< - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#include -#include -#include -#include -#include "print.h" -#include "util.h" -#include "serial.h" -#include "matrix.h" -#include "debug.h" - - -/* - * Matrix Array usage: - * - * ROW: 16(4bits) - * COL: 8(3bits) - * - * 8bit wide - * +---------+ - * 0|00 ... 07| - * 1|08 ... 0F| - * :| ... | - * :| ... | - * E|70 ... 77| - * F|78 ... 7F| - * +---------+ - * - */ -static uint8_t matrix[MATRIX_ROWS]; -#define ROW(code) ((code>>3)&0xF) -#define COL(code) (code&0x07) - -static bool is_modified = false; - - -inline -uint8_t matrix_rows(void) -{ - return MATRIX_ROWS; -} - -inline -uint8_t matrix_cols(void) -{ - return MATRIX_COLS; -} - -void matrix_init(void) -{ - serial_init(); - - // initialize matrix state: all keys off - for (uint8_t i=0; i < MATRIX_ROWS; i++) matrix[i] = 0x00; - - return; -} - -uint8_t matrix_scan(void) -{ - is_modified = false; - - uint16_t code; - code = serial_recv2(); - if (code == -1) { - return 0; - } - - dprintf("%02X\n", code); - if (code&0x80) { - // break code - if (matrix_is_on(ROW(code), COL(code))) { - matrix[ROW(code)] &= ~(1<Preferences->Downloads`. +3. Install [DFU-Programmer][dfu-prog]. + +### Linux +Install AVR GCC, AVR libc, and dfu-progammer with your favorite package manager. + +Debian/Ubuntu example: + + sudo apt-get update + sudo apt-get install gcc-avr avr-libc dfu-programmer + +### Vagrant +If you have any problems building the firmware, you can try using a tool called Vagrant. It will set up a virtual computer with a known configuration that's ready-to-go for firmware building. OLKB does NOT host the files for this virtual computer. Details on how to set up Vagrant are in the [VAGRANT_GUIDE file](VAGRANT_GUIDE.md). + +## Verify Your Installation +1. If you haven't already, obtain this repository ([https://github.com/jackhumbert/qmk_firmware](https://github.com/jackhumbert/qmk_firmware)). You can either download it as a zip file and extract it, or clone it using the command line tool git or the Github Desktop application. +2. Open up a terminal or command prompt and navigate to the `qmk_firmware` folder using the `cd` command. The command prompt will typically open to your home directory. If, for example, you cloned the repository to your Documents folder, then you would type `cd Documents/qmk_firmware`. If you extracted the file from a zip, then it may be named `qmk_firmware-master` instead. +3. To confirm that you're in the correct location, you can display the contents of your current folder using the `dir` command on Windows, or the `ls` command on Linux or Mac. You should see several files, including `README.md` and a `quantum` folder. From here, you need to navigate to the appropriate folder under `keyboard/`. For example, if you're building for a Planck, run `cd keyboard/planck`. +4. Once you're in the correct keyboard-specific folder, run the `make` command. This should output a lot of information about the build process. More information about the `make` command can be found below. + +## Customizing, Building, and Deploying Your Firmware + +### The Make command + +The `make` command is how you compile the firmware into a .hex file, which can be loaded by a dfu programmer (like dfu-progammer via `make dfu`) or the [Teensy loader](https://www.pjrc.com/teensy/loader.html) (only used with Teensys). You can run `make` from the root (`/`), your keyboard folder (`/keyboard//`), or your keymap folder (`/keyboard//keymaps//`) if you have a `Makefile` there (see the example [here](/doc/keymap_makefile_example.mk)). + +By default, this will generate a _.hex file in whichever folder you run make from. These files are ignored by git, so don't worry about deleting them when committing/creating pull requests. You .hex file will also be copied into your keymap folder as `compiled.hex`, which isn't ignore by git - this is included in case first-time users are having trouble compiling, and just want to flash a layout via `make dfu-no-build`. + +* The "root" (`/`) folder is the qmk_firmware folder, in which are `doc`, `keyboard`, `quantum`, etc. +* The "keyboard" folder is any keyboard project's folder, like `/keyboard/` +* The "keymap" folder is any keymap's folder, like `/keyboard//keymaps//` + +Below is a list of the useful `make` commands in QMK: + +* `make` - cleans automatically and builds your keyboard and keymap depending on which folder you're in. This defaults to the "default" layout (unless in a keymap folder), and Planck keyboard in the root folder + * `make keyboard=` - specifies the keyboard (only to be used in root) + * `make keymap=` - specifies the keymap (only to be used in root and keyboard folder - not needed when in keymap folder) +* `make quick` - skips the clean step (only use when modifying .c code in the same project - at least one `make` is required) +* `make dfu` - (requires dfu-programmer) builds and flashes the keymap to your keyboard once placed in reset/dfu mode (button or press KC_RESET). + * `keyboard=` and `keymap=` are compatible with this +* `make dfu-no-build` - (requires dfu-programmer) same as `make dfu`, but doesn't build and uses the included `compiled.hex` to flash the keyboard +* `make all-keyboards` - builds all keymaps for all keyboards and outputs status of each (use in root) +* `make all-keyboards-default` - builds all default keymaps for all keyboards and outputs status of each (use in root) +* `make all-keymaps [keyboard=]` - builds all of the keymaps for whatever keyboard folder you're in, or specified by `` + +Other, less useful functionality: + +* `make COLOR=false` - turns off color output +* `make SILENT=true` - turns off output besides errors/warnings +* `make VERBOSE=true` - outputs all of the avr-gcc stuff (not interesting) + +### The Makefile + +There are 3 different `make` and `Makefile` locations: + +* root (`/`) +* keyboard (`/keyboard//`) +* keymap (`/keyboard//keymaps//`) + +The root contains all of the automatic keymap/keyboard stuff, is static, and shouldn't be modified. The keyboard one will contain the MCU set-up and default settings for your keyboard, and shouldn't be modified unless you are the producer of that keyboard. The keymap Makefile can be modified by users, and is optional. It is included automatically if it exists. You can see an example [here](/doc/keymap_makefile_example.mk) - the last few lines are the most important. The settings you set here will override any defaults set in the keyboard Makefile. It is required if you want to run `make` in the keymap folder. + +### The `config.h` file + +There are 2 `config.h` locations: + +* keyboard (`/keyboard//`) +* keymap (`/keyboard//keymaps//`) + +The keyboard `config.h` is included only if the keymap one doesn't exist. It's possible to included both by using this code at the top of your keymap's `config.h`: + + #include "../../config.h" + +You can then overwrite any settings, rather than having to copy and paste the whole thing. You may need to `undefine` things to prevent warnings. + + +## Helpful Tips +1. On Linux or OS X, you can run `sleep 5; make keymap= dfu` to delay building/deploying the firmware until for 5 seconds, giving you a chance to put the firmware into bootloader mode. You can change the 5 to any number of seconds. + +## Troubleshooting + + WIP diff --git a/tmk_core/doc/COPYING.GPLv2 b/doc/COPYING.GPLv2 similarity index 100% rename from tmk_core/doc/COPYING.GPLv2 rename to doc/COPYING.GPLv2 diff --git a/tmk_core/doc/COPYING.GPLv3 b/doc/COPYING.GPLv3 similarity index 100% rename from tmk_core/doc/COPYING.GPLv3 rename to doc/COPYING.GPLv3 diff --git a/keyboard/planck/CYGWIN_GUIDE.md b/doc/CYGWIN_GUIDE.md similarity index 100% rename from keyboard/planck/CYGWIN_GUIDE.md rename to doc/CYGWIN_GUIDE.md diff --git a/tmk_core/doc/FUSE.txt b/doc/FUSE.txt similarity index 100% rename from tmk_core/doc/FUSE.txt rename to doc/FUSE.txt diff --git a/HAND_WIRE.md b/doc/HAND_WIRE.md similarity index 97% rename from HAND_WIRE.md rename to doc/HAND_WIRE.md index 0b7367eda33..073dbf447ed 100644 --- a/HAND_WIRE.md +++ b/doc/HAND_WIRE.md @@ -187,7 +187,7 @@ To start out, download [the firmware](https://github.com/jackhumbert/qmk_firmwar The first thing we're going to do is create a new project using the script in the root directory of the firmware. In your terminal, run this command with `` replaced by the name of your project - it'll need to be different from any other project in the `keyboard/` folder: - ./new_project.sh + util/new_project.sh You'll want to navigate to the `keyboard//` folder by typing, like the print-out from the script specifies: @@ -195,7 +195,7 @@ You'll want to navigate to the `keyboard//` folder by typing, like #### config.h -The first thing you're going to want to modify is the `config.h` file. Find `MATRIX_ROWS` and `MATRIX_COLS` and them to match the dimensions of your keyboard's matrix. +The first thing you're going to want to modify is the `config.h` file. Find `MATRIX_ROWS` and `MATRIX_COLS` and change their definitions to match the dimensions of your keyboard's matrix. Farther down are `MATRIX_ROW_PINS` and `MATRIX_COL_PINS`. Change their definitions to match how you wired up your matrix (looking from the top of the keyboard, the rows run top-to-bottom and the columns run left-to-right). Likewise, change the definition of `UNUSED_PINS` to match the pins you did not use (this will save power). @@ -282,7 +282,7 @@ It's also important to use the `KEYMAP` function we defined earlier - this is wh #### Compiling your firmware -After you've written out your entire keymap, you're ready to get the firmware compiled and onto your Teensy. Before compiling, you'll need to get your [development environment set-up](https://github.com/jackhumbert/qmk_firmware/blob/master/keyboard/planck/PCB_GUIDE.md#setting-up-the-environment) - you can skip the dfu-programmer instructions, but you'll need to download and install the [Teensy Loader](https://www.pjrc.com/teensy/loader.html) to get the firmware on your Teensy. +After you've written out your entire keymap, you're ready to get the firmware compiled and onto your Teensy. Before compiling, you'll need to get your [development environment set-up](/doc/BUILD_GUIDE.md) - you can skip the dfu-programmer instructions, but you'll need to download and install the [Teensy Loader](https://www.pjrc.com/teensy/loader.html) to get the firmware on your Teensy. Once everything is installed, running `make` in the terminal should get you some output, and eventually a `.hex` file in that folder. If you're having trouble with this step, see the end of the guide for the trouble-shooting section. diff --git a/keyboard/planck/PCB_GUIDE.md b/doc/PCB_GUIDE.md similarity index 100% rename from keyboard/planck/PCB_GUIDE.md rename to doc/PCB_GUIDE.md diff --git a/tmk_core/doc/POWER.txt b/doc/POWER.txt similarity index 100% rename from tmk_core/doc/POWER.txt rename to doc/POWER.txt diff --git a/TMK_README.md b/doc/TMK_README.md similarity index 100% rename from TMK_README.md rename to doc/TMK_README.md diff --git a/tmk_core/doc/USB_NKRO.txt b/doc/USB_NKRO.txt similarity index 100% rename from tmk_core/doc/USB_NKRO.txt rename to doc/USB_NKRO.txt diff --git a/VAGRANT_GUIDE.md b/doc/VAGRANT_GUIDE.md similarity index 73% rename from VAGRANT_GUIDE.md rename to doc/VAGRANT_GUIDE.md index 922848fd752..f7419ccda88 100644 --- a/VAGRANT_GUIDE.md +++ b/doc/VAGRANT_GUIDE.md @@ -4,7 +4,7 @@ This project includes a Vagrantfile that will allow you to build a new firmware ## Requirements -Using the Vagrantfile in this repository requires you have [Vagrant](http://www.vagrantup.com/) as well as [VirtualBox](https://www.virtualbox.org/) (or [VMware Workstation](https://www.vmware.com/products/workstation) and [Vagrant VMware plugin](http://www.vagrantup.com/vmware) but the (paid) VMware plugin requires a licensed copy of VMware Workstation/Fusion). +Using the `/Vagrantfile` in this repository requires you have [Vagrant](http://www.vagrantup.com/) as well as [VirtualBox](https://www.virtualbox.org/) (or [VMware Workstation](https://www.vmware.com/products/workstation) and [Vagrant VMware plugin](http://www.vagrantup.com/vmware) but the (paid) VMware plugin requires a licensed copy of VMware Workstation/Fusion). *COMPATIBILITY NOTICE* Certain versions of Virtualbox 5 appear to have an incompatibility with the Virtualbox extensions installed in the boxes in this Vagrantfile. If you encounter any issues with the /vagrant mount not succeeding, please upgrade your version of Virtualbox to at least 5.0.12. @@ -12,15 +12,15 @@ Other than having Vagrant and Virtualbox installed and possibly a restart of you Build Firmware and Program Controller ------------------------------------- -See [doc/build.md](tmk_core/doc/build.md), or the README in the particular keyboard/* folder. +See [/doc/BUIDE_GUIDE.md](/doc/BUILD_GUIDE.md), or the README in the particular keyboard/* folder. Change your keymap ------------------ -See [doc/keymap.md](tmk_core/doc/keymap.md). +See [/doc/keymap.md](/doc/keymap.md). ## Flashing the firmware -The "easy" way to flash the firmware is using a tool from your host OS like the Teensy programming app. [ErgoDox EZ](keyboard/ergodox_ez/readme.md) gives a great example. +The "easy" way to flash the firmware is using a tool from your host OS like the Teensy programming app. [ErgoDox EZ](/keyboard/ergodox_ez/readme.md) gives a great example. If you want to program via the command line you can uncomment the ['modifyvm'] lines in the Vagrantfile to enable the USB passthrough into Linux and then program using the command line tools like dfu-util/dfu-programmer or you can install the Teensy CLI version. \ No newline at end of file diff --git a/tmk_core/doc/build.md b/doc/build_old.md similarity index 99% rename from tmk_core/doc/build.md rename to doc/build_old.md index 2846f1d0fb8..5c2d57d02da 100644 --- a/tmk_core/doc/build.md +++ b/doc/build_old.md @@ -1,6 +1,7 @@ Build Firmware and Program Controller ===================================== +## This guide may be out-dated - use doc/BUILD_GUIDE.md instead Download and Install -------------------- diff --git a/tmk_core/doc/keycode.txt b/doc/keycode.txt similarity index 100% rename from tmk_core/doc/keycode.txt rename to doc/keycode.txt diff --git a/tmk_core/doc/keymap.md b/doc/keymap.md similarity index 100% rename from tmk_core/doc/keymap.md rename to doc/keymap.md diff --git a/doc/keymap_makefile_example.mk b/doc/keymap_makefile_example.mk new file mode 100644 index 00000000000..5eb73246fab --- /dev/null +++ b/doc/keymap_makefile_example.mk @@ -0,0 +1,21 @@ +# Build Options +# change to "no" to disable the options, or define them in the makefile.mk in +# the appropriate keymap folder that will get included automatically +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = yes # Commands for debug and configuration +NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = no # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + +ifndef QUANTUM_DIR + include ../../../../Makefile +endif \ No newline at end of file diff --git a/tmk_core/doc/other_projects.md b/doc/other_projects.md similarity index 100% rename from tmk_core/doc/other_projects.md rename to doc/other_projects.md diff --git a/keyboard/Bantam44/Makefile b/keyboard/Bantam44/Makefile deleted file mode 100644 index e7dea9f6022..00000000000 --- a/keyboard/Bantam44/Makefile +++ /dev/null @@ -1,139 +0,0 @@ -#---------------------------------------------------------------------------- -# On command line: -# -# make all = Make software. -# -# make clean = Clean out built project files. -# -# make coff = Convert ELF to AVR COFF. -# -# make extcoff = Convert ELF to AVR Extended COFF. -# -# make program = Download the hex file to the device. -# Please customize your programmer settings(PROGRAM_CMD) -# -# make teensy = Download the hex file to the device, using teensy_loader_cli. -# (must have teensy_loader_cli installed). -# -# make dfu = Download the hex file to the device, using dfu-programmer (must -# have dfu-programmer installed). -# -# make flip = Download the hex file to the device, using Atmel FLIP (must -# have Atmel FLIP installed). -# -# make dfu-ee = Download the eeprom file to the device, using dfu-programmer -# (must have dfu-programmer installed). -# -# make flip-ee = Download the eeprom file to the device, using Atmel FLIP -# (must have Atmel FLIP installed). -# -# make debug = Start either simulavr or avarice as specified for debugging, -# with avr-gdb or avr-insight as the front end for debugging. -# -# make filename.s = Just compile filename.c into the assembler code only. -# -# make filename.i = Create a preprocessed source file for use in submitting -# bug reports to the GCC project. -# -# To rebuild project do "make clean" then "make all". -#---------------------------------------------------------------------------- - -# Target file name (without extension). -TARGET = Bantam44 - - -# Directory common source filess exist -TOP_DIR = ../.. -TMK_DIR = ../../tmk_core - -# Directory keyboard dependent files exist -TARGET_DIR = . - -# # project specific files -SRC = Bantam44.c - -ifdef KEYMAP - SRC := keymaps/$(KEYMAP).c $(SRC) -else - SRC := keymaps/default.c $(SRC) -endif - -CONFIG_H = config.h - -# MCU name -#MCU = at90usb1287 -MCU = atmega32u4 - -# Processor frequency. -# This will define a symbol, F_CPU, in all source code files equal to the -# processor frequency in Hz. You can then use this symbol in your source code to -# calculate timings. Do NOT tack on a 'UL' at the end, this will be done -# automatically to create a 32-bit value in your source code. -# -# This will be an integer division of F_USB below, as it is sourced by -# F_USB after it has run through any CPU prescalers. Note that this value -# does not *change* the processor frequency - it should merely be updated to -# reflect the processor speed set externally so that the code can use accurate -# software delays. -F_CPU = 16000000 - - -# -# LUFA specific -# -# Target architecture (see library "Board Types" documentation). -ARCH = AVR8 - -# Input clock frequency. -# This will define a symbol, F_USB, in all source code files equal to the -# input clock frequency (before any prescaling is performed) in Hz. This value may -# differ from F_CPU if prescaling is used on the latter, and is required as the -# raw input clock is fed directly to the PLL sections of the AVR for high speed -# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' -# at the end, this will be done automatically to create a 32-bit value in your -# source code. -# -# If no clock division is performed on the input clock inside the AVR (via the -# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. -F_USB = $(F_CPU) - -# Interrupt driven control endpoint task(+60) -OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT - - -# Boot Section Size in *bytes* -# Teensy halfKay 512 -# Teensy++ halfKay 1024 -# Atmel DFU loader 4096 -# LUFA bootloader 4096 -# USBaspLoader 2048 -OPT_DEFS += -DBOOTLOADER_SIZE=512 - - -# Build Options -# comment out to disable the options. -# -BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE = yes # Mouse keys(+4700) -EXTRAKEY_ENABLE = yes # Audio control and System control(+450) -CONSOLE_ENABLE = yes # Console for debug(+400) -COMMAND_ENABLE = yes # Commands for debug and configuration -# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE -# SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend -# NKRO_ENABLE = yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -# BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality -# MIDI_ENABLE = YES # MIDI controls -# UNICODE_ENABLE = YES # Unicode -# BLUETOOTH_ENABLE = yes # Enable Bluetooth with the Adafruit EZ-Key HID - - -# Optimize size but this may cause error "relocation truncated to fit" -#EXTRALDFLAGS = -Wl,--relax - -# Search Path -VPATH += $(TARGET_DIR) -VPATH += $(TOP_DIR) -VPATH += $(TMK_DIR) - -include $(TOP_DIR)/quantum/quantum.mk - diff --git a/keyboard/IIgs/README b/keyboard/IIgs/README deleted file mode 100644 index 820d7711024..00000000000 --- a/keyboard/IIgs/README +++ /dev/null @@ -1,45 +0,0 @@ -Replaceable USB Controller for Apple IIgs/Standard(M0116) -JeffreySung(nattyman@gmail.com) - -=============================== - -Feature -------- -- Replaceable keyboard controller for Apple IIgs(A9M0330)/Standard(M0116) -- Teensy++ 2.0 required -- Some signal bypass required -- ADB keyboard doesn't use matrix for modifier keys. With virtual row for modifier keys, - these keys are merged into key matrix using virtual row. - -History -======= -- 2012.09.17 First Release -- 2012.09.17 CapsLock support -- 2012.09.19 Power button added -Build -===== -0. Just Type "Make" and return. - -Hardware -======== -PJRC Teensy ------------ -0. The following ports should not be connected to board. - From top view of Teensy++, from GND and counter clock wise. - -7,26(in keyboard PCB, these pins are VDD,GND) - -30,31(in Teensy++, these pins are Ref,GND respectively) - -5,6(D2,D3 for bluetooth in future) -1. Bypass #31 pin(from board) to E4(Teensy) -2. Bypass #30 pin(from board) to F2(Teensy) -3. Bypass #6 pin(from board) to A0(Teensy) -4. Refer to documentation directory - -To Do -===== -0. When DEBOUNCE defined, there is a errors. -1. Layer Change by toggling Clear Key -2. Eject Key add. (following files should be modified.) - common/keycode.h - common/keyboard.c -3. Use bluetooth -EOF diff --git a/keyboard/IIgs/config.h b/keyboard/IIgs/config.h deleted file mode 100644 index bc8bf75f947..00000000000 --- a/keyboard/IIgs/config.h +++ /dev/null @@ -1,63 +0,0 @@ -/* -Copyright 2011 Jun Wako - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#ifndef CONFIG_H -#define CONFIG_H - - -/* USB Device descriptor parameter */ -/* for Apple -#define VENDOR_ID 0x05AC -#define PRODUCT_ID 0xBEE0 -*/ -#define VENDOR_ID 0xFEED -#define PRODUCT_ID 0xBEE0 -#define DEVICE_VER 0x0202 -#define MANUFACTURER t.m.k. -#define PRODUCT Apple Desktop Bus Keyboard - - -/* message strings */ -#define DESCRIPTION Apple M0116/A9M0660 keyboard firmware - - -/* matrix size */ -#define MATRIX_ROWS 11 // last row is virtual for modifier -#define MATRIX_COLS 8 -/* define if matrix has ghost */ -#define MATRIX_HAS_GHOST -/* Set 0 if need no debouncing */ -#define DEBOUNCE 5 - - -/* key combination for command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_LCTRL) | MOD_BIT(KC_LALT) | MOD_BIT(KC_LGUI)) || \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - - -/* layer switching */ -#define LAYER_SWITCH_DELAY 100 -#define LAYER_SEND_FN_TERM 300 - - -/* legacy keymap support */ -#define USE_LEGACY_KEYMAP - - -#endif diff --git a/keyboard/IIgs/doc/PIN_BYPASS.jpg b/keyboard/IIgs/doc/PIN_BYPASS.jpg deleted file mode 100644 index 2998f0c3f8c..00000000000 Binary files a/keyboard/IIgs/doc/PIN_BYPASS.jpg and /dev/null differ diff --git a/keyboard/IIgs/doc/Teensy++_Mod.jpg b/keyboard/IIgs/doc/Teensy++_Mod.jpg deleted file mode 100644 index 146c1ab93cd..00000000000 Binary files a/keyboard/IIgs/doc/Teensy++_Mod.jpg and /dev/null differ diff --git a/keyboard/IIgs/hid_listen.mac b/keyboard/IIgs/hid_listen.mac deleted file mode 100755 index 8758fdf886a..00000000000 Binary files a/keyboard/IIgs/hid_listen.mac and /dev/null differ diff --git a/keyboard/IIgs/keymap.c b/keyboard/IIgs/keymap.c deleted file mode 100644 index cd33e223ac8..00000000000 --- a/keyboard/IIgs/keymap.c +++ /dev/null @@ -1,142 +0,0 @@ -/* -Copyright 2012 Jeffrey Sung - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -/* - * Keymap for Apple IIgs/Standard Keyboard - */ -#include -#include -#include -#include "keycode.h" -#include "print.h" -#include "debug.h" -#include "util.h" -#include "keymap.h" - - -// Convert physical keyboard layout to matrix array. -// This is a macro to define keymap easily in keyboard layout form. -#define KEYMAP( R10C5, \ - R3C7, R3C6, R3C5, R3C4, R3C3, R3C2, R3C1, R8C1, R8C0, R3C0, R0C0, R0C1, R0C2, R0C3, R4C4, R4C5, R4C6, R4C7, \ - R9C7, R9C6, R9C5, R9C4, R9C3, R9C2, R9C1, R9C0, R1C0, R1C1, R1C2, R1C3, R1C4, R2C4, R2C5, R2C6, R2C3, \ - R10C0,R7C7, R7C6, R7C5, R7C4, R7C3, R7C2, R7C1, R7C0, R0C4, R1C6, R1C7, R1C5, R2C0, R2C1, R2C2, R2C7, \ - R10C1,R6C7, R6C6, R6C5, R6C4, R6C3, R6C2, R6C1, R6C0, R0C5, R0C6, R4C0, R4C1, R4C2, \ - R10C4,R10C2,R10C3,R5C4, R5C7, R5C5, R5C6, R5C0, R5C2, R0C7, R5C1, R5C3, R4C3 \ -) { \ - { R0C0, R0C1, R0C2, R0C3, R0C4, R0C5, R0C6, R0C7 }, \ - { R1C0, R1C1, R1C2, R1C3, R1C4, R1C5, R1C6, R1C7 }, \ - { R2C0, R2C1, R2C2, R2C3, R2C4, R2C5, R2C6, R2C7 }, \ - { R3C0, R3C1, R3C2, R3C3, R3C4, R3C5, R3C6, R3C7 }, \ - { R4C0, R4C1, R4C2, R4C3, R4C4, R4C5, R4C6, R4C7 }, \ - { R5C0, R5C1, R5C2, R5C3, R5C4, R5C5, R5C6, R5C7 }, \ - { R6C0, R6C1, R6C2, R6C3, R6C4, R6C5, R6C6, R6C7 }, \ - { R7C0, R7C1, R7C2, R7C3, R7C4, R7C5, R7C6, R7C7 }, \ - { R8C0, R8C1, KC_NO, KC_NO, KC_NO,KC_NO, KC_NO, KC_NO }, \ - { R9C0, R9C1, R9C2, R9C3, R9C4, R9C5, R9C6, R9C7 }, \ - { R10C0,R10C1, R10C2, R10C3, R10C4,R10C5, KC_NO, KC_NO} \ -} - -#define KEYCODE(layer, row, col) (pgm_read_byte(&keymaps[(layer)][(row)][(col)])) - - -// Assign Fn key(0-7) to a layer to which switch with the Fn key pressed. -static const uint8_t PROGMEM fn_layer[] = { - 0, // Fn0 - 1, // Fn1 - 2, // Fn2 - 3, // Fn3 - 4, // Fn4 - 0, // Fn5 - 3, // Fn6 - 3 // Fn7 -}; - -// Assign Fn key(0-7) to a keycode sent when release Fn key without use of the layer. -// See layer.c for details. -static const uint8_t PROGMEM fn_keycode[] = { - KC_NO, // Fn0 - KC_NO, // Fn1 - KC_SLSH, // Fn2 - KC_SCLN, // Fn3 - KC_SPC, // Fn4 - KC_NO, // Fn5 - KC_NO, // Fn6 - KC_NO // Fn7 -}; - -static const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - /* Layer 0: Default Layer - * ,-----------------------------------------------------------. ,---------------, - * | POWER | | | - * |-----------------------------------------------------------| |---------------| - * |Esc| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Backsp | |FN0| = | / | * | - * |-----------------------------------------------------------| |---------------| - * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| | | 7 | 8 | 9 | + | - * |-----------------------------------------------------' | |---------------| - * |Contro| A| S| D| F| G| H| J| K| L|Fn3| '|Return | | 4 | 5 | 6 | - | - * |-----------------------------------------------------------| |---------------| - * |Shift | Z| X| C| V| B| N| M| ,| .| / |Shift | | 1 | 2 | 3 | E | - * |-----------------------------------------------------------| |-----------| N | - * |CAPS|Alt |Gui |` |SPC |BSLS |LFT|RGT|DN|UP| | 0 | . | T | - * `-----------------------------------------------------------' |---------------' - */ - KEYMAP( KC_PWR, - KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS,KC_EQL, KC_BSPC, KC_FN1, KC_PEQL, KC_PSLS, KC_PAST, \ - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC,KC_RBRC, KC_P7, KC_P8, KC_P9, KC_PPLS, \ - KC_LCTL,KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT,KC_ENT, KC_P4, KC_P5, KC_P6, KC_PMNS, \ - KC_LSFT,KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH, KC_P1, KC_P2, KC_P3, \ - KC_CAPS,KC_LALT,KC_LGUI,KC_GRV, KC_SPC, KC_BSLS,KC_LEFT,KC_RGHT,KC_DOWN,KC_UP, KC_P0, KC_PDOT, KC_PENT), - - - /* Layer 1: Tenkey use Layer - * ,-----------------------------------------------------------. ,---------------, - * | POWER | | | - * |-----------------------------------------------------------| |---------------| - * |Esc| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Backsp | |NLK| = | / | * | - * |-----------------------------------------------------------| |---------------| - * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| | |INS| 8 |PGU|V+ | - * |-----------------------------------------------------' | |---------------| - * |Contro| A| S| D| F| G| H| J| K| L|Fn3| '|Return | |DEL|UP |PGD|V- | - * |-----------------------------------------------------------| |---------------| - * |Shift | Z| X| C| V| B| N| M| ,| .| / |Shift | |LFT|DN |RGT| E | - * |-----------------------------------------------------------| |-----------| N | - * |CAPS|Alt |Gui |` |SPC |BSLS |LFT|RGT|DN|UP| | 0 | . | T | - * `-----------------------------------------------------------' `---------------' - */ - KEYMAP( KC_PWR, \ - KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS,KC_EQL, KC_BSPC, KC_FN1, KC_PEQL, KC_PSLS, KC_MUTE, \ - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC,KC_RBRC, KC_INS, KC_P8, KC_PGUP, KC_VOLU, \ - KC_LCTL,KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT,KC_ENT, KC_DEL, KC_UP, KC_PGDN, KC_VOLD, \ - KC_LSFT,KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH, KC_LEFT, KC_DOWN, KC_RIGHT, \ - KC_CAPS,KC_LALT,KC_LGUI,KC_GRV, KC_SPC, KC_BSLS,KC_LEFT,KC_RGHT,KC_DOWN,KC_UP, KC_P0, KC_PDOT, KC_PENT), -}; - - -uint8_t keymap_get_keycode(uint8_t layer, uint8_t row, uint8_t col) -{ - return KEYCODE(layer, row, col); -} - -uint8_t keymap_fn_layer(uint8_t index) -{ - return pgm_read_byte(&fn_layer[index]); -} - -uint8_t keymap_fn_keycode(uint8_t index) -{ - return pgm_read_byte(&fn_keycode[index]); -} diff --git a/keyboard/IIgs/led.c b/keyboard/IIgs/led.c deleted file mode 100644 index f76545f0ba6..00000000000 --- a/keyboard/IIgs/led.c +++ /dev/null @@ -1,24 +0,0 @@ -/* -Copyright 2011 Jun Wako - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#include "stdint.h" -#include "led.h" - - -void led_set(uint8_t usb_led) -{ -} diff --git a/keyboard/IIgs/matrix.c b/keyboard/IIgs/matrix.c deleted file mode 100644 index 6ca55b7ea24..00000000000 --- a/keyboard/IIgs/matrix.c +++ /dev/null @@ -1,363 +0,0 @@ -/* -Copyright 2011 Jun Wako - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -/* - * scan matrix - */ -#include -#include -#include -#include -#include "print.h" -#include "debug.h" -#include "util.h" -#include "matrix.h" -#include "led.h" - - -#if (MATRIX_COLS > 16) -# error "MATRIX_COLS must not exceed 16" -#endif -#if (MATRIX_ROWS > 255) -# error "MATRIX_ROWS must not exceed 255" -#endif - - -#ifndef DEBOUNCE -# define DEBOUNCE 0 -#endif -static uint8_t debouncing = DEBOUNCE; - -// matrix state buffer(1:on, 0:off) -#if (MATRIX_COLS <= 8) -static uint8_t *matrix; -static uint8_t *matrix_prev; -static uint8_t _matrix0[MATRIX_ROWS]; -static uint8_t _matrix1[MATRIX_ROWS]; -#else -static uint16_t *matrix; -static uint16_t *matrix_prev; -static uint16_t _matrix0[MATRIX_ROWS]; -static uint16_t _matrix1[MATRIX_ROWS]; -#endif - -#ifdef MATRIX_HAS_GHOST -static bool matrix_has_ghost_in_row(uint8_t row); -#endif -static uint8_t read_col(uint8_t row); -static void unselect_rows(void); -static void select_row(uint8_t row); - - -inline -uint8_t matrix_rows(void) -{ - return MATRIX_ROWS; -} - -inline -uint8_t matrix_cols(void) -{ - return MATRIX_COLS; -} - -void matrix_init(void) -{ - // initialize row and col - unselect_rows(); - // Input with pull-up(DDR:0, PORT:1) - // Column C1 ~ C7 (PortC0-6) - // Column C0(Port E1) - DDRC &= ~0b01111111; - PORTC |= 0b01111111; - DDRE &= ~0b00000010; - PORTE |= 0b00000010; - //DDRB &= ~0b00000100; - //PORTB |= 0b00000100; - // modifier B3/4,F4/5,E4 always input - // A0 - //DDRA |= 0b00000001; - //PORTA &= 0b00000001; - //DDRB |= 0b00011000; - //PORTB &= 0b00011000; - //DDRF |= ~0b00110000; - //PORTF &= 0b00110000; - //DDRB &= ~0b00011000; - //PORTB |= 0b00011000; - //DDRF &= ~0b00110000; - //PORTF |= 0b00110000; - //DDRE &= ~0b00010000; - //PORTE |= 0b00010000; - - // initialize matrix state: all keys off - for (uint8_t i=0; i < MATRIX_ROWS; i++) _matrix0[i] = 0x00; - for (uint8_t i=0; i < MATRIX_ROWS; i++) _matrix1[i] = 0x00; - matrix = _matrix0; - matrix_prev = _matrix1; -} - -uint8_t matrix_scan(void) -{ - if (!debouncing) { - uint8_t *tmp = matrix_prev; - matrix_prev = matrix; - matrix = tmp; - } - - for (uint8_t i = 0; i < MATRIX_ROWS; i++) { - unselect_rows(); - select_row(i); - _delay_us(30); // without this wait read unstable value. - if ( i == ( MATRIX_ROWS - 1 ) ) { // CHECK CAPS LOCK - if (host_keyboard_leds() & (1<");debug_hex(matrix[row]);debug("\n"); -// } -// } -// } - return (matrix[row] & (1<mods except E4(CAPSLOCK) - uint8_t tmp; - if ( row == 10 ) { - tmp = 0xC0; - tmp |= (PINB >> 3 ) & 0b00000011; // LEFT CTRL is 0bit in modifier (HID Spec) - // LEFT SHIFT is 1bit in modifier (HID Spec) - tmp |= (PINF >> 3 ) & 0b00000100; // LEFT ALT is 2bit in modifier (HID Spec) - tmp |= (PINF >> 1 ) & 0b00001000; // LEFT GUI is 3bit in modifier (HID Spec) - tmp |= (PINA << 4 ) & 0b00010000; // CAPSLOCK - tmp |= (PINB << 3 ) & 0b00100000; // POWER - } else { - tmp = 0x00; - tmp = (PINE >> 1)&0b00000001; - tmp |= PINC << 1 ; - } - return tmp; -} - -inline -static void unselect_rows(void) -{ - // Hi-Z(DDR:0, PORT:0) to unselect - // DDR : 1, output 0, input - DDRB &= ~0b00000011; // PB: 1,0 - PORTB &= ~0b00000011; - DDRD &= ~0b00010000; // PD: 4 - PORTD &= ~0b00010000; - DDRE &= ~0b11000000; // PE: 7,6 - PORTE &= ~0b11000000; - DDRF &= ~0b11000111; // PF: 7,6,2,1,0 - PORTF &= ~0b11000111; - // to unselect virtual row(modifier), set port to output with low - DDRA |= 0b00000001; // PA: 0 for CAPSLOCK - PORTA &= ~0b00000001; - DDRB |= 0b00011100; // PB: 3,4 for modifier(row10) - PORTB &= ~0b00011100; // PB: 2 for power - DDRF |= 0b00110000; // PF: 4,5 for modifier - PORTF &= ~0b00110000; -} - -inline -static void select_row(uint8_t row) -{ - // Output low(DDR:1, PORT:0) to select - // with row enable, column could send low to AVR when pressed - // row: 0 1 2 3 4 5 6 7 8 9 - // pin: PB1, PB0, PE7, PE6, PD4, PF2, PF0, PF1, PF6 PF7 - switch (row) { - case 0: - DDRB |= (1<<1); - PORTB &= ~(1<<1); - break; - case 1: - DDRB |= (1<<0); - PORTB &= ~(1<<0); - break; - case 2: - DDRE |= (1<<7); - PORTE &= ~(1<<7); - break; - case 3: - DDRE |= (1<<6); - PORTE &= ~(1<<6); - break; - case 4: - DDRD |= (1<<4); - PORTD &= ~(1<<4); - break; - case 5: - DDRF |= (1<<2); - PORTF &= ~(1<<2); - break; - case 6: - DDRF |= (1<<0); - PORTF &= ~(1<<0); - break; - case 7: - DDRF |= (1<<1); - PORTF &= ~(1<<1); - break; - case 8: - DDRF |= (1<<6); - PORTF &= ~(1<<6); - break; - case 9: - DDRF |= (1<<7); - PORTF &= ~(1<<7); - break; - case 10: - // modifier has no row enable - // to select virtual row, set port as input - DDRA &= ~0b00000001; - PORTA |= 0b00000001; - DDRB &= ~0b00011100; - PORTB |= 0b00011100; - DDRF &= ~0b00110000; - PORTF |= 0b00110000; - break; - - } -} diff --git a/keyboard/alps64/Makefile b/keyboard/alps64/Makefile index 7634c4280eb..8259e4d08d8 100644 --- a/keyboard/alps64/Makefile +++ b/keyboard/alps64/Makefile @@ -39,27 +39,9 @@ #---------------------------------------------------------------------------- # Target file name (without extension). -TARGET = alps64 - -# Directory common source filess exist -TMK_DIR = ../../tmk_core - -# Directory keyboard dependent files exist -TARGET_DIR = . # project specific files -SRC = keymap_common.c \ - matrix.c \ - led.c - -ifdef KEYMAP - SRC := keymaps/$(KEYMAP).c $(SRC) -else - SRC := keymaps/default.c $(SRC) -endif - -CONFIG_H = config.h - +SRC = led.c # MCU name MCU = atmega32u2 @@ -113,22 +95,14 @@ OPT_DEFS += -DBOOTLOADER_SIZE=4096 # Build Options # comment out to disable the options. # -BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE = yes # Mouse keys(+4700) -EXTRAKEY_ENABLE = yes # Audio control and System control(+450) -CONSOLE_ENABLE = yes # Console for debug(+400) -COMMAND_ENABLE = yes # Commands for debug and configuration +BOOTMAGIC_ENABLE ?= yes # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700) +EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450) +CONSOLE_ENABLE ?= yes # Console for debug(+400) +COMMAND_ENABLE ?= yes # Commands for debug and configuration #SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend #NKRO_ENABLE = yes # USB Nkey Rollover - not yet supported in LUFA - -# Optimize size but this may cause error "relocation truncated to fit" -#EXTRALDFLAGS = -Wl,--relax - -# Search Path -VPATH += $(TARGET_DIR) -VPATH += $(TMK_DIR) - -include $(TMK_DIR)/protocol/lufa.mk -include $(TMK_DIR)/common.mk -include $(TMK_DIR)/rules.mk +ifndef QUANTUM_DIR + include ../../Makefile +endif \ No newline at end of file diff --git a/keyboard/gh60/keymap_common.c b/keyboard/alps64/alps64.c similarity index 57% rename from keyboard/gh60/keymap_common.c rename to keyboard/alps64/alps64.c index fdb1769e1c0..dde10c11e34 100644 --- a/keyboard/gh60/keymap_common.c +++ b/keyboard/alps64/alps64.c @@ -14,17 +14,30 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#include "keymap_common.h" +#include "quantum.h" +#define LED_ON() do { DDRC |= (1<<5); PORTC |= (1<<5); } while (0) +#define LED_OFF() do { DDRC &= ~(1<<5); PORTC &= ~(1<<5); } while (0) +#define LED_TGL() do { DDRC |= (1<<5); PINC |= (1<<5); } while (0) + +__attribute__ ((weak)) +void matrix_init_user(void) { -/* translates key to keycode */ -uint8_t keymap_key_to_keycode(uint8_t layer, keypos_t key) -{ - return pgm_read_byte(&keymaps[(layer)][(key.row)][(key.col)]); } -/* translates Fn keycode to action */ -action_t keymap_fn_to_action(uint8_t keycode) -{ - return (action_t){ .code = pgm_read_word(&fn_actions[FN_INDEX(keycode)]) }; +__attribute__ ((weak)) +void matrix_scan_user(void) { + +} + +void matrix_init_kb(void) { + LED_ON(); + _delay_ms(500); + LED_OFF(); + + matrix_init_user(); +} + +void matrix_scan_kb(void) { + matrix_scan_user(); } diff --git a/keyboard/alps64/keymap_common.h b/keyboard/alps64/alps64.h similarity index 61% rename from keyboard/alps64/keymap_common.h rename to keyboard/alps64/alps64.h index 957db579222..f265c3358e6 100644 --- a/keyboard/alps64/keymap_common.h +++ b/keyboard/alps64/alps64.h @@ -14,25 +14,10 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#ifndef KEYMAP_COMMON_H -#define KEYMAP_COMMON_H - -#include -#include -#include -#include "keycode.h" -#include "action.h" -#include "action_macro.h" -#include "report.h" -#include "host.h" -#include "print.h" -#include "debug.h" -#include "keymap.h" - - -extern const uint8_t keymaps[][MATRIX_ROWS][MATRIX_COLS]; -extern const uint16_t fn_actions[]; +#ifndef ALPS64_H +#define ALPS64_H +#include "quantum.h" /* Alps64 keymap definition macro */ #define KEYMAP( \ @@ -52,19 +37,4 @@ extern const uint16_t fn_actions[]; { KC_##K70, KC_##K71, KC_##K72, KC_##K73, KC_##K74, KC_##K75, KC_##K76, KC_##K77 } \ } -/* AEK US */ -#define KEYMAP_AEK( \ - K36, K37, K46, K47, K56, K57, K66, K67, K76, K77, K06, K07, K17, K27, \ - K34, K35, K44, K45, K54, K55, K64, K65, K75, K05, K15, K16, K25, K24, \ - K32, K33, K43, K52, K53, K63, K73, K74, K03, K04, K13, K14, K23, \ - K31, K42, K51, K61, K62, K71, K72, K01, K02, K11, K12, K21, \ - K30, K40, K50, K60, K00, K10, K20 \ -) KEYMAP( \ - K36, K37, K46, K47, K56, K57, K66, K67, K76, K77, K06, K07, K17, NUHS,K27, \ - K34, K35, K44, K45, K54, K55, K64, K65, K75, K05, K15, K16, K25, K24, \ - K32, K33, K43, K52, K53, K63, K73, K74, K03, K04, K13, K14, K23, \ - K31, NUBS,K42, K51, K61, K62, K71, K72, K01, K02, K11, K12, K21, ESC, \ - K30, K40, K50, K60, APP, K00, K10, K20 \ -) - #endif diff --git a/keyboard/alps64/config.h b/keyboard/alps64/config.h index 824d3e83029..858a82ecdd9 100644 --- a/keyboard/alps64/config.h +++ b/keyboard/alps64/config.h @@ -18,6 +18,7 @@ along with this program. If not, see . #ifndef CONFIG_H #define CONFIG_H +#include "config_common.h" /* USB Device descriptor parameter */ #define VENDOR_ID 0xFEED @@ -31,6 +32,10 @@ along with this program. If not, see . #define MATRIX_ROWS 8 #define MATRIX_COLS 8 +#define MATRIX_COL_PINS { B0, B1, B2, B3, B4, B5, B6, B7 } +#define MATRIX_ROW_PINS { D0, D1, D2, D3, D4, D5, D6, C2 } +#define UNUSED_PINS + /* define if matrix has ghost */ //#define MATRIX_HAS_GHOST diff --git a/keyboard/alps64/keymap_common.c b/keyboard/alps64/keymap_common.c deleted file mode 100644 index fdb1769e1c0..00000000000 --- a/keyboard/alps64/keymap_common.c +++ /dev/null @@ -1,30 +0,0 @@ -/* -Copyright 2012,2013 Jun Wako - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ -#include "keymap_common.h" - - -/* translates key to keycode */ -uint8_t keymap_key_to_keycode(uint8_t layer, keypos_t key) -{ - return pgm_read_byte(&keymaps[(layer)][(key.row)][(key.col)]); -} - -/* translates Fn keycode to action */ -action_t keymap_fn_to_action(uint8_t keycode) -{ - return (action_t){ .code = pgm_read_word(&fn_actions[FN_INDEX(keycode)]) }; -} diff --git a/keyboard/alps64/keymaps/default/compiled.hex b/keyboard/alps64/keymaps/default/compiled.hex new file mode 100644 index 00000000000..ef43410f24b Binary files /dev/null and b/keyboard/alps64/keymaps/default/compiled.hex differ diff --git a/keyboard/alps64/keymaps/default.c b/keyboard/alps64/keymaps/default/keymap.c similarity index 84% rename from keyboard/alps64/keymaps/default.c rename to keyboard/alps64/keymaps/default/keymap.c index a54899196aa..2c45dc7f342 100644 --- a/keyboard/alps64/keymaps/default.c +++ b/keyboard/alps64/keymaps/default/keymap.c @@ -1,6 +1,6 @@ -#include "keymap_common.h" +#include "alps64.h" -const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* 0: qwerty */ KEYMAP( \ GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, NUHS, BSPC, \ diff --git a/keyboard/alps64/keymaps/hasu.c b/keyboard/alps64/keymaps/hasu.c deleted file mode 100644 index d297d72fea3..00000000000 --- a/keyboard/alps64/keymaps/hasu.c +++ /dev/null @@ -1,151 +0,0 @@ -#include "keymap_common.h" - -/* - * Hasu - */ -const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - /* Default Layer - * ,-----------------------------------------------------------. - * |Esc| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =| \ | - * |-----------------------------------------------------------| - * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]|Bspc | - * |-----------------------------------------------------------| - * |Ctrl | A| S| D| F| G| H| J| K| L|Fn3| '|FN1 | - * |-----------------------------------------------------------| - * |Shift | Z| X| C| V| B| N| M| ,| .|Fn2|Shift | - * |-----------------------------------------------------------| - * |Ctrl |Gui |Alt | Space |Alt |Fn5 |Ctrl | - * `-----------------------------------------------------------' - */ - [0] = KEYMAP_AEK( \ - ESC, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, BSLS, \ - TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC,RBRC,BSPC, \ - LCTL,A, S, D, F, G, H, J, K, L, FN3, QUOT,FN1, \ - LSFT,Z, X, C, V, B, N, M, COMM,DOT, FN2, RSFT, \ - LCTL,LGUI,LALT, FN4, RALT,FN5, FN0), - - /* HHKB mode[HHKB Fn] - * ,-----------------------------------------------------------. - * |Esc| F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12| ` | - * |-----------------------------------------------------------| - * |Caps | | | | | | | |Psc|Slk|Pus|Up | |Del | - * |-----------------------------------------------------------| - * |Contro|VoD|VoU|Mut| | | *| /|Hom|PgU|Lef|Rig|Enter | - * |-----------------------------------------------------------| - * |Shift | | | | | | +| -|End|PgD|Dow|Shift | - * |-----------------------------------------------------------| - * |Ctrl |Gui |Alt | Space |Alt |Fn5 |Ctrl | - * `-----------------------------------------------------------' - */ - [1] = KEYMAP_AEK( \ - GRV, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, GRV, \ - CAPS,NO, NO, NO, NO, NO, NO, NO, PSCR,SLCK,PAUS,UP, NO, DEL, \ - LCTL,VOLD,VOLU,MUTE,NO, NO, PAST,PSLS,HOME,PGUP,LEFT,RGHT,TRNS, \ - LSFT,NO, NO, NO, NO, NO, PPLS,PMNS,END, PGDN,DOWN,RSFT, \ - LCTL,LGUI,LALT, TRNS, RALT,RGUI,TRNS), - - /* Vi mode[Slash] - * ,-----------------------------------------------------------. - * |Esc| F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12|Del | - * |-----------------------------------------------------------| - * |Tab |Hom|PgD|Up |PgU|End|Hom|PgD|PgUlEnd| | | |Backs| - * |-----------------------------------------------------------| - * |Contro| |Lef|Dow|Rig| |Lef|Dow|Up |Rig| | |Return | - * |-----------------------------------------------------------| - * |Shift | | | | | |Hom|PgD|PgUlEnd|Fn0|Shift | - * |-----------------------------------------------------------| - * |Ctrl |Gui |Alt | Space |Alt |Fn5 |Ctrl | - * `-----------------------------------------------------------' - */ - [2] = KEYMAP_AEK( \ - GRV, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, GRV, \ - TAB, HOME,PGDN,UP, PGUP,END, HOME,PGDN,PGUP,END, NO, NO, NO, DEL, \ - LCTL,NO, LEFT,DOWN,RGHT,NO, LEFT,DOWN,UP, RGHT,NO, NO, ENT, \ - LSFT,NO, NO, NO, NO, NO, HOME,PGDN,PGUP,END, FN2, RSFT, \ - LCTL,LGUI,LALT, SPC, RALT,RGUI,RCTL), - - /* Mouse mode(IJKL)[Semicolon] - * ,-----------------------------------------------------------. - * |Esc| F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12|Ins|Del| - * |-----------------------------------------------------------| - * |Tab | | | | | |MwL|MwD|McU|MwU|MwR|Wbk|Wfr|Alt-T| - * |-----------------------------------------------------------| - * |Contro| | | | | |Mb2|McL|McD|McR|Fn | |Return | - * |-----------------------------------------------------------| - * |Shift | | | | |Mb3|Mb2|Mb1|Mb4|Mb5| |Shift | | - * |-----------------------------------------------------------| - * |Ctrl |Gui |Alt | Space |Alt |Fn5 |Ctrl | - * `-----------------------------------------------------------' - * Mc: Mouse Cursor / Mb: Mouse Button / Mw: Mouse Wheel - */ - [3] = KEYMAP_AEK( \ - GRV, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, GRV, \ - FN8, NO, NO, NO, NO, NO, NO, WH_D,MS_U,WH_U,RGHT,FN9, FN10,FN8, \ - LCTL,ACL0,ACL1,ACL2,ACL2,NO, NO, MS_L,MS_D,MS_R,TRNS,NO, ENT, \ - LSFT,NO, NO, NO, NO, BTN3,BTN2,BTN1,FN9, FN10,NO, RSFT, \ - LCTL,LGUI,LALT, BTN1, TRNS,TRNS,TRNS), - - /* Layer 4: Mouse mode(IJKL)[Space] - * ,-----------------------------------------------------------. - * |Esc| F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12|Ins|Del| - * |-----------------------------------------------------------| - * |Tab | | | | | |MwL|MwD|McU|MwU|MwR|Wbk|Wfr|Alt-T| - * |-----------------------------------------------------------| - * |Contro| | | | | |Mb2|McL|McD|McR|Mb1| |Return | - * |-----------------------------------------------------------| - * |Shift | | | | |Mb3|Mb2|Mb1|Mb4|Mb5| |Shift | | - * |-----------------------------------------------------------| - * |Ctrl |Gui |Alt | Space |Alt |Fn5 |Ctrl | - * `-----------------------------------------------------------' - * Mc: Mouse Cursor / Mb: Mouse Button / Mw: Mouse Wheel - */ - [4] = KEYMAP_AEK( \ - GRV, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, GRV, \ - FN8, NO, NO, NO, NO, NO, NO, WH_D,MS_U,WH_U,RGHT,FN9, FN10,FN8, \ - LCTL,VOLD,VOLU,MUTE,NO, NO, NO, MS_L,MS_D,MS_R,BTN1,NO, ENT, \ - LSFT,NO, NO, NO, NO, BTN3,BTN2,BTN1,FN9, FN10,NO, RSFT, \ - LCTL,LGUI,LALT, TRNS, TRNS,TRNS,TRNS), -}; - - -/* id for user defined function/macro */ -enum function_id { - NONE, -}; - -enum macro_id { - ALT_TAB, -}; - - -/* - * Fn action definition - */ -const uint16_t PROGMEM fn_actions[] = { - [0] = ACTION_LAYER_MOMENTARY(1), // HHKB layer - [1] = ACTION_LAYER_TAP_KEY(1, KC_ENTER), // HHKB layer - [2] = ACTION_LAYER_TAP_KEY(2, KC_SLASH), // Cursor layer with Slash* - [3] = ACTION_LAYER_TAP_KEY(3, KC_SCLN), // Mousekey layer with Semicolon* - [4] = ACTION_LAYER_TAP_KEY(4, KC_SPC), // Mousekey layer with Space - [5] = ACTION_LAYER_MOMENTARY(3), // Mousekey layer(IJKL) - [6] = ACTION_LAYER_TAP_KEY(MOD_RCTL, KC_ENT), // RControl with tap Enter - [7] = ACTION_MODS_ONESHOT(MOD_LSFT), // Oneshot Shift - [8] = ACTION_MACRO(ALT_TAB), // Application switching - [9] = ACTION_MODS_KEY(MOD_LALT, KC_LEFT), - [10] = ACTION_MODS_KEY(MOD_LALT, KC_RIGHT), -}; - - -/* - * Macro definition - */ -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - switch (id) { - case ALT_TAB: - return (record->event.pressed ? - MACRO( D(LALT), D(TAB), END ) : - MACRO( U(TAB), END )); - } - return MACRO_NONE; -} diff --git a/keyboard/alps64/matrix.c b/keyboard/alps64/matrix.c index 5638d7f69d9..805999d4a1a 100644 --- a/keyboard/alps64/matrix.c +++ b/keyboard/alps64/matrix.c @@ -55,10 +55,6 @@ uint8_t matrix_cols(void) return MATRIX_COLS; } -#define LED_ON() do { DDRC |= (1<<5); PORTC |= (1<<5); } while (0) -#define LED_OFF() do { DDRC &= ~(1<<5); PORTC &= ~(1<<5); } while (0) -#define LED_TGL() do { DDRC |= (1<<5); PINC |= (1<<5); } while (0) - void matrix_init(void) { // initialize row and col @@ -160,6 +156,7 @@ static void unselect_rows(void) PORTC &= ~0b00000100; } + static void select_row(uint8_t row) { // Output low(DDR:1, PORT:0) to select diff --git a/converter/adb_usb/Makefile b/keyboard/arrow_pad/Makefile similarity index 73% rename from converter/adb_usb/Makefile rename to keyboard/arrow_pad/Makefile index 2369ee70ac7..931eb3a16d3 100644 --- a/converter/adb_usb/Makefile +++ b/keyboard/arrow_pad/Makefile @@ -38,30 +38,6 @@ # To rebuild project do "make clean" then "make all". #---------------------------------------------------------------------------- -# Target file name (without extension). -TARGET = adb_usb_lufa - -# Directory common source filess exist -TMK_DIR = ../../tmk_core - -# Directory keyboard dependent files exist -TARGET_DIR = . - -# project specific files -SRC = keymap_common.c \ - matrix.c \ - led.c \ - adb.c - -ifdef KEYMAP - SRC := keymap_$(KEYMAP).c $(SRC) -else - SRC := keymap_ansi.c $(SRC) -endif - -CONFIG_H = config.h - - # MCU name #MCU = at90usb1287 MCU = atmega32u4 @@ -109,33 +85,28 @@ OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT # Atmel DFU loader 4096 # LUFA bootloader 4096 # USBaspLoader 2048 -OPT_DEFS += -DBOOTLOADER_SIZE=4096 +OPT_DEFS += -DBOOTLOADER_SIZE=512 # Build Options -# comment out to disable the options. +# change yes to no to disable # -#BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE = yes # Mouse keys(+4700) -EXTRAKEY_ENABLE = yes # Audio control and System control(+450) -CONSOLE_ENABLE = yes # Console for debug(+400) -COMMAND_ENABLE = yes # Commands for debug and configuration -#SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend -#NKRO_ENABLE = yes # USB Nkey Rollover -ADB_MOUSE_ENABLE = yes +BOOTMAGIC_ENABLE ?= yes # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700) +EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450) +CONSOLE_ENABLE ?= yes # Console for debug(+400) +COMMAND_ENABLE ?= yes # Commands for debug and configuration +KEYBOARD_LOCK_ENABLE ?= yes # Allow locking of keyboard via magic key +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE ?= no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE ?= yes # USB Nkey Rollover +BACKLIGHT_ENABLE ?= yes # Enable keyboard backlight functionality +MIDI_ENABLE ?= no # MIDI controls +UNICODE_ENABLE ?= no # Unicode +BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE ?= no # Audio output on port C6 -# ADB Mice need acceleration for todays much bigger screens. -OPT_DEFS += -DADB_MOUSE_MAXACC=8 - - -# Optimize size but this may cause error "relocation truncated to fit" -#EXTRALDFLAGS = -Wl,--relax - -# Search Path -VPATH += $(TARGET_DIR) -VPATH += $(TMK_DIR) - -include $(TMK_DIR)/protocol/lufa.mk -include $(TMK_DIR)/protocol.mk -include $(TMK_DIR)/common.mk -include $(TMK_DIR)/rules.mk +ifndef QUANTUM_DIR + include ../../Makefile +endif \ No newline at end of file diff --git a/keyboard/arrow_pad/README.md b/keyboard/arrow_pad/README.md new file mode 100644 index 00000000000..f669ad6a121 --- /dev/null +++ b/keyboard/arrow_pad/README.md @@ -0,0 +1,24 @@ +arrow_pad keyboard firmware +====================== + +## Quantum MK Firmware + +For the full Quantum feature list, see [the parent README.md](/README.md). + +## Building + +Download or clone the whole firmware and navigate to the keyboard/arrow_pad folder. Once your dev env is setup, you'll be able to type `make` to generate your .hex - you can then use the Teensy Loader to program your .hex file. + +Depending on which keymap you would like to use, you will have to compile slightly differently. + +### Default +To build with the default keymap, simply run `make`. + +### Other Keymaps +Several version of keymap are available in advance but you are recommended to define your favorite layout yourself. To define your own keymap create file named `.c` in the keymaps folder, and see keymap document (you can find in top README.md) and existent keymap files. + +To build the firmware binary hex file with a keymap just do `make` with `KEYMAP` option like: +``` +$ make KEYMAP=[default|jack|] +``` +Keymaps follow the format **__\.c__** and are stored in the `keymaps` folder. \ No newline at end of file diff --git a/keyboard/arrow_pad/arrow_pad.c b/keyboard/arrow_pad/arrow_pad.c new file mode 100644 index 00000000000..f29c2c53fe7 --- /dev/null +++ b/keyboard/arrow_pad/arrow_pad.c @@ -0,0 +1,114 @@ +#include "arrow_pad.h" + +__attribute__ ((weak)) +void matrix_init_user(void) { + // leave this function blank - it can be defined in a keymap file +}; + +__attribute__ ((weak)) +void matrix_scan_user(void) { + // leave this function blank - it can be defined in a keymap file +} + +__attribute__ ((weak)) +bool process_action_user(keyrecord_t *record) { + // leave this function blank - it can be defined in a keymap file + return true; +} + +__attribute__ ((weak)) +void led_set_user(uint8_t usb_led) { + // leave this function blank - it can be defined in a keymap file +} + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + +#ifdef BACKLIGHT_ENABLE + backlight_init_ports(); +#endif + + matrix_init_user(); +} + +void matrix_scan_kb(void) { + // put your looping keyboard code here + // runs every cycle (a lot) + + matrix_scan_user(); +} + +bool process_action_kb(keyrecord_t *record) { + // put your per-action keyboard code here + // runs for every action, just before processing by the firmware + + return process_action_user(record); +} + +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + + led_set_user(usb_led); +} + +#ifdef BACKLIGHT_ENABLE +#define CHANNEL OCR1C + +void backlight_init_ports() +{ + + // Setup PB7 as output and output low. + DDRB |= (1<<7); + PORTB &= ~(1<<7); + + // Use full 16-bit resolution. + ICR1 = 0xFFFF; + + // I could write a wall of text here to explain... but TL;DW + // Go read the ATmega32u4 datasheet. + // And this: http://blog.saikoled.com/post/43165849837/secret-konami-cheat-code-to-high-resolution-pwm-on + + // Pin PB7 = OCR1C (Timer 1, Channel C) + // Compare Output Mode = Clear on compare match, Channel C = COM1C1=1 COM1C0=0 + // (i.e. start high, go low when counter matches.) + // WGM Mode 14 (Fast PWM) = WGM13=1 WGM12=1 WGM11=1 WGM10=0 + // Clock Select = clk/1 (no prescaling) = CS12=0 CS11=0 CS10=1 + + TCCR1A = _BV(COM1C1) | _BV(WGM11); // = 0b00001010; + TCCR1B = _BV(WGM13) | _BV(WGM12) | _BV(CS10); // = 0b00011001; + + backlight_init(); +} + +void backlight_set(uint8_t level) +{ + if ( level == 0 ) + { + // Turn off PWM control on PB7, revert to output low. + TCCR1A &= ~(_BV(COM1C1)); + CHANNEL = 0x0; + // Prevent backlight blink on lowest level + PORTB &= ~(_BV(PORTB7)); + } + else if ( level == BACKLIGHT_LEVELS ) + { + // Prevent backlight blink on lowest level + PORTB &= ~(_BV(PORTB7)); + // Turn on PWM control of PB7 + TCCR1A |= _BV(COM1C1); + // Set the brightness + CHANNEL = 0xFFFF; + } + else + { + // Prevent backlight blink on lowest level + PORTB &= ~(_BV(PORTB7)); + // Turn on PWM control of PB7 + TCCR1A |= _BV(COM1C1); + // Set the brightness + CHANNEL = 0xFFFF >> ((BACKLIGHT_LEVELS - level) * ((BACKLIGHT_LEVELS + 1) / 2)); + } +} + +#endif \ No newline at end of file diff --git a/keyboard/arrow_pad/arrow_pad.h b/keyboard/arrow_pad/arrow_pad.h new file mode 100644 index 00000000000..2026b52d1dd --- /dev/null +++ b/keyboard/arrow_pad/arrow_pad.h @@ -0,0 +1,18 @@ +#ifndef ARROW_PAD_H +#define ARROW_PAD_H + +#include "matrix.h" +#include "keymap_common.h" +#ifdef BACKLIGHT_ENABLE + #include "backlight.h" +#endif +#include +#include + +void matrix_init_user(void); +void matrix_scan_user(void); +bool process_action_user(keyrecord_t *record); +void led_set_user(uint8_t usb_led); +void backlight_init_ports(void); + +#endif diff --git a/keyboard/arrow_pad/config.h b/keyboard/arrow_pad/config.h new file mode 100644 index 00000000000..9e85f3ccf6a --- /dev/null +++ b/keyboard/arrow_pad/config.h @@ -0,0 +1,158 @@ +/* +Copyright 2012 Jun Wako + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#ifndef CONFIG_H +#define CONFIG_H + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x4096 +#define DEVICE_VER 0x0001 +#define MANUFACTURER Nobody +#define PRODUCT GoldPad +#define DESCRIPTION A custom keyboard + +/* key matrix size */ +#define MATRIX_ROWS 6 +#define MATRIX_COLS 4 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ +#define MATRIX_ROW_PINS { F0, F1, F4, F5, F6, F7 } +#define MATRIX_COL_PINS { B0, B1, B2, B3 } +#define UNUSED_PINS + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION ROW2COL + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCING_DELAY 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ +#define BACKLIGHT_LEVELS 3 + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +//#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +//#define LOCKING_RESYNC_ENABLE + +/* + * Force NKRO + * + * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved + * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the + * makefile for this to work.) + * + * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N) + * until the next keyboard reset. + * + * NKRO may prevent your keystrokes from being detected in the BIOS, but it is + * fully operational during normal computer usage. + * + * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N) + * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by + * bootmagic, NKRO mode will always be enabled until it is toggled again during a + * power-up. + * + */ +#define FORCE_NKRO + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + +/* key combination for magic key command */ +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) + +/* control how magic key switches layers */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false + +/* override magic key keymap */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM +//#define MAGIC_KEY_HELP1 H +//#define MAGIC_KEY_HELP2 SLASH +//#define MAGIC_KEY_DEBUG D +//#define MAGIC_KEY_DEBUG_MATRIX X +//#define MAGIC_KEY_DEBUG_KBD K +//#define MAGIC_KEY_DEBUG_MOUSE M +//#define MAGIC_KEY_VERSION V +//#define MAGIC_KEY_STATUS S +//#define MAGIC_KEY_CONSOLE C +//#define MAGIC_KEY_LAYER0_ALT1 ESC +//#define MAGIC_KEY_LAYER0_ALT2 GRAVE +//#define MAGIC_KEY_LAYER0 0 +//#define MAGIC_KEY_LAYER1 1 +//#define MAGIC_KEY_LAYER2 2 +//#define MAGIC_KEY_LAYER3 3 +//#define MAGIC_KEY_LAYER4 4 +//#define MAGIC_KEY_LAYER5 5 +//#define MAGIC_KEY_LAYER6 6 +//#define MAGIC_KEY_LAYER7 7 +//#define MAGIC_KEY_LAYER8 8 +//#define MAGIC_KEY_LAYER9 9 +//#define MAGIC_KEY_BOOTLOADER PAUSE +//#define MAGIC_KEY_LOCK CAPS +//#define MAGIC_KEY_EEPROM E +//#define MAGIC_KEY_NKRO N +//#define MAGIC_KEY_SLEEP_LED Z + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +/* disable debug print */ +//#define NO_DEBUG + +/* disable print */ +//#define NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION + +#endif diff --git a/keyboard/arrow_pad/keymaps/default/compiled.hex b/keyboard/arrow_pad/keymaps/default/compiled.hex new file mode 100644 index 00000000000..789eb4c3fc5 Binary files /dev/null and b/keyboard/arrow_pad/keymaps/default/compiled.hex differ diff --git a/keyboard/arrow_pad/keymaps/default/keymap.c b/keyboard/arrow_pad/keymaps/default/keymap.c new file mode 100644 index 00000000000..5647f75afea --- /dev/null +++ b/keyboard/arrow_pad/keymaps/default/keymap.c @@ -0,0 +1,163 @@ +// This is the canonical layout file for the Quantum project. If you want to add another keyboard, +// this is the style you want to emulate. + +#include "arrow_pad.h" +#include "led.h" + +// This is the 21-key keypad to 2x11 element matrix mapping +#define KEYMAP( \ + KM_ESC, KM_TAB, KM_BSL, KM_ARR, \ + KM_NUM, KM_FSL, KM_AST, KM_MIN, \ + KM___7, KM___8, KM___9, KM_EQU, \ + KM___4, KM___5, KM___6, KM_PLS, \ + KM___1, KM___2, KM___3, ___ENT, \ + KM___0, _____0, KM_DOT, KM_ENT \ +) { \ + { KM_ESC, KM_TAB, KM_BSL, KM_ARR }, \ + { KM_NUM, KM_FSL, KM_AST, KM_MIN }, \ + { KM___7, KM___8, KM___9, KM_EQU }, \ + { KM___4, KM___5, KM___6, KM_PLS }, \ + { KM___1, KM___2, KM___3, KC_NO }, \ + { KM___0, KC_NO, KM_DOT, KM_ENT } \ +} + +#define LAYER_BASE 0 +#define LAYER_EDIT 1 +#define LAYER_FUNCTION 2 + +#define MACRO_COPY_CUT 0 +#define MACRO_SHIFT_CONTROL 1 +#define MACRO_CONTROL_ALT 2 + +#define M_COPY KC_FN5 +#define M_SHFCT KC_FN6 +#define M_CTALT KC_FN7 + +#define SC_UNDO LCTL(KC_Z) +#define SC_REDO LCTL(KC_Y) +#define SC_CUT LCTL(KC_X) +#define SC_COPY LCTL(KC_C) +#define SC_PSTE LCTL(KC_V) +#define SC_SELA LCTL(KC_A) +#define SC_SAVE LCTL(KC_S) +#define SC_OPEN LCTL(KC_O) +#define SC_ACLS LALT(KC_F4) +#define SC_CCLS LCTL(KC_F4) + +#define _______ KC_TRNS +#define XXXXXXX KC_NO + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +[LAYER_BASE] = KEYMAP( \ + KC_ESC, KC_TAB, KC_BSLS, KC_FN0, \ + KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS, \ + KC_P7, KC_P8, KC_P9, KC_PEQL, \ + KC_P4, KC_P5, KC_P6, KC_PPLS, \ + KC_P1, KC_P2, KC_P3, XXXXXXX, \ + KC_P0, KC_PCMM, KC_PDOT, KC_PENT ), + +[LAYER_EDIT] = KEYMAP( \ + KC_ESC, KC_TAB, KC_SPC, _______, \ + KC_FN1, SC_PSTE, SC_REDO, SC_UNDO, \ + KC_HOME, KC_UP, KC_PGUP, KC_LALT, \ + KC_LEFT, M_COPY, KC_RGHT, KC_LCTL, \ + KC_END, KC_DOWN, KC_PGDN, XXXXXXX, \ + KC_BSPC, KC_PENT, KC_DEL, M_SHFCT), + +[LAYER_FUNCTION] = KEYMAP( \ + KC_FN2, KC_FN3, KC_FN4, _______, \ + KC_FN1, _______, _______, _______, \ + _______, _______, _______, _______, \ + _______, _______, _______, _______, \ + _______, _______, _______, XXXXXXX, \ + RESET, _______, _______, _______ ), + +}; + + +const uint16_t PROGMEM fn_actions[] = { + [0] = ACTION_LAYER_MOMENTARY(LAYER_FUNCTION), + [1] = ACTION_LAYER_TOGGLE(LAYER_EDIT), + [2] = ACTION_BACKLIGHT_TOGGLE(), + [3] = ACTION_BACKLIGHT_INCREASE(), + [4] = ACTION_BACKLIGHT_DECREASE(), + [5] = ACTION_MACRO_TAP(MACRO_COPY_CUT), + [6] = ACTION_MACRO_TAP(MACRO_SHIFT_CONTROL), + [7] = ACTION_MACRO_TAP(MACRO_CONTROL_ALT), + +}; + + +void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) +{ +} + + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) +{ + // MACRODOWN only works in this function + switch (id) { + + case MACRO_COPY_CUT: + if (record->event.pressed) { + register_code(KC_LCTL); + if (record->tap.count == 1) { + register_code(KC_C); + unregister_code(KC_C); + } + else if (record->tap.count == 2) { + register_code(KC_X); + unregister_code(KC_X); + } + unregister_code(KC_LCTL); + } + break; + + case MACRO_SHIFT_CONTROL: + if (record->event.pressed) { + if (record->tap.count <= 2) register_mods(MOD_BIT(KC_LSFT)); + if (record->tap.count == 2) register_mods(MOD_BIT(KC_LCTL)); + if (record->tap.count == 3) register_code(KC_PENT);; + } + else { + unregister_mods(MOD_BIT(KC_LSFT) | MOD_BIT(KC_LCTL)); + unregister_code(KC_PENT); + } + break; + + case MACRO_CONTROL_ALT: + if (record->event.pressed) { + if (record->tap.count < 2) register_mods(MOD_BIT(KC_LCTL)); + if (record->tap.count >= 2) register_mods(MOD_BIT(KC_LALT)); + } + else { + unregister_mods(MOD_BIT(KC_LCTL) | MOD_BIT(KC_LALT)); + } + break; + } + + return MACRO_NONE; +} + +void led_set_user(uint8_t usb_led) +{ + if (usb_led & (1< + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#ifndef CONFIG_H +#define CONFIG_H + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x4097 +#define DEVICE_VER 0x0001 +#define MANUFACTURER Nobody +#define PRODUCT Arrow Pad 21 +#define DESCRIPTION 21-Key QMK Assistant + +/* key matrix size */ +#define MATRIX_ROWS 2 +#define MATRIX_COLS 11 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ +#define MATRIX_ROW_PINS { D3, D5 } +#define MATRIX_COL_PINS { F0, F1, F4, F5, F6, F7, B6, B5, B4, D7, D4 } +#define UNUSED_PINS + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION ROW2COL + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCING_DELAY 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ +#define BACKLIGHT_LEVELS 3 + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +//#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +//#define LOCKING_RESYNC_ENABLE + +/* + * Force NKRO + * + * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved + * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the + * makefile for this to work.) + * + * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N) + * until the next keyboard reset. + * + * NKRO may prevent your keystrokes from being detected in the BIOS, but it is + * fully operational during normal computer usage. + * + * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N) + * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by + * bootmagic, NKRO mode will always be enabled until it is toggled again during a + * power-up. + * + */ +#define FORCE_NKRO + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + +/* key combination for magic key command */ +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) + +/* control how magic key switches layers */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false + +/* override magic key keymap */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM +//#define MAGIC_KEY_HELP1 H +//#define MAGIC_KEY_HELP2 SLASH +//#define MAGIC_KEY_DEBUG D +//#define MAGIC_KEY_DEBUG_MATRIX X +//#define MAGIC_KEY_DEBUG_KBD K +//#define MAGIC_KEY_DEBUG_MOUSE M +//#define MAGIC_KEY_VERSION V +//#define MAGIC_KEY_STATUS S +//#define MAGIC_KEY_CONSOLE C +//#define MAGIC_KEY_LAYER0_ALT1 ESC +//#define MAGIC_KEY_LAYER0_ALT2 GRAVE +//#define MAGIC_KEY_LAYER0 0 +//#define MAGIC_KEY_LAYER1 1 +//#define MAGIC_KEY_LAYER2 2 +//#define MAGIC_KEY_LAYER3 3 +//#define MAGIC_KEY_LAYER4 4 +//#define MAGIC_KEY_LAYER5 5 +//#define MAGIC_KEY_LAYER6 6 +//#define MAGIC_KEY_LAYER7 7 +//#define MAGIC_KEY_LAYER8 8 +//#define MAGIC_KEY_LAYER9 9 +//#define MAGIC_KEY_BOOTLOADER PAUSE +//#define MAGIC_KEY_LOCK CAPS +//#define MAGIC_KEY_EEPROM E +//#define MAGIC_KEY_NKRO N +//#define MAGIC_KEY_SLEEP_LED Z + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +/* disable debug print */ +//#define NO_DEBUG + +/* disable print */ +//#define NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION + +#endif diff --git a/keyboard/arrow_pad/keymaps/pad_21/keymap.c b/keyboard/arrow_pad/keymaps/pad_21/keymap.c new file mode 100644 index 00000000000..28917a5d9e8 --- /dev/null +++ b/keyboard/arrow_pad/keymaps/pad_21/keymap.c @@ -0,0 +1,160 @@ +// This is the canonical layout file for the Quantum project. If you want to add another keyboard, +// this is the style you want to emulate. + +#include "arrow_pad.h" +#include "led.h" + +// This is the 21-key keypad to 2x11 element matrix mapping +#define KEYMAP( \ + KM_ESC, KM_TAB, KM_BSL, KM_ARR, \ + KM_NUM, KM_FSL, KM_AST, KM_MIN, \ + KM___7, KM___8, KM___9, ___PLS, \ + KM___4, KM___5, KM___6, KM_PLS, \ + KM___1, KM___2, KM___3, ___ENT, \ + KM___0, _____0, KM_DOT, KM_ENT \ +) { \ + { KM_ESC, KM_TAB, KM_BSL, KM_ARR, KM___7, KM___8, KM___9, KM_PLS, KM___1, KM___2, KM___3, }, \ + { KM_NUM, KM_FSL, KM_AST, KM_MIN, KM___4, KM___5, KM___6, KM_ENT, KC_NO, KM___0, KM_DOT, }, \ +} + + +#define LAYER_BASE 0 +#define LAYER_EDIT 1 +#define LAYER_FUNCTION 2 + +#define MACRO_COPY_CUT 0 +#define MACRO_SHIFT_CONTROL 1 +#define MACRO_CONTROL_ALT 2 + +#define M_COPY KC_FN5 +#define M_SHFCT KC_FN6 +#define M_CTALT KC_FN7 + +#define SC_UNDO LCTL(KC_Z) +#define SC_REDO LCTL(KC_Y) +#define SC_CUT LCTL(KC_X) +#define SC_COPY LCTL(KC_C) +#define SC_PSTE LCTL(KC_V) +#define SC_SELA LCTL(KC_A) +#define SC_SAVE LCTL(KC_S) +#define SC_OPEN LCTL(KC_O) +#define SC_ACLS LALT(KC_F4) +#define SC_CCLS LCTL(KC_F4) + +#define _______ KC_TRNS +#define XXXXXXX KC_NO + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +[LAYER_BASE] = KEYMAP( \ + KC_ESC, KC_TAB, KC_BSLS, KC_FN0, \ + KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS, \ + KC_P7, KC_P8, KC_P9, XXXXXXX, \ + KC_P4, KC_P5, KC_P6, KC_PPLS, \ + KC_P1, KC_P2, KC_P3, XXXXXXX, \ + KC_P0, XXXXXXX, KC_PDOT, KC_PENT ), + +[LAYER_EDIT] = KEYMAP( \ + KC_ESC, KC_TAB, KC_SPC, _______, \ + KC_FN1, SC_PSTE, SC_REDO, SC_UNDO, \ + KC_HOME, KC_UP, KC_PGUP, XXXXXXX, \ + KC_LEFT, M_COPY, KC_RGHT, M_CTALT, \ + KC_END, KC_DOWN, KC_PGDN, XXXXXXX, \ + KC_BSPC, XXXXXXX, KC_DEL, M_SHFCT), + +[LAYER_FUNCTION] = KEYMAP( \ + KC_FN2, KC_FN3, KC_FN4, _______, \ + KC_FN1, _______, _______, _______, \ + _______, _______, _______, XXXXXXX, \ + _______, _______, _______, _______, \ + _______, _______, _______, XXXXXXX, \ + RESET, XXXXXXX, _______, _______ ), + +}; + + +const uint16_t PROGMEM fn_actions[] = { + [0] = ACTION_LAYER_MOMENTARY(LAYER_FUNCTION), + [1] = ACTION_LAYER_TOGGLE(LAYER_EDIT), + [2] = ACTION_BACKLIGHT_TOGGLE(), + [3] = ACTION_BACKLIGHT_INCREASE(), + [4] = ACTION_BACKLIGHT_DECREASE(), + [5] = ACTION_MACRO_TAP(MACRO_COPY_CUT), + [6] = ACTION_MACRO_TAP(MACRO_SHIFT_CONTROL), + [7] = ACTION_MACRO_TAP(MACRO_CONTROL_ALT), + +}; + + +void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) +{ +} + + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) +{ + // MACRODOWN only works in this function + switch (id) { + + case MACRO_COPY_CUT: + if (record->event.pressed) { + register_code(KC_LCTL); + if (record->tap.count == 1) { + register_code(KC_C); + unregister_code(KC_C); + } + else if (record->tap.count == 2) { + register_code(KC_X); + unregister_code(KC_X); + } + unregister_code(KC_LCTL); + } + break; + + case MACRO_SHIFT_CONTROL: + if (record->event.pressed) { + if (record->tap.count <= 2) register_mods(MOD_BIT(KC_LSFT)); + if (record->tap.count == 2) register_mods(MOD_BIT(KC_LCTL)); + if (record->tap.count == 3) register_code(KC_PENT);; + } + else { + unregister_mods(MOD_BIT(KC_LSFT) | MOD_BIT(KC_LCTL)); + unregister_code(KC_PENT); + } + break; + + case MACRO_CONTROL_ALT: + if (record->event.pressed) { + if (record->tap.count < 2) register_mods(MOD_BIT(KC_LCTL)); + if (record->tap.count >= 2) register_mods(MOD_BIT(KC_LALT)); + } + else { + unregister_mods(MOD_BIT(KC_LCTL) | MOD_BIT(KC_LALT)); + } + break; + } + + return MACRO_NONE; +} + +void led_set_user(uint8_t usb_led) +{ + if (usb_led & (1< + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#ifndef CONFIG_H +#define CONFIG_H + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x4096 +#define DEVICE_VER 0x0001 +#define MANUFACTURER Nobody +#define PRODUCT Arrow Pad 24 +#define DESCRIPTION 24-Key QMK Assistant + +/* key matrix size */ +#define MATRIX_ROWS 6 +#define MATRIX_COLS 4 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ +#define MATRIX_ROW_PINS { F0, F1, F4, F5, F6, F7 } +#define MATRIX_COL_PINS { B0, B1, B2, B3 } +#define UNUSED_PINS + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION ROW2COL + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCING_DELAY 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ +#define BACKLIGHT_LEVELS 3 + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +//#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +//#define LOCKING_RESYNC_ENABLE + +/* + * Force NKRO + * + * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved + * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the + * makefile for this to work.) + * + * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N) + * until the next keyboard reset. + * + * NKRO may prevent your keystrokes from being detected in the BIOS, but it is + * fully operational during normal computer usage. + * + * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N) + * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by + * bootmagic, NKRO mode will always be enabled until it is toggled again during a + * power-up. + * + */ +#define FORCE_NKRO + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + +/* key combination for magic key command */ +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) + +/* control how magic key switches layers */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false + +/* override magic key keymap */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM +//#define MAGIC_KEY_HELP1 H +//#define MAGIC_KEY_HELP2 SLASH +//#define MAGIC_KEY_DEBUG D +//#define MAGIC_KEY_DEBUG_MATRIX X +//#define MAGIC_KEY_DEBUG_KBD K +//#define MAGIC_KEY_DEBUG_MOUSE M +//#define MAGIC_KEY_VERSION V +//#define MAGIC_KEY_STATUS S +//#define MAGIC_KEY_CONSOLE C +//#define MAGIC_KEY_LAYER0_ALT1 ESC +//#define MAGIC_KEY_LAYER0_ALT2 GRAVE +//#define MAGIC_KEY_LAYER0 0 +//#define MAGIC_KEY_LAYER1 1 +//#define MAGIC_KEY_LAYER2 2 +//#define MAGIC_KEY_LAYER3 3 +//#define MAGIC_KEY_LAYER4 4 +//#define MAGIC_KEY_LAYER5 5 +//#define MAGIC_KEY_LAYER6 6 +//#define MAGIC_KEY_LAYER7 7 +//#define MAGIC_KEY_LAYER8 8 +//#define MAGIC_KEY_LAYER9 9 +//#define MAGIC_KEY_BOOTLOADER PAUSE +//#define MAGIC_KEY_LOCK CAPS +//#define MAGIC_KEY_EEPROM E +//#define MAGIC_KEY_NKRO N +//#define MAGIC_KEY_SLEEP_LED Z + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +/* disable debug print */ +//#define NO_DEBUG + +/* disable print */ +//#define NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION + +#endif diff --git a/keyboard/arrow_pad/keymaps/pad_24/keymap.c b/keyboard/arrow_pad/keymaps/pad_24/keymap.c new file mode 100644 index 00000000000..5647f75afea --- /dev/null +++ b/keyboard/arrow_pad/keymaps/pad_24/keymap.c @@ -0,0 +1,163 @@ +// This is the canonical layout file for the Quantum project. If you want to add another keyboard, +// this is the style you want to emulate. + +#include "arrow_pad.h" +#include "led.h" + +// This is the 21-key keypad to 2x11 element matrix mapping +#define KEYMAP( \ + KM_ESC, KM_TAB, KM_BSL, KM_ARR, \ + KM_NUM, KM_FSL, KM_AST, KM_MIN, \ + KM___7, KM___8, KM___9, KM_EQU, \ + KM___4, KM___5, KM___6, KM_PLS, \ + KM___1, KM___2, KM___3, ___ENT, \ + KM___0, _____0, KM_DOT, KM_ENT \ +) { \ + { KM_ESC, KM_TAB, KM_BSL, KM_ARR }, \ + { KM_NUM, KM_FSL, KM_AST, KM_MIN }, \ + { KM___7, KM___8, KM___9, KM_EQU }, \ + { KM___4, KM___5, KM___6, KM_PLS }, \ + { KM___1, KM___2, KM___3, KC_NO }, \ + { KM___0, KC_NO, KM_DOT, KM_ENT } \ +} + +#define LAYER_BASE 0 +#define LAYER_EDIT 1 +#define LAYER_FUNCTION 2 + +#define MACRO_COPY_CUT 0 +#define MACRO_SHIFT_CONTROL 1 +#define MACRO_CONTROL_ALT 2 + +#define M_COPY KC_FN5 +#define M_SHFCT KC_FN6 +#define M_CTALT KC_FN7 + +#define SC_UNDO LCTL(KC_Z) +#define SC_REDO LCTL(KC_Y) +#define SC_CUT LCTL(KC_X) +#define SC_COPY LCTL(KC_C) +#define SC_PSTE LCTL(KC_V) +#define SC_SELA LCTL(KC_A) +#define SC_SAVE LCTL(KC_S) +#define SC_OPEN LCTL(KC_O) +#define SC_ACLS LALT(KC_F4) +#define SC_CCLS LCTL(KC_F4) + +#define _______ KC_TRNS +#define XXXXXXX KC_NO + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +[LAYER_BASE] = KEYMAP( \ + KC_ESC, KC_TAB, KC_BSLS, KC_FN0, \ + KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS, \ + KC_P7, KC_P8, KC_P9, KC_PEQL, \ + KC_P4, KC_P5, KC_P6, KC_PPLS, \ + KC_P1, KC_P2, KC_P3, XXXXXXX, \ + KC_P0, KC_PCMM, KC_PDOT, KC_PENT ), + +[LAYER_EDIT] = KEYMAP( \ + KC_ESC, KC_TAB, KC_SPC, _______, \ + KC_FN1, SC_PSTE, SC_REDO, SC_UNDO, \ + KC_HOME, KC_UP, KC_PGUP, KC_LALT, \ + KC_LEFT, M_COPY, KC_RGHT, KC_LCTL, \ + KC_END, KC_DOWN, KC_PGDN, XXXXXXX, \ + KC_BSPC, KC_PENT, KC_DEL, M_SHFCT), + +[LAYER_FUNCTION] = KEYMAP( \ + KC_FN2, KC_FN3, KC_FN4, _______, \ + KC_FN1, _______, _______, _______, \ + _______, _______, _______, _______, \ + _______, _______, _______, _______, \ + _______, _______, _______, XXXXXXX, \ + RESET, _______, _______, _______ ), + +}; + + +const uint16_t PROGMEM fn_actions[] = { + [0] = ACTION_LAYER_MOMENTARY(LAYER_FUNCTION), + [1] = ACTION_LAYER_TOGGLE(LAYER_EDIT), + [2] = ACTION_BACKLIGHT_TOGGLE(), + [3] = ACTION_BACKLIGHT_INCREASE(), + [4] = ACTION_BACKLIGHT_DECREASE(), + [5] = ACTION_MACRO_TAP(MACRO_COPY_CUT), + [6] = ACTION_MACRO_TAP(MACRO_SHIFT_CONTROL), + [7] = ACTION_MACRO_TAP(MACRO_CONTROL_ALT), + +}; + + +void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) +{ +} + + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) +{ + // MACRODOWN only works in this function + switch (id) { + + case MACRO_COPY_CUT: + if (record->event.pressed) { + register_code(KC_LCTL); + if (record->tap.count == 1) { + register_code(KC_C); + unregister_code(KC_C); + } + else if (record->tap.count == 2) { + register_code(KC_X); + unregister_code(KC_X); + } + unregister_code(KC_LCTL); + } + break; + + case MACRO_SHIFT_CONTROL: + if (record->event.pressed) { + if (record->tap.count <= 2) register_mods(MOD_BIT(KC_LSFT)); + if (record->tap.count == 2) register_mods(MOD_BIT(KC_LCTL)); + if (record->tap.count == 3) register_code(KC_PENT);; + } + else { + unregister_mods(MOD_BIT(KC_LSFT) | MOD_BIT(KC_LCTL)); + unregister_code(KC_PENT); + } + break; + + case MACRO_CONTROL_ALT: + if (record->event.pressed) { + if (record->tap.count < 2) register_mods(MOD_BIT(KC_LCTL)); + if (record->tap.count >= 2) register_mods(MOD_BIT(KC_LALT)); + } + else { + unregister_mods(MOD_BIT(KC_LCTL) | MOD_BIT(KC_LALT)); + } + break; + } + + return MACRO_NONE; +} + +void led_set_user(uint8_t usb_led) +{ + if (usb_led & (1< +#include "quantum.h" #include #include -#include #include "i2cmaster.h" #include diff --git a/keyboard/ergodox_ez/keymaps/ab/ab.hex b/keyboard/ergodox_ez/keymaps/ab/ab.hex deleted file mode 100644 index 1659ae5802c..00000000000 Binary files a/keyboard/ergodox_ez/keymaps/ab/ab.hex and /dev/null differ diff --git a/keyboard/ergodox_ez/keymaps/ab/compiled.hex b/keyboard/ergodox_ez/keymaps/ab/compiled.hex new file mode 100644 index 00000000000..9b4434b8648 Binary files /dev/null and b/keyboard/ergodox_ez/keymaps/ab/compiled.hex differ diff --git a/keyboard/ergodox_ez/keymaps/adnw/k_o_y/k_o_y.hex b/keyboard/ergodox_ez/keymaps/adnw/k_o_y/k_o_y.hex deleted file mode 100644 index 95036fc4444..00000000000 Binary files a/keyboard/ergodox_ez/keymaps/adnw/k_o_y/k_o_y.hex and /dev/null differ diff --git a/keyboard/ergodox_ez/keymaps/adnw_k_o_y/compiled.hex b/keyboard/ergodox_ez/keymaps/adnw_k_o_y/compiled.hex new file mode 100644 index 00000000000..a641210af87 Binary files /dev/null and b/keyboard/ergodox_ez/keymaps/adnw_k_o_y/compiled.hex differ diff --git a/keyboard/ergodox_ez/keymaps/adnw/k_o_y/keymap.c b/keyboard/ergodox_ez/keymaps/adnw_k_o_y/keymap.c similarity index 100% rename from keyboard/ergodox_ez/keymaps/adnw/k_o_y/keymap.c rename to keyboard/ergodox_ez/keymaps/adnw_k_o_y/keymap.c diff --git a/keyboard/ergodox_ez/keymaps/adnw/k_o_y/readme.md b/keyboard/ergodox_ez/keymaps/adnw_k_o_y/readme.md similarity index 100% rename from keyboard/ergodox_ez/keymaps/adnw/k_o_y/readme.md rename to keyboard/ergodox_ez/keymaps/adnw_k_o_y/readme.md diff --git a/keyboard/ergodox_ez/keymaps/alexjj/compiled.hex b/keyboard/ergodox_ez/keymaps/alexjj/compiled.hex new file mode 100644 index 00000000000..58fecdd2119 Binary files /dev/null and b/keyboard/ergodox_ez/keymaps/alexjj/compiled.hex differ diff --git a/keyboard/ergodox_ez/keymaps/alexjj/keymap.hex b/keyboard/ergodox_ez/keymaps/alexjj/keymap.hex deleted file mode 100644 index 13338a8922e..00000000000 Binary files a/keyboard/ergodox_ez/keymaps/alexjj/keymap.hex and /dev/null differ diff --git a/keyboard/ergodox_ez/keymaps/algernon/COPYING b/keyboard/ergodox_ez/keymaps/algernon/COPYING new file mode 100644 index 00000000000..94a9ed024d3 --- /dev/null +++ b/keyboard/ergodox_ez/keymaps/algernon/COPYING @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + Copyright (C) + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. diff --git a/keyboard/ergodox_ez/keymaps/algernon/Makefile b/keyboard/ergodox_ez/keymaps/algernon/Makefile new file mode 100644 index 00000000000..34e574220f9 --- /dev/null +++ b/keyboard/ergodox_ez/keymaps/algernon/Makefile @@ -0,0 +1,4 @@ +BOOTMAGIC_ENABLE=no +COMMAND_ENABLE=no +SLEEP_LED_ENABLE=no +UNICODE_ENABLE=no diff --git a/keyboard/ergodox_ez/keymaps/algernon/README.md b/keyboard/ergodox_ez/keymaps/algernon/README.md new file mode 100644 index 00000000000..b8578e438fd --- /dev/null +++ b/keyboard/ergodox_ez/keymaps/algernon/README.md @@ -0,0 +1,133 @@ +algernon's layout +======================= + +This is an unconventional layout for the ErgoDox EZ. For more details about the +history of the layout, see my +[blog posts about my ErgoDox journey][blog-ergodox]. + + [blog-ergodox]: https://asylum.madhouse-project.org/blog/tags/ergodox/ + +Some of the things in the layout only work when one uses Spacemacs and GNOME +under Linux. Your mileage may vary. + +## Base layer + +[![Base layer](images/base-layer.png)](http://www.keyboard-layout-editor.com/#/gists/28f7eb305fdbff943613e1dc7aa9e82b) + +At its core, this is a Dvorak layout, with some minor changes (for example, `-` +being on the left half, and on the innermost key of the bottom row on the +right). The more interesting parts are how certain keys behave: + +* The keys on the number row double as function keys, when held for a bit longer + than an usual tap. This allows me to use the function keys without having to + switch layers. +* The `Shift`, `Alt`, and `Control` modifiers are one-shot. When tapped, they + are considered active for the next key press only. When double tapped, they + toggle on, until a third, single tap sometime later. When held, they act as + expected. My usual pattern is that I use these for the next keypress only, so + this behaviour is perfect. If I need them held, I'll just double-tap. +* The `GUI` key is special, because when I double-tap it, it sends `GUI + w`, + which pops up an application selector. It also switches to a one-shot layer, + where the number row on the left half turns into app selector macros, for the + most common things I usually want to switch to. Otherwise it behaves as on a + normal layout. +* The `ESC` key also doubles as a one-shot cancel key: if tapped while any of + the one-shot modifiers are in-flight (as in, single-tapped, and not expired + yet), it cancels all one-shot modifiers. Otherwise it sends the usual keycode. +* The **Emacs** and **Hun** layer keys are one-shot, the **1Hand** is a toggle. +* The **Lead** key allows me to type in a sequence of keys, and trigger some + actions: + - `LEAD u` enters unicode input mode, by sending the GTK+ key sequence that + does this. + - `LEAD l` uses the unicode input method to enter a `λ`. + - `LEAD s` does a lot of magic to type in a shruggie: `¯\_(ツ)_/¯` + - `LEAD w m` maximises the currently focused window. + +## Hungarian layer + +[![Hungarian layer](images/hun-layer.png)](http://www.keyboard-layout-editor.com/#/gists/b160f6ec90d58c127c114c89f66e9dc9) + +On this layer, the accented characters are at the same position as their base +variant. For some, which can have other diatribes, the long one is on top, +short's on bottom. Tapping any of the accented characters takes us back to the +base layer. + +## Emacs layer + +[![Emacs layer](images/emacs-layer.png)](http://www.keyboard-layout-editor.com/#/gists/c59c453f9fe1a3238ba1494e7e5c6892) + +This layer is primarily for navigating text - and for some mousing and other +things, because there was space. Most of the keys should be pretty +self-explanatory, except for a few: + +* There are three keys on the bottom row of the left side, that change how some + of the other keys - explained just below - work. The keys are for *Emacs + mode* (the default), *Terminal mode*, and *Traditional mode*, respectively. +* The *Visual mode* key (the top big key on the left side) sends the `v` key in + *Emacs mode*, to enter Visual mode in Spacemacs. In all other modes, it is a + no-op. +* The *Copy/Cut* key (the bottom big key on the left side) sends the copy + command on tap, the cut one when held for longer than a normal tap. The **copy + command** is `y` in *Emacs mode*, `Ctrl-Shift-c` in *Terminal mode*, and + `Ctrl-c` in *Traditional mode*. The **cut command** is `x` in *Emacs mode*, + `Ctrl-Shift-x` in *Terminal Mode* and `Ctrl-x` in *Traditional mode*. +* The *Paste/Delete* key (the leftmost key on the left thumb cluster) sends the + paste command on tap, the delete one when held longer than a normal tap. The + **paste command** is `p` in *Emacs mode*, `Ctrl-Shift-v` in *Terminal mode*, + and `Ctrl-v` in *Traditional mode*. The **delete command** is `d` in *Emacs + mode*, and `DEL` in the other two. +* The `A`, `I` and `R` keys will - after sending themselves - clear the layer + back to the base layer. This allows a quick escape from the layer. + +## One-handed layer + +[![One-handed layer](images/one-handed-layer.png)](http://www.keyboard-layout-editor.com/#/gists/edff2495135955b8963198dace7f7ece) + +The one-handed layer is used in situations where the right hand is occupied, by +mousing around, for example. Tapping the `OTHER` key switches which side is +active. For the most part, keys remain in their usual position. When the right +half is active, keys are mirrored to the left half. + +The differences are as follows: + +* The `ESC` key has been moved to the bottom row, so the `OTHER` key is easier + to tap. +* Most keys on the thumb cluster now have dual uses, and these do not change + when switching sides: + - The `Space`/`Backspace` key sends `Space` on tap, `Backspace` when held + for longer than a normal tap. + - The `Enter`/`Shift` key sends `Enter` on short-tap, `Shift` on long-tap. +* The `Apps`/`BASE` key can be used to go back to the base layer, by + long-tapping it. A short-tap will send the `App` key, as usual. + +# Building + +To make my workflow easier, this layout is maintained in +[its own repository][algernon:ez-layout]. To build it, you will need the +[QMK][qmk] firmware checked out, and this repo either checked out, or symlinked +to `keyboard/ergodox_ez/algernon`. One way to achieve that is this: + + [algernon:ez-layout]: https://github.com/algernon/ergodox-layout + [qmk]: https://github.com/jackhumbert/qmk_firmware + +``` +$ git clone https://github.com/jackhumbert/qmk_firmware.git +$ cd qmk_firmware/keyboard/ergodox_ez +$ git clone https://github.com/algernon/ergodox-layout.git keymaps/algernon +$ make KEYMAP=algernon +``` + +From time to time, updates may be submitted back to the QMK repository. If you +are reading it there, you can build the firmware like any other firmware +included with it (assuming you are in the root directory of the firmware): + +``` +$ cd keyboard/ergodox_ez +$ make KEYMAP=algernon +``` + +# License + +The layout, being a derivative of the original TMK firmware which is under the +GPL-2+, this layout is under the GPL as well, but GPL-3+, rather than the older +version. diff --git a/keyboard/ergodox_ez/keymaps/algernon/compiled.hex b/keyboard/ergodox_ez/keymaps/algernon/compiled.hex new file mode 100644 index 00000000000..6146c48fd83 Binary files /dev/null and b/keyboard/ergodox_ez/keymaps/algernon/compiled.hex differ diff --git a/keyboard/ergodox_ez/keymaps/algernon/config.h b/keyboard/ergodox_ez/keymaps/algernon/config.h new file mode 100644 index 00000000000..724618cc488 --- /dev/null +++ b/keyboard/ergodox_ez/keymaps/algernon/config.h @@ -0,0 +1,27 @@ +#ifndef CONFIG_USER_H +#define CONFIG_USER_H 1 + +#include "../../config.h" + +#undef MOUSEKEY_TIME_TO_MAX +#undef MOUSEKEY_MAX_SPEED + +#define MOUSEKEY_TIME_TO_MAX 1 +#define MOUSEKEY_MAX_SPEED 2 + +#undef MOUSEKEY_DELAY +#define MOUSEKEY_DELAY 0 + +#undef MOUSEKEY_WHEEL_DELAY +#define MOUSEKEY_WHEEL_DELAY 0 + +#define ONESHOT_TAP_TOGGLE 2 +#define ONESHOT_TIMEOUT 3000 + +#undef LOCKING_SUPPORT_ENABLE +#undef LOCKING_RESYNC_ENABLE + +#undef LEADER_TIMEOUT +#define LEADER_TIMEOUT 1000 + +#endif diff --git a/keyboard/ergodox_ez/keymaps/algernon/images/base-layer.png b/keyboard/ergodox_ez/keymaps/algernon/images/base-layer.png new file mode 100644 index 00000000000..e335859205c Binary files /dev/null and b/keyboard/ergodox_ez/keymaps/algernon/images/base-layer.png differ diff --git a/keyboard/ergodox_ez/keymaps/algernon/images/emacs-layer.png b/keyboard/ergodox_ez/keymaps/algernon/images/emacs-layer.png new file mode 100644 index 00000000000..1aa23cc00ef Binary files /dev/null and b/keyboard/ergodox_ez/keymaps/algernon/images/emacs-layer.png differ diff --git a/keyboard/ergodox_ez/keymaps/algernon/images/hun-layer.png b/keyboard/ergodox_ez/keymaps/algernon/images/hun-layer.png new file mode 100644 index 00000000000..3c766539218 Binary files /dev/null and b/keyboard/ergodox_ez/keymaps/algernon/images/hun-layer.png differ diff --git a/keyboard/ergodox_ez/keymaps/algernon/images/one-handed-layer.png b/keyboard/ergodox_ez/keymaps/algernon/images/one-handed-layer.png new file mode 100644 index 00000000000..283559b3a97 Binary files /dev/null and b/keyboard/ergodox_ez/keymaps/algernon/images/one-handed-layer.png differ diff --git a/keyboard/ergodox_ez/keymaps/algernon/keymap.c b/keyboard/ergodox_ez/keymaps/algernon/keymap.c new file mode 100644 index 00000000000..7ded1e1aee7 --- /dev/null +++ b/keyboard/ergodox_ez/keymaps/algernon/keymap.c @@ -0,0 +1,932 @@ +/* + * algernon's ErgoDox EZ layout, please see the README.md file! + */ + +#include "ergodox_ez.h" +#include "led.h" +#include "debug.h" +#include "action_layer.h" +#include "action_util.h" +#include "mousekey.h" +#include "timer.h" + +/* Layers */ + +#define BASE 0 // default layer +#define APPSEL 1 // application select layer +#define HUN 2 // Hungarian layer +#define EMACS 3 // (Spac)Emacs layer +#define OHLFT 4 // One-handed, left side +#define OHRGT 5 // One-handed, right side + +/* Macros */ + +#define A_GUI 0 // GUI magic +#define A_ESC 44 // OSM-clearing ESC + +#define A_MUL 1 // mouse up-left +#define A_MUR 2 // mouse up-right +#define A_MDL 3 // mouse down-left +#define A_MDR 4 // mouse down-right + +#define AE_VIS 5 // Visual mode +#define AE_PSTDEL 6 // Paste/Delete +#define AE_CPYC 7 // Copy/Cut +#define AE_EMACS 8 // Emacs copy & paste mode +#define AE_TERM 9 // Terminal copy & paste mode +#define AE_OTHER 10 // Other copy & paste mode +#define AE_INS 11 // Insert mode +#define AE_OVR 12 // Overwrite mode +#define AE_APPND 13 // Append + +#define HU_AA 14 // Á +#define HU_OO 15 // Ó +#define HU_EE 16 // É +#define HU_UU 17 // Ú +#define HU_II 18 // Í +#define HU_OE 19 // Ö +#define HU_UE 20 // Ü +#define HU_OEE 21 // Ő +#define HU_UEE 22 // Ű + +#define APP_SLK 23 // Slack +#define APP_EMCS 24 // Emacs +#define APP_TERM 25 // Terminal +#define APP_CHRM 26 // Chrome +#define APP_MSIC 27 // Music + +#define KF_1 28 // 1, F1 +#define KF_2 29 // 2, F2 +#define KF_3 30 // ... +#define KF_4 31 +#define KF_5 32 +#define KF_6 33 +#define KF_7 34 +#define KF_8 35 +#define KF_9 36 +#define KF_10 37 +#define KF_11 38 // =, F11 + +#define OH_BSSPC 39 +#define OH_ENTSFT 40 +#define OH_BASE 41 +#define OH_LEFT 42 +#define OH_RIGHT 43 + +/* Fn keys */ +#define F_BSE 0 +#define F_HUN 1 +#define F_GUI 2 +#define F_SFT 3 +#define F_ALT 4 +#define F_CTRL 5 + +/* States & timers */ + +uint8_t m_visual_state = 0; +static uint16_t m_cutdel_timer; +static uint16_t m_copypaste_timer; + +uint16_t gui_timer = 0; + +uint16_t kf_timers[12]; + +uint16_t oh_base_timer = 0; +uint16_t oh_bsspc_timer = 0; +uint16_t oh_entsft_timer = 0; + +#define OH_BLINK_INTERVAL 500 + +uint8_t oh_left_blink = 0; +uint16_t oh_left_blink_timer = 0; +uint8_t oh_right_blink = 0; +uint16_t oh_right_blink_timer = 0; + +enum { + CP_EMACS = 0, + CP_TERM = 1, + CP_OTHER = 2, +}; + +uint8_t cp_mode = CP_EMACS; + +/* The Keymap */ + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Keymap 0: Base Layer + * + * ,-----------------------------------------------------. ,-----------------------------------------------------. + * | `~ | 1 F1 | 2 F2 | 3 F3 | 4 F4 | 5 F5 | Apps | | Apps | 6 F6 | 7 F7 | 8 F8 | 9 F9 | 0 F10| = F11 | + * |-----------+------+------+------+------+-------------| |------+------+------+------+------+------+-----------| + * | Tab | ' | , | . | P | Y | [ | | ] | F | G | C | R | L | / | + * |-----------+------+------+------+------+------| | | |------+------+------+------+------+-----------| + * | - | A | O | E | U | I |------| |------| D | H | T | N | S | \ | + * |-----------+------+------+------+------+------| ( | | ) |------+------+------+------+------+-----------| + * | Play/Pause| ; | Q | J | K | X | | | | B | M | W | V | Z | Stop | + * `-----------+------+------+------+------+-------------' `-------------+------+------+------+------+-----------' + * | Home | End | Down | Up | : | | - | Left | Right| PgUp | PgDn | + * `-----------------------------------' `-----------------------------------' + * ,-------------. ,-------------. + * | LAlt | GUI | |EMACS | 1HND | + * ,------|------|------| |------+------+------. + * | | | Ctrl | | LEAD | | | + * |Backsp|LShift|------| |------| Enter| Space| + * | | | ESC | | HUN | | | + * `--------------------' `--------------------' + */ +[BASE] = KEYMAP( +// left hand + KC_GRV ,M(KF_1) ,M(KF_2) ,M(KF_3),M(KF_4),M(KF_5),KC_APP +,KC_TAB ,KC_QUOT ,KC_COMM ,KC_DOT ,KC_P ,KC_Y ,KC_LBRC +,KC_MINS ,KC_A ,KC_O ,KC_E ,KC_U ,KC_I +,KC_MPLY ,KC_SCLN ,KC_Q ,KC_J ,KC_K ,KC_X ,KC_LPRN +,KC_HOME ,KC_END ,KC_DOWN ,KC_UP ,KC_COLN + + ,F(F_ALT),F(F_GUI) + ,F(F_CTRL) + ,KC_BSPC,F(F_SFT),M(A_ESC) + + // right hand + ,KC_APP ,M(KF_6),M(KF_7),M(KF_8),M(KF_9) ,M(KF_10) ,M(KF_11) + ,KC_RBRC ,KC_F ,KC_G ,KC_C ,KC_R ,KC_L ,KC_SLSH + ,KC_D ,KC_H ,KC_T ,KC_N ,KC_S ,KC_BSLS + ,KC_RPRN ,KC_B ,KC_M ,KC_W ,KC_V ,KC_Z ,KC_MSTP + ,KC_MINS,KC_LEFT,KC_RGHT ,KC_PGUP ,KC_PGDN + + ,OSL(EMACS),M(OH_LEFT) + ,KC_LEAD + ,F(F_HUN),KC_ENT ,KC_SPC + ), + +/* Keymap 1: Application select layer + * + * ,-----------------------------------------------------. ,-----------------------------------------------------. + * | |Music |Slack |Emacs |Term |Chrome| | | | | | | | | | + * |-----------+------+------+------+------+-------------| |------+------+------+------+------+------+-----------| + * | | | | | | | | | | | | | | | | + * |-----------+------+------+------+------+------| | | |------+------+------+------+------+-----------| + * | | | | | | |------| |------| | | | | | | + * |-----------+------+------+------+------+------| | | |------+------+------+------+------+-----------| + * | | | | | | | | | | | | | | | | + * `-----------+------+------+------+------+-------------' `-------------+------+------+------+------+-----------' + * | | | | | | | | | | | | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | | | | | | + * ,------|------|------| |------+------+------. + * | | | | | | | | + * | | |------| |------| | | + * | | | | | | | | + * `--------------------' `--------------------' + */ + +[APPSEL] = KEYMAP( +// left hand + KC_TRNS ,M(APP_MSIC),M(APP_SLK),M(APP_EMCS),M(APP_TERM),M(APP_CHRM),KC_TRNS +,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS +,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS +,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS +,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS + + ,KC_TRNS ,KC_TRNS + ,KC_TRNS + ,KC_TRNS ,KC_TRNS ,KC_TRNS + + // right hand + ,KC_TRNS ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_TRNS + ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS + ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS + ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS + ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS + + ,KC_TRNS ,KC_TRNS + ,KC_TRNS + ,KC_TRNS ,KC_TRNS ,KC_TRNS + ), + + +/* Keymap 2: Hungarian Layer + * + * ,-----------------------------------------------------. ,-----------------------------------------------------. + * | | | | | | | | | | | | | | | | + * |-----------+------+------+------+------+-------------| |------+------+------+------+------+------+-----------| + * | | | Ő | | Ű | | | | | | | | | | | + * |-----------+------+------+------+------+------| | | |------+------+------+------+------+-----------| + * | | Á | Ó | É | Ú | Í |------| |------| | | | | | | + * |-----------+------+------+------+------+------| | | |------+------+------+------+------+-----------| + * | | | Ö | | Ü | | | | | | | | | | | + * `-----------+------+------+------+------+-------------' `-------------+------+------+------+------+-----------' + * | | | | | | | | | | | | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | | | | | | + * ,------|------|------| |------+------+------. + * | | | | | | | | + * | | |------| |------| | | + * | | | | | BASE | | | + * `--------------------' `--------------------' + */ + +[HUN] = KEYMAP( +// left hand + KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_TRNS +,KC_NO ,KC_NO ,M(HU_OEE),KC_NO ,M(HU_UEE),KC_NO ,KC_NO +,KC_NO ,M(HU_AA),M(HU_OO) ,M(HU_EE),M(HU_UU) ,M(HU_II) +,KC_TRNS ,KC_NO ,M(HU_OE) ,KC_NO ,M(HU_UE) ,KC_NO ,KC_NO +,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_NO + + ,KC_TRNS ,KC_TRNS + ,KC_TRNS + ,KC_TRNS ,KC_TRNS ,KC_TRNS + + // right hand + ,KC_TRNS ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO + ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO + ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO + ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO + ,KC_NO ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS + + ,KC_NO ,KC_NO + ,KC_NO + ,F(F_BSE),KC_TRNS ,KC_TRNS + ), + +/* Keymap 3: Spacemacs layer + * + * ,-----------------------------------------------------. ,-----------------------------------------------------. + * | MS Slow | 1 F1 | 2 F2 | 3 F3 | 4 F4 | 5 F5 |ScrLCK| |ScrLCK| 6 F6 | 7 F7 | 8 F8 | 9 F9 | 0 F10| F11 | + * |-----------+------+------+------+------+-------------| |------+------+------+------+------+------+-----------| + * | MS Normal | | Home | Up | PgUp | |Visual| |Scroll| $ |MsUpL | MsUp |MsUpR | R |PrintScreen| + * |-----------+------+------+------+------+------| Mode | | Up |------+------+------+------+------+-----------| + * | MS Fast |APPEND| Left | Down | Right| INS |------| |------| D |MsLeft| MsDn |MsRght| | | + * |-----------+------+------+------+------+------| Cut | |Scroll|------+------+------+------+------+-----------| + * | Play/Pause| | End | Down | PgDn | X | Copy | | Down | |MsDnL | W |MsDnR | | Stop | + * `-----------+------+------+------+------+-------------' `-------------+------+------+------+------+-----------' + * |EmacsM|TermM |OtherM| | | |Vol Up|Vol Dn| Mute | | | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | Alt | GUI | | BASE | MClk | + * ,------|------|------| |------+------+------. + * |Delete| | Ctrl | | Prev |Left |Right | + * | |LShift|------| |------| Click| Click| + * |Paste | | ESC | | Next | | | + * `--------------------' `--------------------' + */ +[EMACS] = KEYMAP( +// left hand + KC_ACL0 ,M(KF_1) ,M(KF_2) ,M(KF_3) ,M(KF_4) ,M(KF_5) ,LGUI(KC_L) +,KC_ACL1 ,KC_NO ,KC_HOME ,KC_UP ,KC_PGUP ,KC_NO ,M(AE_VIS) +,KC_ACL2 ,M(AE_APPND) ,KC_LEFT ,KC_DOWN ,KC_RIGHT,M(AE_INS) +,KC_MPLY ,KC_NO ,KC_END ,KC_DOWN ,KC_PGDN ,KC_X ,M(AE_CPYC) +,M(AE_EMACS),M(AE_TERM) ,M(AE_OTHER),KC_NO ,KC_NO + ,KC_TRNS ,KC_TRNS + ,KC_TRNS + ,M(AE_PSTDEL),KC_TRNS ,KC_TRNS + + // right hand + ,LGUI(KC_L),M(KF_6) ,M(KF_7) ,M(KF_8) ,M(KF_9) ,M(KF_10) ,M(KF_11) + ,KC_WH_U ,KC_DLR ,M(A_MUL),KC_MS_U ,M(A_MUR),M(AE_OVR),KC_PSCR + ,KC_D ,KC_MS_L ,KC_MS_D ,KC_MS_R ,KC_NO ,KC_NO + ,KC_WH_D ,KC_NO ,M(A_MDL),KC_W ,M(A_MDR),KC_NO ,KC_MSTP + ,KC_VOLU ,KC_VOLD ,KC_MUTE ,KC_NO ,KC_NO + + ,KC_TRNS ,KC_MS_BTN3 + ,KC_MPRV + ,KC_MNXT ,KC_BTN1 ,KC_BTN2 + ), + +/* Keymap 5: One-handed, left side + * + * ,-----------------------------------------------------. + * | `~ | 1 F1 | 2 F2 | 3 F3 | 4 F4 | 5 F5 |A BSE| + * |-----------+------+------+------+------+-------------| + * | Tab | ' | , | . | P | Y | [ | + * |-----------+------+------+------+------+------| | + * | - | A | O | E | U | I |------| + * |-----------+------+------+------+------+------| ( | + * | Play/Pause| ; | Q | J | K | X | | + * `-----------+------+------+------+------+-------------' + * | Home | End | Down | Up | ESC | + * `-----------------------------------' + * ,-------------. + * | LAlt | GUI | + * ,------|------|------| + * |BackSp|LShift| Ctrl | + * | | |------| + * |Space |Enter |OTHER | + * `--------------------' + */ +[OHLFT] = KEYMAP( +// left hand + KC_GRV ,M(KF_1) ,M(KF_2) ,M(KF_3) ,M(KF_4) ,M(KF_5) ,M(OH_BASE) +,KC_TAB ,KC_QUOT ,KC_COMM ,KC_DOT ,KC_P ,KC_Y ,KC_LBRC +,KC_MINS ,KC_A ,KC_O ,KC_E ,KC_U ,KC_I +,KC_MPLY ,KC_SCLN ,KC_Q ,KC_J ,KC_K ,KC_X ,KC_LPRN +,KC_HOME ,KC_END ,KC_DOWN ,KC_UP ,M(A_ESC) + + ,KC_TRNS ,KC_TRNS + ,KC_TRNS + ,M(OH_BSSPC),M(OH_ENTSFT),M(OH_RIGHT) + + // right hand + ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO + ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO + ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO + ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO + ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO + + ,KC_NO ,KC_NO + ,KC_NO + ,KC_NO ,KC_NO ,KC_NO + ), + +/* Keymap 6: One-handed, right side + * + * ,-----------------------------------------------------. + * | = F11 | 0 F10| 9 F9 | 8 F8 | 7 F7 | 6 F6 |A BSE| + * |-----------+------+------+------+------+-------------| + * | / | L | R | C | G | F | ] | + * |-----------+------+------+------+------+------| | + * | \ | S | N | T | H | D |------| + * |-----------+------+------+------+------+------| ) | + * | Stop | Z | V | W | M | B | | + * `-----------+------+------+------+------+-------------' + * | PgDn | PgUp | Right| Left | ESC | + * `-----------------------------------' + * ,-------------. + * | LAlt | GUI | + * ,------|------|------| + * |BackSp|LShift| Ctrl | + * | | |------| + * |Space |Enter |OTHER | + * `--------------------' + */ +[OHRGT] = KEYMAP( +// left hand + M(KF_11) ,M(KF_10) ,M(KF_9) ,M(KF_8) ,M(KF_7) ,M(KF_6) ,M(OH_BASE) +,KC_SLSH ,KC_L ,KC_R ,KC_C ,KC_G ,KC_F ,KC_RBRC +,KC_BSLS ,KC_S ,KC_N ,KC_T ,KC_H ,KC_D +,KC_MSTP ,KC_Z ,KC_V ,KC_W ,KC_M ,KC_B ,KC_RPRN +,KC_PGDN ,KC_PGUP ,KC_RGHT ,KC_LEFT ,M(A_ESC) + + ,KC_TRNS ,KC_TRNS + ,KC_TRNS + ,M(OH_BSSPC),M(OH_ENTSFT),M(OH_LEFT) + + // right hand + ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO + ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO + ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO + ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO + ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO + + ,KC_NO ,KC_NO + ,KC_NO + ,KC_NO ,KC_NO ,KC_NO + ), + +}; + +const uint16_t PROGMEM fn_actions[] = { + [F_BSE] = ACTION_LAYER_CLEAR(ON_PRESS) + ,[F_HUN] = ACTION_LAYER_INVERT(HUN, ON_PRESS) + ,[F_GUI] = ACTION_MACRO_TAP(A_GUI) + ,[F_SFT] = ACTION_MODS_ONESHOT (MOD_LSFT) + ,[F_ALT] = ACTION_MODS_ONESHOT (MOD_LALT) + ,[F_CTRL] = ACTION_MODS_ONESHOT (MOD_LCTL) +}; + +macro_t *ang_do_hun (keyrecord_t *record, uint16_t accent, uint16_t hun_char) +{ + uint8_t need_shift = 0; + uint8_t hold_shift = 0; + + if (!record->event.pressed) + return MACRO_NONE; + + layer_off (HUN); + + if (keyboard_report->mods & MOD_BIT (KC_LSFT)) { + hold_shift = 1; + need_shift = 1; + unregister_code (KC_LSFT); + } + if ((get_oneshot_mods () & MOD_BIT(KC_LSFT)) && !has_oneshot_mods_timed_out ()) { + need_shift = 1; + hold_shift = 0; + unregister_code (KC_LSFT); + } + + clear_oneshot_mods (); + + register_code (KC_RALT); + unregister_code (KC_RALT); + if (accent == (KC_DQT)) { + register_code (KC_RSFT); + } + register_code (accent); + unregister_code (accent); + if (need_shift && accent != (KC_DQT)) { + register_code (KC_RSFT); + } else if (accent == (KC_DQT) && !need_shift) { + unregister_code (KC_RSFT); + } + register_code (hun_char); + unregister_code (hun_char); + if (need_shift || accent == (KC_DQT)) + unregister_code (KC_RSFT); + if (hold_shift) + register_code (KC_LSFT); + + return MACRO_NONE; +} + +void ang_handle_kf (keyrecord_t *record, uint8_t id) +{ + uint8_t code = id - KF_1; + + if (record->event.pressed) { + kf_timers[code] = timer_read (); + } else { + uint8_t kc; + + if (timer_elapsed (kf_timers[code]) > TAPPING_TERM) { + // Long press + kc = KC_F1 + code; + } else { + if (id == KF_11) + kc = KC_EQL; + else + kc = KC_1 + code; + } + + register_code (kc); + unregister_code (kc); + } +} + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) +{ + switch(id) { + case A_ESC: + if (record->event.pressed) { + if ((get_oneshot_mods ()) && !has_oneshot_mods_timed_out ()) { + clear_oneshot_mods (); + } else { + register_code (KC_ESC); + } + } else { + unregister_code (KC_ESC); + } + break; + + /* Hungarian layer */ + case HU_AA: + return ang_do_hun (record, KC_QUOT, KC_A); + case HU_OO: + return ang_do_hun (record, KC_QUOT, KC_O); + case HU_EE: + return ang_do_hun (record, KC_QUOT, KC_E); + case HU_UU: + return ang_do_hun (record, KC_QUOT, KC_U); + case HU_II: + return ang_do_hun (record, KC_QUOT, KC_I); + case HU_OE: + return ang_do_hun (record, KC_DQT, KC_O); + case HU_UE: + return ang_do_hun (record, KC_DQT, KC_U); + case HU_OEE: + return ang_do_hun (record, KC_EQL, KC_O); + case HU_UEE: + return ang_do_hun (record, KC_EQL, KC_U); + + /* Mouse movement */ + case A_MUL: + if (record->event.pressed) { + mousekey_on(KC_MS_UP); + mousekey_on(KC_MS_LEFT); + } else { + mousekey_off(KC_MS_UP); + mousekey_off(KC_MS_LEFT); + } + mousekey_send(); + break; + + case A_MUR: + if (record->event.pressed) { + mousekey_on(KC_MS_UP); + mousekey_on(KC_MS_RIGHT); + } else { + mousekey_off(KC_MS_UP); + mousekey_off(KC_MS_RIGHT); + } + mousekey_send(); + break; + + case A_MDL: + if (record->event.pressed) { + mousekey_on(KC_MS_DOWN); + mousekey_on(KC_MS_LEFT); + } else { + mousekey_off(KC_MS_DOWN); + mousekey_off(KC_MS_LEFT); + } + mousekey_send(); + break; + + case A_MDR: + if (record->event.pressed) { + mousekey_on(KC_MS_DOWN); + mousekey_on(KC_MS_RIGHT); + } else { + mousekey_off(KC_MS_DOWN); + mousekey_off(KC_MS_RIGHT); + } + mousekey_send(); + break; + + /* EMACS layer stuff */ + case AE_EMACS: + if (record->event.pressed) { + cp_mode = CP_EMACS; + } + break; + + case AE_TERM: + if (record->event.pressed) { + cp_mode = CP_TERM; + } + break; + + case AE_OTHER: + if (record->event.pressed) { + cp_mode = CP_OTHER; + } + break; + + case AE_VIS: + if (cp_mode == CP_EMACS && record->event.pressed) { + return MACRO(T(V), END); + } + break; + + case AE_CPYC: + if (record->event.pressed) { + m_copypaste_timer = timer_read (); + } else { + if (timer_elapsed (m_copypaste_timer) > TAPPING_TERM) { + // Long press: Cut + switch (cp_mode) { + case CP_EMACS: + return MACRO(T(X), END); + break; + case CP_TERM: + return MACRO(D(RCTRL), D(RSFT), T(X), U(RSFT), U(RCTRL), END); + break; + case CP_OTHER: + return MACRO(D(RCTRL), T(X), U(RCTRL), END); + break; + } + } else { + // Short press: Copy + switch (cp_mode) { + case CP_EMACS: + return MACRO(T(Y), END); + break; + case CP_TERM: + return MACRO(D(RCTRL), D(RSFT), T(C), U(RSFT), U(RCTRL), END); + break; + case CP_OTHER: + return MACRO(D(RCTRL), T(C), U(RCTRL), END); + break; + } + } + } + break; + + case AE_PSTDEL: + if (record->event.pressed) { + m_cutdel_timer = timer_read (); + } else { + if (timer_elapsed (m_cutdel_timer) > TAPPING_TERM) { + // Long press: Delete + switch (cp_mode) { + case CP_EMACS: + return MACRO(T(D), END); + break; + case CP_TERM: + case CP_OTHER: + return MACRO(T(DEL), END); + break; + } + } else { + // Short press: Paste + switch (cp_mode) { + case CP_EMACS: + if (keyboard_report->mods & MOD_BIT(KC_RSFT)) { + unregister_code (KC_RSFT); + return MACRO(U(RSFT), T(RBRC), T(P), D(RSFT), END); + } + else + return MACRO(T(P), END); + break; + case CP_TERM: + return MACRO(D(RCTRL), D(RSFT), T(V), U(RSFT), U(RCTRL), END); + break; + case CP_OTHER: + return MACRO(D(RCTRL), T(V), U(RCTRL), END); + break; + } + } + } + break; + + case AE_INS: + if (record->event.pressed) { + return MACRO(T(I), END); + } else { + layer_clear(); + } + break; + + case AE_OVR: + if (record->event.pressed) { + return MACRO(T(R), END); + } else { + layer_clear(); + } + break; + + case AE_APPND: + if (record->event.pressed) { + return MACRO(T(A), END); + } else { + layer_clear(); + } + break; + + /* GUI & AppSel */ + case A_GUI: + if (record->event.pressed) { + register_code (KC_LGUI); + if (record->tap.count && !record->tap.interrupted) { + if (record->tap.count >= 2) { + register_code (KC_W); + layer_on (APPSEL); + set_oneshot_layer (APPSEL, ONESHOT_START); + } + } else { + record->tap.count = 0; + } + gui_timer = 0; + } else { + if (record->tap.count >= 2) + { + unregister_code (KC_W); + clear_oneshot_layer_state (ONESHOT_PRESSED); + } + gui_timer = timer_read (); + } + break; + + case APP_SLK: + if (record->event.pressed) + return MACRO(T(S), T(C), T(U), T(D), T(C), T(L), T(O), T(U), T(D), T(ENT), END); + break; + + case APP_EMCS: + if (record->event.pressed) + return MACRO(T(E), T(M), T(A), T(C), T(S), T(ENT), END); + break; + + case APP_TERM: + if (record->event.pressed) + return MACRO(T(T), T(E), T(R), T(M), T(ENT), END); + break; + + case APP_CHRM: + if (record->event.pressed) + return MACRO(T(C), T(H), T(R), T(O), T(M), T(ENT), END); + break; + + case APP_MSIC: + if (record->event.pressed) + return MACRO(T(R), T(H), T(Y), T(T), T(H), T(M), T(B), T(O), T(X), T(ENT), END); + break; + + /* Function keys */ + case KF_1 ... KF_11: + ang_handle_kf (record, id); + break; + + /* 1HAND layout */ + case OH_BASE: + if (record->event.pressed) { + oh_base_timer = timer_read (); + } else { + if (timer_elapsed (oh_base_timer) > TAPPING_TERM) { + layer_clear (); + } else { + return MACRO (T(APP), END); + } + } + break; + + case OH_BSSPC: + if (record->event.pressed) { + oh_bsspc_timer = timer_read (); + } else { + if (timer_elapsed (oh_bsspc_timer) > TAPPING_TERM) { + return MACRO (T(BSPC), END); + } else { + return MACRO (T(SPC), END); + } + } + break; + + case OH_ENTSFT: + if (record->event.pressed) { + oh_entsft_timer = timer_read (); + } else { + if (timer_elapsed (oh_entsft_timer) > TAPPING_TERM) { + if (keyboard_report->mods & MOD_BIT(KC_LSFT)) + unregister_code (KC_LSFT); + else + register_code (KC_LSFT); + } else { + return MACRO (T(ENT), END); + } + } + break; + + case OH_LEFT: + if (record->event.pressed) { + layer_move (OHLFT); + oh_left_blink = 1; + oh_left_blink_timer = timer_read (); + ergodox_right_led_1_on (); + } + break; + + case OH_RIGHT: + if (record->event.pressed) { + layer_move (OHRGT); + oh_right_blink = 1; + oh_right_blink_timer = timer_read (); + ergodox_right_led_3_on (); + } + break; + } + return MACRO_NONE; +}; + +// Runs just one time when the keyboard initializes. +void matrix_init_user(void) { + ergodox_led_all_set (LED_BRIGHTNESS_LO); + ergodox_led_all_on(); + _delay_ms(1000); + ergodox_led_all_off(); +}; + +LEADER_EXTERNS(); + +void ang_do_unicode (void) { + register_code (KC_RCTL); + register_code (KC_RSFT); + register_code (KC_U); + unregister_code (KC_U); + unregister_code (KC_RSFT); + unregister_code (KC_RCTL); +} + +void ang_tap (uint16_t codes[]) { + for (int i = 0; codes[i] != 0; i++) { + register_code (codes[i]); + unregister_code (codes[i]); + } +} + +#define TAP_ONCE(code) \ + register_code (code); \ + unregister_code (code) + +// Runs constantly in the background, in a loop. +void matrix_scan_user(void) { + uint8_t layer = biton32(layer_state); + + if (gui_timer && timer_elapsed (gui_timer) > TAPPING_TERM) + unregister_code (KC_LGUI); + + if (layer != OHLFT) + oh_left_blink = 0; + if (layer != OHRGT) + oh_right_blink = 0; + + if (layer == HUN) { + ergodox_right_led_2_on(); + ergodox_right_led_3_on(); + } else if (layer == EMACS) { + ergodox_right_led_1_on(); + ergodox_right_led_2_on(); + } + + if (layer == OHLFT || layer == OHRGT) { + ergodox_right_led_2_on(); + + if (oh_left_blink) { + if (timer_elapsed (oh_left_blink_timer) > OH_BLINK_INTERVAL) { + if ((keyboard_report->mods & MOD_BIT(KC_LSFT)) == 0) + ergodox_right_led_1_off (); + } + if (timer_elapsed (oh_left_blink_timer) > OH_BLINK_INTERVAL * 2) { + ergodox_right_led_1_on (); + oh_left_blink_timer = timer_read (); + } + } + + if (oh_right_blink) { + if (timer_elapsed (oh_right_blink_timer) > OH_BLINK_INTERVAL) { + if ((keyboard_report->mods & MOD_BIT(KC_LCTRL)) == 0) + ergodox_right_led_3_off (); + } + if (timer_elapsed (oh_right_blink_timer) > OH_BLINK_INTERVAL * 2) { + ergodox_right_led_3_on (); + oh_right_blink_timer = timer_read (); + } + } + } + + if (keyboard_report->mods & MOD_BIT(KC_LSFT) || + ((get_oneshot_mods() & MOD_BIT(KC_LSFT)) && !has_oneshot_mods_timed_out())) { + ergodox_right_led_1_set (LED_BRIGHTNESS_HI); + ergodox_right_led_1_on (); + } else { + ergodox_right_led_1_set (LED_BRIGHTNESS_LO); + if (layer != OHLFT && layer != EMACS) + ergodox_right_led_1_off (); + } + + if (keyboard_report->mods & MOD_BIT(KC_LALT) || + ((get_oneshot_mods() & MOD_BIT(KC_LALT)) && !has_oneshot_mods_timed_out())) { + ergodox_right_led_2_set (LED_BRIGHTNESS_HI); + ergodox_right_led_2_on (); + } else { + ergodox_right_led_2_set (LED_BRIGHTNESS_LO); + if (layer != OHRGT && layer != HUN && layer != OHLFT && layer != EMACS) + ergodox_right_led_2_off (); + } + + if (keyboard_report->mods & MOD_BIT(KC_LCTRL) || + ((get_oneshot_mods() & MOD_BIT(KC_LCTRL)) && !has_oneshot_mods_timed_out())) { + ergodox_right_led_3_set (LED_BRIGHTNESS_HI); + ergodox_right_led_3_on (); + } else { + ergodox_right_led_3_set (LED_BRIGHTNESS_LO); + if (layer != OHRGT && layer != HUN) + ergodox_right_led_3_off (); + } + + LEADER_DICTIONARY() { + leading = false; + leader_end (); + + SEQ_ONE_KEY (KC_U) { + ang_do_unicode (); + } + + SEQ_ONE_KEY (KC_L) { + /* λ */ + ang_do_unicode (); + + uint16_t codes[] = {KC_0, KC_3, KC_B, KC_B, KC_ENT, 0}; + ang_tap (codes); + } + + SEQ_ONE_KEY (KC_S) { + ang_do_unicode (); TAP_ONCE (KC_A); TAP_ONCE (KC_F); TAP_ONCE (KC_SPC); + TAP_ONCE (KC_BSLS); + register_code (KC_RSFT); TAP_ONCE (KC_MINS); TAP_ONCE (KC_9); unregister_code (KC_RSFT); + ang_do_unicode (); TAP_ONCE (KC_3); TAP_ONCE (KC_0); TAP_ONCE (KC_C); TAP_ONCE (KC_4); TAP_ONCE (KC_SPC); + register_code (KC_RSFT); TAP_ONCE (KC_0); TAP_ONCE (KC_MINS); unregister_code (KC_RSFT); + TAP_ONCE (KC_SLSH); + ang_do_unicode (); TAP_ONCE (KC_A); TAP_ONCE (KC_F); TAP_ONCE (KC_SPC); + } + + SEQ_TWO_KEYS (KC_W, KC_M) { + register_code (KC_LALT); + register_code (KC_F2); + unregister_code (KC_F2); + unregister_code (KC_LALT); + + _delay_ms (1000); + + uint16_t codes[] = {KC_M, KC_A, KC_X, KC_MINS, KC_F, KC_O, KC_C, KC_U, KC_S, KC_E, KC_D, KC_ENT, 0}; + ang_tap (codes); + register_code (KC_LGUI); + register_code (KC_UP); + unregister_code (KC_UP); + unregister_code (KC_LGUI); + } + } +} diff --git a/keyboard/ergodox_ez/keymaps/andrew_osx/andrew_osx.hex b/keyboard/ergodox_ez/keymaps/andrew_osx/andrew_osx.hex deleted file mode 100644 index fc0876d844f..00000000000 Binary files a/keyboard/ergodox_ez/keymaps/andrew_osx/andrew_osx.hex and /dev/null differ diff --git a/keyboard/ergodox_ez/keymaps/andrew_osx/compiled.hex b/keyboard/ergodox_ez/keymaps/andrew_osx/compiled.hex new file mode 100644 index 00000000000..14d0fbe0bdf Binary files /dev/null and b/keyboard/ergodox_ez/keymaps/andrew_osx/compiled.hex differ diff --git a/keyboard/ergodox_ez/keymaps/bepo/README.md b/keyboard/ergodox_ez/keymaps/bepo/README.md new file mode 100644 index 00000000000..338909ed99d --- /dev/null +++ b/keyboard/ergodox_ez/keymaps/bepo/README.md @@ -0,0 +1,34 @@ +# BEPO keymap for the ErgoDox + +This keymap has been made for the BEPO layout (http://bepo.fr), which is an ergonomic french keyboard layout based on Dvorak rules. As it's made for french people, the following of this README will be in french. + +# Disposition BÉPO pour l'ErgoDox + +Cette keymap a été pensée pour la disposition BÉPO (http://bepo.fr), qui est une disposition de clavier francophone, ergonomique et libre, élaborée selon la méthode Dvorak. L'adaptation de cette disposition à l'ErgoDox a été réalisée en conservant les points forts du clavier TypeMatrix 2030 (très répandu dans la communauté bépo, avec un excellent rapport ergonomie / prix) voir en réglant certains de ses défauts (3 colonnes pour l'auriculaire droit et touche "Ê") et en apportant son lot de nouveautés (compatibilité avec les systèmes azerty et qwerty). + +Particularités +-------------- + +Touches de repos des pouces : "espace" à gauche et "entrée" à droite. + +Placement des touches de combinaison ("Shift", "Alt", "Ctrl"...) adapté aux pouces, et permettant de conserver chaque doigt pour les rangées de lettres auxquelles ils sont assignés sans avoir à changer la touche de combinaison de côté (exemple : "A" majuscule puis "M" majuscule avec les auriculaires et un seul appui d'une touche "Shift"). + +Les touches "Alt" et "Alt Gr" sont accessibles avec les pouces sur la rangée du bas comme sur la TypeMatrix 2030, avec une symétrie gauche / droite. + +Les touches "Ctrl" sont placées sur la même ligne que les touche "Alt" et "Alt Gr" comme sur un clavier clasique, elles sont accessibles aux pouces sur la rangée du bas (moins éloigné que le groupe de touches de pouces pour des petites mains). + +Les touches "Backspace" et "Delete" sont placées comme sur la TypeMatrix 2030, du côté gauche uniquement (pour laisser celles de la main droite servir de {caps,num,scroll}lock puisqu'elles ont des LED). + +La touche "Tab" est placée comme sur la TypeMatrix 2020. + +Meilleure symétrie et accessibilité que la TypeMatrix 2030 : les touches "W" et "%" ont dû être déplacées du côté gauche en raison du nombre de touches de l'ErgoDox, mais l'auriculaire droit ne gère maintenant que deux colonnes de touches au lieu de trois. La touche "Ê" redevient accessible sur la même rangée que les autres lettres, comme sur un clavier classique en disposition bépo. Les lettres, chiffres et symboles sont tous regroupés sur 4 lignes et 6 colonnes pour chaque main, et la première rangée de lettres à la main gauche conserve une identité visuelle "BÉPO". + +Touche de fonction permettant de saisir les touches F1 à F12, les touches F1 à F10 sont placées de façon logique par rapport aux chiffres 1 à 0. Cette même touche permet l'accès aux touches directionnelles sans déplacer la main droite. Les touches "Home" et "End" sont placées de la même façon que sur une TypeMatrix 2030 par rapport aux touches directionnelles. Les touches "Page Up" et "Page Down" sont également accessibles facilement sans déplacer la main droite. Les fonctions "VolUp" et "VolDown" sont placées comme sur la TypeMatrix 2030, avec la fonction "Mute" juste au dessus. Les fonctions "Undo", "Cut", "Copy" et "Paste" sont placées côte à côte comme elles le seraient sur un clavier QWERTY en combinaison avec la touche "Ctrl" (à l'emplacement des lettres "Z", "X", "C" et "V"). Par rapport au layout "SpaceFN", l'utilisation d'une touche de fonction dédiée au pouce permet de ne pas ajouter de latence, et la touche espace reste compatible avec les jeux (action au moment de l'appui et possibilité d'appui long). + +Touche de fonction permettant l'accès au pavé numérique comme sur la TypeMatrix 2030, mais sans avoir à déplacer la main droite : avec les doigts sur la rangée de repos, possibilité de saisir les chiffres "4", "5" et "6" comme sur un pavé numérique classique. Le double "0" de la TypeMatrix a été conservé, et gagne une possibilité de répétition en simples "0". + +L'appui sur une touche permet de basculer en mode BEPO sur un système configuré pour un clavier QWERTY. Cette compatibilité n'est pas parfaite (pas encore de gestion des accents mais ça devrait être faisable avec une disposition en qwerty international, et les combinaisons de touches ne sont pas toutes supportées puisque le clavier traduit déjà certaines touches en combinaisons) mais reste pratique pour une saisie de texte occasionnelle. + +TODO : couche de compatibilité pour utiliser la disposition BÉPO sur un système configuré pour un clavier AZERTY. + +> Olivier Smedts diff --git a/keyboard/ergodox_ez/keymaps/bepo/bepo.png b/keyboard/ergodox_ez/keymaps/bepo/bepo.png new file mode 100644 index 00000000000..3df7aa609f6 Binary files /dev/null and b/keyboard/ergodox_ez/keymaps/bepo/bepo.png differ diff --git a/keyboard/ergodox_ez/keymaps/bepo/compiled.hex b/keyboard/ergodox_ez/keymaps/bepo/compiled.hex new file mode 100644 index 00000000000..e2ed480f05d Binary files /dev/null and b/keyboard/ergodox_ez/keymaps/bepo/compiled.hex differ diff --git a/keyboard/ergodox_ez/keymaps/bepo/keymap.c b/keyboard/ergodox_ez/keymaps/bepo/keymap.c new file mode 100644 index 00000000000..dac6b7b51a2 --- /dev/null +++ b/keyboard/ergodox_ez/keymaps/bepo/keymap.c @@ -0,0 +1,311 @@ +#include "ergodox_ez.h" +#include "debug.h" +#include "action_layer.h" +#include "keymap_extras/keymap_bepo.h" + +#define BASE 0 // default layer +#define QWER 1 // qwerty compat layer +#define SQWER 2 // shifted qwerty compat layer +#define AQWER 3 // alted qwerty compat layer +#define FNAV 4 // function / navigation keys +#define NUM 5 // numeric keypad keys +#define MSE 6 // mouse keys + +#define KP_00 0 +#define CA_Fx 1 + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +/* Keymap 0: Base layer + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | $ | " | < | > | ( | ) |Delete| |ScroLo| @ | + | - | / | * | = | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | % | B |E_ACUT| P | O |E_GRAV|Backsp| |CapsLo| ^ | V | D | L | J | Z | + * |--------+------+------+------+------+------| ace | | |------+------+------+------+------+--------| + * | W | A | U | I | E | , |------| |------| C | T | S | R | N | M | + * |--------+------+------+------+------+------| Tab | | NumLo|------+------+------+------+------+--------| + * | E_CIRC |A_GRAV| Y | X | . | K | | | | ' | Q | G | H | F | C_CEDIL| + * `--------+------+------+------+------+-------------,-------------. ,-------------`-------------+------+------+------+------+--------' + * |QWERTY| |LSuper| LCtrl| LAlt| |Escape| L_Mse| | |Insert| | AltGr| RCtrl|RSuper|PrntSc| Pause| + * `----------------------------------' ,------|------|------| |------+------+------. `----------------------------------' + * | | | L_Num| | CA_Fx| | | + * | Space|LShift|------| |------|RShift|Enter | + * | | |L_FNav| |L_FNav| | | + * `--------------------' `--------------------' + */ +[BASE] = KEYMAP( +// Left hand +BP_DOLLAR, BP_DQOT, BP_LGIL, BP_RGIL, BP_LPRN, BP_RPRN, KC_DEL, +BP_PERCENT, BP_B, BP_E_ACUTE, BP_P, BP_O, BP_E_GRAVE, KC_BSPC, +BP_W, BP_A, BP_U, BP_I, BP_E, BP_COMMA, +BP_ECRC, BP_A_GRAVE, BP_Y, BP_X, BP_DOT, BP_K, KC_TAB, +TG(QWER), KC_NO, KC_LGUI, KC_LCTL, KC_LALT, + KC_ESC, MO(MSE), + MO(NUM), + KC_SPC, KC_LSHIFT, MO(FNAV), +// Right hand + KC_SLCK, BP_AT, BP_PLUS, BP_MINUS, BP_SLASH, BP_ASTR, BP_EQUAL, + KC_CAPSLOCK, BP_DCRC, BP_V, BP_D, BP_L, BP_J, BP_Z, + BP_C, BP_T, BP_S, BP_R, BP_N, BP_M, + KC_NUMLOCK, BP_APOS, BP_Q, BP_G, BP_H, BP_F, BP_CCED, + BP_ALGR, KC_RCTL, KC_RGUI, KC_PSCREEN, KC_PAUSE, +KC_NO, KC_INS, +M(CA_Fx), +MO(FNAV), KC_RSHIFT, KC_ENTER), +/* Keymap 1: QWERTY system compatibility layer + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | $ | " | < | > | ( | ) |Delete| |ScroLo| @ | + | - | / | * | = | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | % | b | e | p | o | e |Backsp| |CapsLo| ^ | v | d | l | j | z | + * |--------+------+------+------+------+------| ace | | |------+------+------+------+------+--------| + * | w | a | u | i | e | , |------| |------| c | t | s | r | n | m | + * |--------+------+------+------+------+------| Tab | | NumLo|------+------+------+------+------+--------| + * | e | a | y | x | . | k | | | | ' | q | g | h | f | c | + * `--------+------+------+------+------+-------------,-------------. ,-------------`-------------+------+------+------+------+--------' + * | BEPO | |LSuper| LCtrl| LAlt| |Escape| L_Mse| | |Insert| | AltGr| RCtrl|RSuper|PrntSc| Pause| + * `----------------------------------' ,------|------|------| |------+------+------. `----------------------------------' + * | | | L_Num| | | | | + * | Space|LShift|------| |------|RShift|Enter | + * | | |L_FNav| |L_FNav| | | + * `--------------------' `--------------------' + */ +[QWER] = KEYMAP( +// Left hand +KC_DOLLAR, S(KC_QUOT), S(KC_COMM), S(KC_DOT), KC_LPRN, KC_RPRN, KC_DEL, +KC_PERCENT, KC_B, KC_E, KC_P, KC_O, KC_E, KC_BSPC, +KC_W, KC_A, KC_U, KC_I, KC_E, KC_COMMA, +KC_E, KC_A, KC_Y, KC_X, KC_DOT, KC_K, KC_TAB, +KC_TRNS, KC_NO, KC_LGUI, KC_LCTL, KC_LALT, + KC_ESC, MO(MSE), + MO(NUM), + KC_SPC, MO(SQWER), MO(FNAV), +// Right hand + KC_SLCK, KC_AT, KC_PLUS, KC_MINUS, KC_SLASH, KC_ASTR, KC_EQUAL, + KC_CAPSLOCK, KC_CIRC, KC_V, KC_D, KC_L, KC_J, KC_Z, + KC_C, KC_T, KC_S, KC_R, KC_N, KC_M, + KC_NUMLOCK, KC_QUOT, KC_Q, KC_G, KC_H, KC_F, KC_C, + MO(AQWER), KC_RCTL, KC_RGUI, KC_PSCREEN, KC_PAUSE, +KC_NO, KC_INS, +KC_TRNS, +MO(FNAV), MO(SQWER), KC_ENTER), +/* Keymap 2: QWERTY shifted system compatibility layer + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | # | 1 | 2 | 3 | 4 | 5 |Delete| |ScroLo| 6 | 7 | 8 | 9 | 0 | = | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | ` | B | E | P | O | E |Backsp| |CapsLo| ! | V | D | L | J | Z | + * |--------+------+------+------+------+------| ace | | |------+------+------+------+------+--------| + * | W | A | U | I | E | ; |------| |------| C | T | S | R | N | M | + * |--------+------+------+------+------+------| Tab | | NumLo|------+------+------+------+------+--------| + * | E | A | Y | X | : | K | | | | ? | Q | G | H | F | C | + * `--------+------+------+------+------+-------------,-------------. ,-------------`-------------+------+------+------+------+--------' + * | BEPO | |LSuper| LCtrl| LAlt| |Escape| L_Mse| | |Insert| | AltGr| RCtrl|RSuper|PrntSc| Pause| + * `----------------------------------' ,------|------|------| |------+------+------. `----------------------------------' + * | | | L_Num| | | | | + * | Space|LShift|------| |------|RShift|Enter | + * | | |L_FNav| |L_FNav| | | + * `--------------------' `--------------------' + */ +[SQWER] = KEYMAP( +// Left hand +KC_HASH, KC_1, KC_2, KC_3, KC_4, KC_5, KC_TRNS, +KC_GRV, S(KC_B), S(KC_E), S(KC_P), S(KC_O), S(KC_E), KC_TRNS, +S(KC_W), S(KC_A), S(KC_U), S(KC_I), S(KC_E), KC_SCOLON, +S(KC_E), S(KC_A), S(KC_Y), S(KC_X), KC_COLON, S(KC_K), S(KC_TAB), +KC_TRNS, KC_TRNS, S(KC_LGUI), S(KC_LCTL), S(KC_LALT), + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, +// Right hand + KC_TRNS, KC_6, KC_7, KC_8, KC_9, KC_0, KC_TRNS, + KC_TRNS, KC_EXLM, S(KC_V), S(KC_D), S(KC_L), S(KC_J), S(KC_Z), + S(KC_C), S(KC_T), S(KC_S), S(KC_R), S(KC_N), S(KC_M), + KC_TRNS, S(KC_SLASH), S(KC_Q), S(KC_G), S(KC_H), S(KC_F), S(KC_C), + S(KC_RALT), S(KC_RCTL), S(KC_RGUI), KC_TRNS, KC_TRNS, +KC_TRNS, KC_TRNS, +KC_TRNS, +KC_TRNS, KC_TRNS, KC_TRNS), +/* Keymap 3: QWERTY alted system compatibility layer + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | $ | " | < | > | [ | ] |Delete| |ScroLo| @ | + | - | / | * | = | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | % | | | e | & | o | e |Backsp| |CapsLo| ^ | v | d | l | j | z | + * |--------+------+------+------+------+------| ace | | |------+------+------+------+------+--------| + * | w | a | u | i | € | , |------| |------| c | t | s | r | n | m | + * |--------+------+------+------+------+------| Tab | | NumLo|------+------+------+------+------+--------| + * | e | \ | { | } | . | ~ | | | | ' | q | g | h | f | c | + * `--------+------+------+------+------+-------------,-------------. ,-------------`-------------+------+------+------+------+--------' + * | BEPO | |LSuper| LCtrl| LAlt| |Escape| L_Mse| | |Insert| | AltGr| RCtrl|RSuper|PrntSc| Pause| + * `----------------------------------' ,------|------|------| |------+------+------. `----------------------------------' + * | | | L_Num| | | | | + * | _ |LShift|------| |------|RShift|Enter | + * | | |L_FNav| |L_FNav| | | + * `--------------------' `--------------------' + */ +[AQWER] = KEYMAP( +// Left hand +KC_DOLLAR, S(KC_QUOT), S(KC_COMM), S(KC_DOT), KC_LBRC, KC_RBRC, KC_DEL, +KC_PERCENT, KC_PIPE, KC_E, KC_AMPR, KC_O, KC_E, KC_BSPC, +KC_W, KC_A, KC_U, KC_I, RALT(KC_5), KC_COMMA, +KC_E, KC_BSLASH, KC_LCBR, KC_RCBR, KC_DOT, KC_TILDE, KC_TAB, +KC_TRNS, KC_NO, KC_LGUI, KC_LCTL, KC_LALT, + KC_ESC, MO(MSE), + MO(NUM), + KC_UNDS, MO(SQWER), MO(FNAV), +// Right hand + KC_SLCK, KC_AT, KC_PLUS, KC_MINUS, KC_SLASH, KC_ASTR, KC_EQUAL, + KC_CAPSLOCK, KC_CIRC, KC_V, KC_D, KC_L, KC_J, KC_Z, + KC_C, KC_T, KC_S, KC_R, KC_N, KC_M, + KC_NUMLOCK, KC_QUOT, KC_Q, KC_G, KC_H, KC_F, KC_C, + KC_TRNS, KC_RCTL, KC_RGUI, KC_PSCREEN, KC_PAUSE, +KC_NO, KC_INS, +KC_TRNS, +MO(FNAV), MO(SQWER), KC_ENTER), +/* Keymap 4: function / navigation layer + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | | F1 | F2 | F3 | F4 | F5 |VolMut| | | F6 | F7 | F8 | F9 | F10 | | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | | | | | | |VolDwn| | | PgUp | Home | Up | End | F11 | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | | | | | |------| |------| PgDn | Left | Down | Right| F12 | | + * |--------+------+------+------+------+------| VolUp| | |------+------+------+------+------+--------| + * | | Undo | Cut | Copy | Paste| | | | | | | | | | | + * `--------+------+------+------+------+-------------,-------------. ,-------------`-------------+------+------+------+------+--------' + * | | | | | | | | | | | | | | | | | | + * `----------------------------------' ,------|------|------| |------+------+------. `----------------------------------' + * | | | | | | | | + * | | |------| |------| | | + * | | | | | | | | + * `--------------------' `--------------------' + */ +[FNAV] = KEYMAP( +// Left hand +KC_NO, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_MUTE, +KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_VOLU, +KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, +KC_NO, KC_UNDO, KC_CUT, KC_COPY, KC_PASTE, KC_NO, KC_VOLD, +KC_NO, KC_NO, KC_TRNS, KC_TRNS, KC_TRNS, + KC_NO, KC_NO, + KC_NO, + KC_NO, KC_TRNS, KC_TRNS, +// Right hand + KC_NO, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_NO, + KC_NO, KC_PGUP, KC_HOME, KC_UP, KC_END, KC_F11, KC_NO, + KC_PGDOWN, KC_LEFT, KC_DOWN, KC_RIGHT, KC_F12, KC_NO, + KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, + KC_TRNS, KC_TRNS, KC_TRNS, KC_NO, KC_NO, +KC_NO, KC_NO, +KC_TRNS, +KC_TRNS, KC_TRNS, KC_NO), +/* Keymap 5: numeric layer, sends keypad codes + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | | | | | | | | | | | + | - | / | * | | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | | | | | | | | | | | 7 | 8 | 9 | | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | | | | | |------| |------| | 4 | 5 | 6 | | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | | | | | | | | | | 1 | 2 | 3 | | | + * `--------+------+------+------+------+-------------,-------------. ,-------------`-------------+------+------+------+------+--------' + * | | | | | | | | | | | | | 0 | 00 | . | | | + * `----------------------------------' ,------|------|------| |------+------+------. `----------------------------------' + * | | | | | | | | + * | | |------| |------| | Enter| + * | | | | | | | | + * `--------------------' `--------------------' + */ +[NUM] = KEYMAP( +// Left hand +KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, +KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, +KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, +KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, +KC_NO, KC_NO, KC_TRNS, KC_TRNS, KC_TRNS, + KC_NO, KC_NO, + KC_TRNS, + KC_NO, KC_TRNS, KC_NO, +// Right hand + KC_NO, KC_NO, KC_KP_PLUS, KC_KP_MINUS, KC_KP_SLASH, KC_KP_ASTERISK, KC_NO, + KC_NO, KC_NO, KC_KP_7, KC_KP_8, KC_KP_9, KC_NO, KC_NO, + KC_NO, KC_KP_4, KC_KP_5, KC_KP_6, KC_NO, KC_NO, + KC_NO, KC_NO, KC_KP_1, KC_KP_2, KC_KP_3, KC_NO, KC_NO, + KC_KP_0, M(KP_00), KC_KP_COMMA, KC_NO, KC_NO, +KC_NO, KC_NO, +KC_NO, +KC_NO, KC_TRNS, KC_KP_ENTER), +/* Keymap 6: mouse layer + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | | | | | | | | | | | | | | | | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | | | | | | | | | | |LClick| Up |RClick| WhUp | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | | | | | |------| |------| | Left | Down | Right|WhDown| | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | | | | | | | | | | | | | | | + * `--------+------+------+------+------+-------------,-------------. ,-------------`-------------+------+------+------+------+--------' + * | | | | | | | | | | | | | | | | | | + * `----------------------------------' ,------|------|------| |------+------+------. `----------------------------------' + * | | | | | | | | + * | | |------| |------| | | + * | | | | | | | | + * `--------------------' `--------------------' + */ +[MSE] = KEYMAP( +// Left hand +KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, +KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, +KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, +KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, +KC_NO, KC_NO, KC_TRNS, KC_TRNS, KC_TRNS, + KC_NO, KC_TRNS, + KC_NO, + KC_NO, KC_TRNS, KC_NO, +// Right hand + KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, + KC_NO, KC_NO, KC_MS_BTN1, KC_MS_UP, KC_MS_BTN2, KC_MS_WH_UP, KC_NO, + KC_NO, KC_MS_LEFT, KC_MS_DOWN, KC_MS_RIGHT, KC_MS_WH_DOWN, KC_NO, + KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, + KC_TRNS, KC_TRNS, KC_TRNS, KC_NO, KC_NO, +KC_NO, KC_NO, +KC_NO, +KC_NO, KC_TRNS, KC_NO) +}; + +const uint16_t PROGMEM fn_actions[] = { +}; + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) +{ + switch(id) { + case KP_00: + if (record->event.pressed) { + return MACRO( T(KP_0), D(KP_0), END ); + } else { + return MACRO( U(KP_0), END ); + } + break; + case CA_Fx: + if (record->event.pressed) { + layer_on(FNAV); + return MACRO( D(LALT), D(LCTL), END ); + } else { + layer_off(FNAV); + return MACRO( U(LCTL), U(LALT), END ); + } + break; + } + return MACRO_NONE; +}; + +// Runs just one time when the keyboard initializes. +void matrix_init_user(void) { +}; + +// Runs constantly in the background, in a loop. +void matrix_scan_user(void) { +}; diff --git a/keyboard/ergodox_ez/keymaps/coderkun_neo2/Makefile b/keyboard/ergodox_ez/keymaps/coderkun_neo2/Makefile new file mode 100644 index 00000000000..e7b2d0a65eb --- /dev/null +++ b/keyboard/ergodox_ez/keymaps/coderkun_neo2/Makefile @@ -0,0 +1 @@ +UNICODE_ENABLE = yes \ No newline at end of file diff --git a/keyboard/ergodox_ez/keymaps/coderkun_neo2/coderkun_neo2.hex b/keyboard/ergodox_ez/keymaps/coderkun_neo2/coderkun_neo2.hex deleted file mode 100644 index f14a11fb571..00000000000 Binary files a/keyboard/ergodox_ez/keymaps/coderkun_neo2/coderkun_neo2.hex and /dev/null differ diff --git a/keyboard/ergodox_ez/keymaps/coderkun_neo2/compiled.hex b/keyboard/ergodox_ez/keymaps/coderkun_neo2/compiled.hex new file mode 100644 index 00000000000..5aa02ca4b04 Binary files /dev/null and b/keyboard/ergodox_ez/keymaps/coderkun_neo2/compiled.hex differ diff --git a/keyboard/ergodox_ez/keymaps/coderkun_neo2/keymap.c b/keyboard/ergodox_ez/keymaps/coderkun_neo2/keymap.c index 25ab0ff18d8..d25e2b9954b 100644 --- a/keyboard/ergodox_ez/keymaps/coderkun_neo2/keymap.c +++ b/keyboard/ergodox_ez/keymaps/coderkun_neo2/keymap.c @@ -1,7 +1,7 @@ #include "ergodox_ez.h" #include "debug.h" #include "action_layer.h" -#include "keymap_extras/keymap_neo2.h" +#include "keymap_neo2.h" // Layer names #define BASE 0 // default layer diff --git a/keyboard/ergodox_ez/keymaps/colemak/colemak.hex b/keyboard/ergodox_ez/keymaps/colemak/colemak.hex deleted file mode 100644 index 0f5bba3b5fc..00000000000 Binary files a/keyboard/ergodox_ez/keymaps/colemak/colemak.hex and /dev/null differ diff --git a/keyboard/ergodox_ez/keymaps/colemak/compiled.hex b/keyboard/ergodox_ez/keymaps/colemak/compiled.hex new file mode 100644 index 00000000000..e3ce9a68f93 Binary files /dev/null and b/keyboard/ergodox_ez/keymaps/colemak/compiled.hex differ diff --git a/keyboard/ergodox_ez/keymaps/colemak_osx_pc_no/colemak_osx_pc_no.hex b/keyboard/ergodox_ez/keymaps/colemak_osx_pc_no/colemak_osx_pc_no.hex deleted file mode 100644 index 1d87acd1432..00000000000 Binary files a/keyboard/ergodox_ez/keymaps/colemak_osx_pc_no/colemak_osx_pc_no.hex and /dev/null differ diff --git a/keyboard/ergodox_ez/keymaps/colemak_osx_pc_no/compiled.hex b/keyboard/ergodox_ez/keymaps/colemak_osx_pc_no/compiled.hex new file mode 100644 index 00000000000..726a776d290 Binary files /dev/null and b/keyboard/ergodox_ez/keymaps/colemak_osx_pc_no/compiled.hex differ diff --git a/keyboard/ergodox_ez/keymaps/csharp_dev/compiled.hex b/keyboard/ergodox_ez/keymaps/csharp_dev/compiled.hex new file mode 100644 index 00000000000..a5b9e9ba4a7 Binary files /dev/null and b/keyboard/ergodox_ez/keymaps/csharp_dev/compiled.hex differ diff --git a/keyboard/ergodox_ez/keymaps/csharp_dev/csharp_dev.hex b/keyboard/ergodox_ez/keymaps/csharp_dev/csharp_dev.hex deleted file mode 100644 index 12efef223d9..00000000000 Binary files a/keyboard/ergodox_ez/keymaps/csharp_dev/csharp_dev.hex and /dev/null differ diff --git a/keyboard/ergodox_ez/keymaps/dave/compiled.hex b/keyboard/ergodox_ez/keymaps/dave/compiled.hex new file mode 100644 index 00000000000..22b5c668210 Binary files /dev/null and b/keyboard/ergodox_ez/keymaps/dave/compiled.hex differ diff --git a/keyboard/ergodox_ez/keymaps/dave/dave.hex b/keyboard/ergodox_ez/keymaps/dave/dave.hex deleted file mode 100644 index 363e7234d8b..00000000000 Binary files a/keyboard/ergodox_ez/keymaps/dave/dave.hex and /dev/null differ diff --git a/keyboard/ergodox_ez/keymaps/dave/keymap.c b/keyboard/ergodox_ez/keymaps/dave/keymap.c index 3ac2842fbf7..e9480af3e96 100644 --- a/keyboard/ergodox_ez/keymaps/dave/keymap.c +++ b/keyboard/ergodox_ez/keymaps/dave/keymap.c @@ -3,8 +3,8 @@ #include "action_layer.h" #define BASE 0 // default layer -#define PROG 1 // symbols -#define NAVI 2 // navigation keys +#define PROG 1 // programming +#define NAVI 2 // navigation const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Keymap 0: Basic layer @@ -18,16 +18,18 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |--------+------+------+------+------+------| H | | B |------+------+------+------+------+--------| * | LShift | Z | X | C | V | B | | | | N | M | , | . | / | RShift | * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * |`/Ctrl| \ | | | LAlt | | RAlt | | [ | ] |'/Ctrl| + * |`/Ctrl| \ | | | LAlt | | RAlt | [ | ] | |'/Ctrl| * `----------------------------------' `----------------------------------' * ,-------------. ,-------------. - * | PrtS | Apps | | Paus | CtAl | + * | PrtS | PrtS | | CtAl | CtAl | * ,------+------+------| |------+------+------. * | | | L1 | | L1 | | | * | Spce | ~L2 +------| |------+ ~L1 | Spce | * | | | LGui | | RGui | | | * `--------------------' `--------------------' */ +// If it accepts an argument (i.e, is a function), it doesn't need KC_. +// Otherwise, it needs KC_* [BASE] = KEYMAP( // layer 0 : default // left hand KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, @@ -35,7 +37,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_LCTRL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_H, CTL_T(KC_GRV),KC_NUBS,KC_NO, KC_NO, KC_LALT, - KC_PSCREEN, KC_APP, + KC_PSCREEN, KC_PSCREEN, TO(PROG, ON_PRESS), KC_SPC, MO(NAVI), KC_LGUI, // right hand @@ -43,8 +45,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_G, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_ENTER, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_ENTER, KC_B, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH, KC_RSFT, - KC_RALT,KC_NO, KC_LBRC,KC_RBRC, CTL_T(KC_QUOT), - KC_PAUS, MT(0x5, KC_NO), + KC_RALT,KC_LBRC,KC_RBRC,KC_NO, CTL_T(KC_QUOT), + MT(0x5, KC_NO), MT(0x5, KC_NO), TO(PROG, ON_PRESS), KC_RGUI, MO(PROG), KC_SPC ), @@ -70,6 +72,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | | | | * `--------------------' `--------------------' */ +// PROGRAMMING [PROG] = KEYMAP( // left hand KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, @@ -105,20 +108,21 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | MsLt | MsDn | MsRt | | |VolDn | Mute |VolUp | | | * `----------------------------------' `----------------------------------' * ,-------------. ,-------------. - * | Powr | Log | | | | + * | | | | | | * ,------|------|------| |------+------+------. * | | | L0 | | L0 | | | * | | |------| |------| | | * | | | | | | | | * `--------------------' `--------------------' */ +// NAVIGATION [NAVI] = KEYMAP( KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_TRNS, KC_HOME, KC_UP, KC_END, KC_INS, KC_PGUP, KC_TRNS, KC_TRNS, KC_LEFT, KC_DOWN, KC_RGHT, KC_DELT, KC_PGDN, KC_TRNS, KC_BTN1, KC_MS_U, KC_BTN2, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_R, KC_TRNS, - KC_PWR, LCTL(LALT(KC_DELT)), + KC_TRNS, KC_TRNS, TO(BASE, ON_PRESS), KC_TRNS, KC_TRNS, KC_TRNS, // right hand diff --git a/keyboard/ergodox_ez/keymaps/dave/readme.md b/keyboard/ergodox_ez/keymaps/dave/readme.md new file mode 100644 index 00000000000..aa0f9bd1927 --- /dev/null +++ b/keyboard/ergodox_ez/keymaps/dave/readme.md @@ -0,0 +1,38 @@ +This keymap is my preferred layout (after a certain amount of experimentation). +The rationale behind the design is as follows: + +I grew up typing from a very early age and thus never learned the "correct" way +to touch type (essentially, I'm self-taught). As a, result my fingers don't +tend to stay on the "home keys" and occasionally my right hand wants to type +keys that are on the left of the keyboard, and vice versa. + +Hence, despite liking the idea of split keyboards in principle, I've never been +able to get on with them because the split simply doesn't work with my style of +typing. The Ergodox solves this neatly by virtue of having a few extra keys in +the "middle" of the keyboard which I can utilise for deliberate redundancy. +Thus in this keymap there are two "6" keys (one on the left, one on the right) +and likewise Y, H, G, and B are all duplicated to enable one-handed patterns +that I use frequently (e.g. "byobu" with the right hand, "yes" with the left, +etc.). + +I occasionally use the numeric pad for data entry, thus this is duplicated +under the natural home position of the right hand in layer 1 (activated by +holding one of the right thumb buttons), while the cursor keys are duplicated +under the classic WASD gaming layout of the left hand in layer 2 (activated by +holding one of the left thumb buttons). Various other useful keys also appear +in these layers (brackets and symbols for coding in layer 1, navigation and +F-keys in layer 2, etc.). + +Finally, modifier keys like Ctrl, Shift, and Alt, along with Backspace and +Enter are all in traditional locations in an effort to reuse existing muscle +memory as much as possible (keys like =, #, and ' are in layer 1). The layout +maps are in the comments of keymap_dave.c so I won't bother duplicating them +here. + +Oh, and the LEDs are rather pimped ... because I could! + +Anyway, although I'm sure this keymap won't be to many people's taste you might +find some interesting ideas in here for your own layouts. Do tweet me +(@waveform80) if you have any questions / suggestions / bugs. + +Dave. diff --git a/keyboard/ergodox_ez/keymaps/default/compiled.hex b/keyboard/ergodox_ez/keymaps/default/compiled.hex new file mode 100644 index 00000000000..f5ec0145a87 Binary files /dev/null and b/keyboard/ergodox_ez/keymaps/default/compiled.hex differ diff --git a/keyboard/ergodox_ez/keymaps/default/default.hex b/keyboard/ergodox_ez/keymaps/default/default.hex deleted file mode 100644 index bd5cd434151..00000000000 Binary files a/keyboard/ergodox_ez/keymaps/default/default.hex and /dev/null differ diff --git a/keyboard/ergodox_ez/keymaps/default_osx/compiled.hex b/keyboard/ergodox_ez/keymaps/default_osx/compiled.hex new file mode 100644 index 00000000000..cdd9b9704cb Binary files /dev/null and b/keyboard/ergodox_ez/keymaps/default_osx/compiled.hex differ diff --git a/keyboard/ergodox_ez/keymaps/default_osx/default_osx.hex b/keyboard/ergodox_ez/keymaps/default_osx/default_osx.hex deleted file mode 100644 index 02ee9755446..00000000000 Binary files a/keyboard/ergodox_ez/keymaps/default_osx/default_osx.hex and /dev/null differ diff --git a/keyboard/ergodox_ez/keymaps/dragon788/compiled.hex b/keyboard/ergodox_ez/keymaps/dragon788/compiled.hex new file mode 100644 index 00000000000..e46a5054b50 Binary files /dev/null and b/keyboard/ergodox_ez/keymaps/dragon788/compiled.hex differ diff --git a/keyboard/ergodox_ez/keymaps/dragon788/dragon788.hex b/keyboard/ergodox_ez/keymaps/dragon788/dragon788.hex deleted file mode 100644 index 1ca511fe105..00000000000 Binary files a/keyboard/ergodox_ez/keymaps/dragon788/dragon788.hex and /dev/null differ diff --git a/keyboard/ergodox_ez/keymaps/dvorak/compiled.hex b/keyboard/ergodox_ez/keymaps/dvorak/compiled.hex new file mode 100644 index 00000000000..c757b276d44 Binary files /dev/null and b/keyboard/ergodox_ez/keymaps/dvorak/compiled.hex differ diff --git a/keyboard/ergodox_ez/keymaps/dvorak/dvorak.hex b/keyboard/ergodox_ez/keymaps/dvorak/dvorak.hex deleted file mode 100644 index 2568c571e91..00000000000 Binary files a/keyboard/ergodox_ez/keymaps/dvorak/dvorak.hex and /dev/null differ diff --git a/keyboard/ergodox_ez/keymaps/dvorak_intl_squisher/compiled.hex b/keyboard/ergodox_ez/keymaps/dvorak_intl_squisher/compiled.hex new file mode 100644 index 00000000000..dc734d24196 Binary files /dev/null and b/keyboard/ergodox_ez/keymaps/dvorak_intl_squisher/compiled.hex differ diff --git a/keyboard/ergodox_ez/keymaps/dvorak_intl_squisher/dvorak_intl_squisher.hex b/keyboard/ergodox_ez/keymaps/dvorak_intl_squisher/dvorak_intl_squisher.hex deleted file mode 100644 index bd70f5829f9..00000000000 Binary files a/keyboard/ergodox_ez/keymaps/dvorak_intl_squisher/dvorak_intl_squisher.hex and /dev/null differ diff --git a/keyboard/ergodox_ez/keymaps/dvorak_spanish/README.md b/keyboard/ergodox_ez/keymaps/dvorak_spanish/README.md new file mode 100644 index 00000000000..e075e3cd7d6 --- /dev/null +++ b/keyboard/ergodox_ez/keymaps/dvorak_spanish/README.md @@ -0,0 +1,99 @@ +# Ergodox Spanish Dvorak Layout + * See spanish dvorak layout [here](http://djelibeibi.unex.es/dvorak/) + * Software layout must be set to SPANISH QWERTY to work properly + +## Keymap Layers + - L0: spanish dvorak with some customizations (see layout below) + - L1: auxiliary keys (includes qwerty shortcuts, numpad...) + - L2: qwerty layout with customizations + + +### Keymap 0: Base layer +Keys with double values (like Esc/Ctrl) correspond to the 'tapped' key and the 'held' key, respectively + +

+
+,--------------------------------------------------.           ,--------------------------------------------------.
+|   \    |   1  |   2  |   3  |   4  |   5  |  <>  |           |   ¡  |   6  |   7  |   8  |   9  |   0  |   '    |
+|--------+------+------+------+------+-------------|           |------+------+------+------+------+------+--------|
+| F1/~L1 |   .  |   ,  |   Ñ  |   P  |   Y  |MEH_T |           |  L1  |   F  |   G  |   C  |   H  |   L  |ALL_T/+ |
+|--------+------+------+------+------+------| DEL  |           | ~L1  |------+------+------+------+------+--------|
+|Esc/Ctrl|   A  |   O  |   E  |   U  |   I  |------|           |------|   D  |   R  |   T  |   N  |   S  |'/RCtrl |
+|--------+------+------+------+------+------| LGUI |           | RALT |------+------+------+------+------+--------|
+| {/LSft |   -  |   Q  |   J  |   K  |   X  |      |           |      |   B  |   M  |   W  |   V  |   Z  | }/RSft |
+'--------+------+------+------+------+-------------'           '-------------+------+------+------+------+--------'
+  |[/LALT| HOME |PGDOWN| PGUP | END  |                                       | LEFT | DOWN |  UP  |RIGHT |]/LALT|
+  '----------------------------------'                                       '----------------------------------'
+                                       ,-------------.       ,-------------.
+                                       |F5/CAG|F6/~L1|       |F7/~L1|F8/CAG|
+                                ,------|------|------|       |------+--------+------.
+                                |      |      |F4/CA |       |F11/CA|        |      |
+                                | ENTER| TAB  |------|       |------|  BSPC  | SPACE|
+                                |      |      |F3/SA |       |F12/SA|        |      |
+                                '--------------------'       '----------------------'
+ CAG = CTRL-ALT-GUI
+  CA = CTRL-ALT
+  SA = SHIFT-ALT
+
+
+ +### Keymap 1: Aux layer + +

+
+,--------------------------------------------------.           ,--------------------------------------------------.
+|        |  F1  |  F2  |  F3  |  F4  |  F5  | SLEEP|           | PWR  |  F6  |  F7  |  F8  |  F9  |  F10 |   F11  |
+|--------+------+------+------+------+-------------|           |------+------+------+------+------+------+--------|
+|        |  <   |  >   | MsUp |      |      |      |           | ~L0  |      |   7  |   8  |   9  |   *  |  '^    |
+|--------+------+------+------+------+------|      |           |      |------+------+------+------+------+--------|
+|        |      |MsLeft|MsDown|MsRght|      |------|           |------|      |   4  |   5  |   6  |   +  |   Ç    |
+|--------+------+------+------+------+------|      |           |PSCR  |------+------+------+------+------+--------|
+|CAPSLOCK|      |      |      |      |      |      |           |      |      |   1  |   2  |   3  |   /  |        |
+'--------+------+------+------+------+-------------'           '-------------+------+------+------+------+--------'
+  |CTRL-S|CTRL-Z|CTRL-X|CTRL-C|CTRL-V|                                       |      |    . |   0  |   =  |      |
+  '----------------------------------'                                       '----------------------------------'
+                                       ,-------------.       ,-------------.
+                                       |      |      |       |      | Play |
+                                ,------|------|------|       |------+------+------.
+                                |      |      |      |       | VolUp|      |      |
+                                | Lclk | Rclk |------|       |------| Prev | Next |
+                                |      |      |  L2  |       | VolDn|      |      |
+                                '--------------------'       '--------------------'
+
+
+ +### Keymap 2: QWERTY layer + +

+
+,--------------------------------------------------.           ,--------------------------------------------------.
+|   \    |   1  |   2  |   3  |   4  |   5  |  <>  |           |   ¡  |   6  |   7  |   8  |   9  |   0  |   '    |
+|--------+------+------+------+------+-------------|           |------+------+------+------+------+------+--------|
+|  TRANS |   Q  |   W  |   E  |   R  |   T  |MEH_T |           | TRANS|   Y  |   U  |   I  |   O  |   P  |ALL_T/+ |
+|--------+------+------+------+------+------| DEL  |           |      |------+------+------+------+------+--------|
+|Esc/Ctrl|   A  |   S  |   D  |   F  |   G  |------|           |------|   H  |   J  |   K  |   L  |   Ñ  |'/RCtrl |
+|--------+------+------+------+------+------| LGUI |           | RALT |------+------+------+------+------+--------|
+| {/LSft |   Z  |   X  |   C  |   V  |   B  |      |           |      |   N  |   M  |   ,  |   .  |   -  | }/RSft |
+'--------+------+------+------+------+-------------'           '-------------+------+------+------+------+--------'
+  |[/LALT| HOME |PGDOWN| PGUP | END  |                                       | LEFT | DOWN |  UP  |RIGHT |]/LALT|
+  '----------------------------------'                                       '----------------------------------'
+                                       ,-------------.       ,-------------.
+                                       |F5/CAG| TRANS|       | TRANS|F8/CAG|
+                                ,------|------|------|       |------+--------+------.
+                                |      |      |F4/CA |       |F11/CA|        |      |
+                                | ENTER| TAB  |------|       |------|  BSPC  | SPACE|
+                                |      |      | TRANS|       |F12/SA|        |      |
+                                '--------------------'       '----------------------'
+ CAG = CTRL-ALT-GUI
+  CA = CTRL-ALT
+  SA = SHIFT-ALT
+
+
+ + +## Generation of .hex file +> [Download scripts from here](https://github.com/johgh/keyboard/tree/master/ergodox) + +> Execute install.sh and generate.sh scripts. + +> Flash with `teensy_loader` binary (should be installed from previous step) diff --git a/keyboard/ergodox_ez/keymaps/dvorak_spanish/compiled.hex b/keyboard/ergodox_ez/keymaps/dvorak_spanish/compiled.hex new file mode 100644 index 00000000000..8150f559b51 Binary files /dev/null and b/keyboard/ergodox_ez/keymaps/dvorak_spanish/compiled.hex differ diff --git a/keyboard/ergodox_ez/keymaps/dvorak_spanish/keymap.c b/keyboard/ergodox_ez/keymaps/dvorak_spanish/keymap.c new file mode 100755 index 00000000000..33a0480c942 --- /dev/null +++ b/keyboard/ergodox_ez/keymaps/dvorak_spanish/keymap.c @@ -0,0 +1,284 @@ +#include "ergodox_ez.h" +#include "debug.h" +#include "action_layer.h" + +/****************************************************************************************** + * SPANISH DVORAK LAYOUT (see http://djelibeibi.unex.es/dvorak/) + * Layer 1: auxiliary keys + * Layer 2: full qwerty layout + ****************************************************************************************** + * IMPORTANT: Software layout must be set to SPANISH QWERTY to work properly + *****************************************************************************************/ + +// LAYERS +#define BASE 0 // dvorak layout (default) +#define AUX 1 // auxiliary keys +#define QWERTY 2 // qwerty layout + +// MACROS +#define OBRACE 0 // key { or shift +#define CBRACE 1 // key } or shift +#define OBRACK 2 // key [ or left alt +#define CBRACK 3 // key ] or left alt +#define CAPS 4 // caps lock + +// LEDS +#define USB_LED_NUM_LOCK 0 +#define USB_LED_CAPS_LOCK 1 +#define USB_LED_SCROLL_LOCK 2 +#define USB_LED_COMPOSE 3 +#define USB_LED_KANA 4 + +// TIMERS +#define KEY_TAP_FAST 85 +#define KEY_TAP_SLOW 95 + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +/* Keymap 0: Base layer + * Keys with double values (like Esc/Ctrl) correspond to the 'tapped' key and the 'held' key, respectively + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | \ | 1 | 2 | 3 | 4 | 5 | <> | | ¡ | 6 | 7 | 8 | 9 | 0 | ' | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | F1/~L1 | . | , | Ñ | P | Y |MEH_T | | L1 | F | G | C | H | L |ALL_T/+ | + * |--------+------+------+------+------+------| DEL | | ~L1 |------+------+------+------+------+--------| + * |Esc/Ctrl| A | O | E | U | I |------| |------| D | R | T | N | S |'/RCtrl | + * |--------+------+------+------+------+------| LGUI | | RALT |------+------+------+------+------+--------| + * | {/LSft | - | Q | J | K | X | | | | B | M | W | V | Z | }/RSft | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * |[/LALT| HOME |PGDOWN| PGUP | END | | LEFT | DOWN | UP |RIGHT |]/LALT| + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * |F5/CAG|F6/~L1| |F7/~L1|F8/CAG| + * ,------|------|------| |------+--------+------. + * | | |F4/CA | |F11/CA| | | + * | ENTER| TAB |------| |------| BSPC | SPACE| + * | | |F3/SA | |F12/SA| | | + * `--------------------' `----------------------' + * CAG = CTRL-ALT-GUI + * CA = CTRL-ALT + * SA = SHIFT-ALT + * + */ +[BASE] = KEYMAP( + // left hand + KC_GRAVE, KC_1, KC_2, KC_3, KC_4, KC_5, KC_NONUS_BSLASH, + LT(AUX, KC_F1), KC_DOT, KC_COMM,KC_SCLN,KC_P, KC_Y, MEH_T(KC_DEL), + CTL_T(KC_ESC), KC_A, KC_O, KC_E, KC_U, KC_I, + M(OBRACE), KC_SLSH,KC_Q, KC_J, KC_K, KC_X, KC_LGUI, + M(OBRACK), KC_HOME,KC_PGDN,KC_PGUP,KC_END, + LCAG_T(KC_F5), LT(AUX, KC_F6), + MT(MOD_LALT | MOD_LCTL, KC_F4), + KC_ENT,KC_TAB,MT((MOD_LALT | MOD_LSFT), KC_F3), + // right hand + KC_EQL, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINUS, + KC_FN1, KC_F, KC_G, KC_C, KC_H, KC_L, ALL_T(KC_RBRACKET), + KC_D, KC_R, KC_T, KC_N, KC_S, CTL_T(KC_QUOTE), + KC_RALT, KC_B, KC_M, KC_W, KC_V, KC_Z, M(CBRACE), + KC_LEFT,KC_DOWN,KC_UP, KC_RGHT,M(CBRACK), + LT(AUX, KC_F7), LCAG_T(KC_F8), + MT(MOD_LALT | MOD_LCTL, KC_F11), + MT(MOD_LALT | MOD_LSFT, KC_F12),KC_BSPC, KC_SPC + ), +/* Keymap 1: Aux layer + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | | F1 | F2 | F3 | F4 | F5 | SLEEP | PWR | F6 | F7 | F8 | F9 | F10 | F11 | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | | < | > | MsUp | | | | | ~L0 | | 7 | 8 | 9 | * | `^ | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | |MsLeft|MsDown|MsRght| |------| |------| | 4 | 5 | 6 | + | Ç | + * |--------+------+------+------+------+------| | |PSCR |------+------+------+------+------+--------| + * |CAPSLOCK| | | | | | | | | | 1 | 2 | 3 | / | | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * |CTRL-S|CTRL-Z|CTRL-X|CTRL-C|CTRL-V| | | . | 0 | = | | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | | | | | Play | + * ,------|------|------| |------+------+------. + * | | | | | VolUp| | | + * | Lclk | Rclk |------| |------| Prev | Next | + * | | | L2 | | VolDn| | | + * `--------------------' `--------------------' + */ +[AUX] = KEYMAP( + // left hand + KC_NO , KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_SLEP, + KC_TRNS, KC_NONUS_BSLASH, LSFT(KC_NONUS_BSLASH), KC_MS_U, KC_NO, KC_NO, KC_NO, + KC_NO , KC_NO, KC_MS_L, KC_MS_D, KC_MS_R, KC_NO , + M(CAPS), KC_NO, KC_NO , KC_NO , KC_NO , KC_NO , KC_NO, + LCTL(KC_S), LCTL(KC_Z), LCTL(KC_X), LCTL(KC_C), LCTL(KC_V), + KC_NO , KC_TRNS, + KC_NO, + KC_BTN1, KC_BTN2, TG(QWERTY), + // right hand + KC_PWR, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, + KC_TRNS, KC_NO, KC_7, KC_8, KC_9, KC_PAST, KC_LBRACKET, + KC_NO, KC_4, KC_5, KC_6, KC_PPLS, KC_BSLASH, + KC_PSCR, KC_NO, KC_1, KC_2, KC_3, KC_PSLS, KC_NO, + KC_NO ,KC_DOT, KC_0, KC_PEQL, KC_NO, + KC_TRNS, KC_MPLY, + KC_VOLU, + KC_VOLD, KC_MPRV, KC_MNXT +), +/* Keymap 2: QWERTY layer + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | \ | 1 | 2 | 3 | 4 | 5 | <> | | ¡ | 6 | 7 | 8 | 9 | 0 | ' | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | TRANS | Q | W | E | R | T |MEH_T | | TRANS| Y | U | I | O | P |ALL_T/+ | + * |--------+------+------+------+------+------| DEL | | |------+------+------+------+------+--------| + * |Esc/Ctrl| A | S | D | F | G |------| |------| H | J | K | L | Ñ |'/RCtrl | + * |--------+------+------+------+------+------| LGUI | | RALT |------+------+------+------+------+--------| + * | {/LSft | Z | X | C | V | B | | | | N | M | , | . | - | }/RSft | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * |[/LALT| HOME |PGDOWN| PGUP | END | | LEFT | DOWN | UP |RIGHT |]/LALT| + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * |F5/CAG| TRANS| | TRANS|F8/CAG| + * ,------|------|------| |------+--------+------. + * | | |F4/CA | |F11/CA| | | + * | ENTER| TAB |------| |------| BSPC | SPACE| + * | | | TRANS| |F12/SA| | | + * `--------------------' `----------------------' + * CAG = CTRL-ALT-GUI + * CA = CTRL-ALT + * SA = SHIFT-ALT + * + */ +[QWERTY] = KEYMAP( + // left hand + KC_GRAVE, KC_1, KC_2, KC_3, KC_4, KC_5, KC_NONUS_BSLASH, + KC_TRNS, KC_Q, KC_W, KC_E, KC_R, KC_T, MEH_T(KC_DEL), + CTL_T(KC_ESC), KC_A, KC_S, KC_D, KC_F, KC_G, + M(OBRACE), KC_Z, KC_X, KC_C, KC_V, KC_B, KC_LGUI, + M(OBRACK), KC_HOME,KC_PGDN,KC_PGUP,KC_END, + LCAG_T(KC_F5), KC_TRNS, + MT(MOD_LALT | MOD_LCTL, KC_F4), + KC_ENT,KC_TAB,KC_TRNS, + // right hand + KC_EQL, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINUS, + KC_TRNS, KC_Y, KC_U, KC_I, KC_O, KC_P, ALL_T(KC_RBRACKET), + KC_H, KC_J, KC_K, KC_L, KC_SCLN,CTL_T(KC_QUOTE), + KC_RALT, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH,M(CBRACE), + KC_LEFT,KC_DOWN,KC_UP, KC_RGHT,M(CBRACK), + KC_TRNS, LCAG_T(KC_F8), + MT(MOD_LALT | MOD_LCTL, KC_F11), + MT(MOD_LALT | MOD_LSFT, KC_F12),KC_BSPC, KC_SPC +), +}; + +const uint16_t PROGMEM fn_actions[] = { + [1] = ACTION_LAYER_TAP_TOGGLE(AUX) // FN1 - Momentary Layer 1 (Aux) +}; + +static uint16_t key_timer; + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) +{ + switch(id) { + case OBRACE: { + if (record->event.pressed) { + key_timer = timer_read(); + register_code(KC_RSFT); + } else { + unregister_code(KC_RSFT); + if (timer_elapsed(key_timer) < KEY_TAP_SLOW) { + register_code(KC_RALT); + register_code(KC_QUOTE); + unregister_code(KC_QUOTE); + unregister_code(KC_RALT); + } + } + break; + } + case CBRACE: { + if (record->event.pressed) { + key_timer = timer_read(); + register_code(KC_RSFT); + } else { + unregister_code(KC_RSFT); + if (timer_elapsed(key_timer) < KEY_TAP_SLOW) { + register_code(KC_RALT); + register_code(KC_BSLS); + unregister_code(KC_BSLS); + unregister_code(KC_RALT); + } + } + break; + } + case OBRACK: { + if (record->event.pressed) { + key_timer = timer_read(); + register_code(KC_LALT); + } else { + unregister_code(KC_LALT); + if (timer_elapsed(key_timer) < KEY_TAP_SLOW) { + register_code(KC_RALT); + register_code(KC_LBRACKET); + unregister_code(KC_LBRACKET); + unregister_code(KC_RALT); + } + } + break; + } + case CBRACK: { + if (record->event.pressed) { + key_timer = timer_read(); + register_code(KC_LALT); + } else { + unregister_code(KC_LALT); + if (timer_elapsed(key_timer) < KEY_TAP_SLOW) { + register_code(KC_RALT); + register_code(KC_RBRACKET); + unregister_code(KC_RBRACKET); + unregister_code(KC_RALT); + } + } + break; + } + case CAPS: { + if (record->event.pressed) { + register_code(KC_CAPSLOCK); + } else { + unregister_code(KC_CAPSLOCK); + } + break; + } + } + return MACRO_NONE; +}; + +// Runs just one time when the keyboard initializes. +void matrix_init_user(void) { + +}; + +// Runs constantly in the background, in a loop. +void matrix_scan_user(void) { + + uint8_t layer = biton32(layer_state); + + ergodox_board_led_off(); + ergodox_right_led_1_off(); + ergodox_right_led_2_off(); + ergodox_right_led_3_off(); + switch (layer) { + case 1: + ergodox_right_led_3_on(); + break; + case 2: + ergodox_right_led_2_on(); + break; + default: + // none + break; + } + + // Turn the caps lock led on + if (host_keyboard_leds() & (1<event.pressed) { - register_mods(MOD_BIT(KC_LSFT)); - if (record->tap.count && !record->tap.interrupted) { - register_code(KC_9); - } - else { - record->tap.count = 0; - } - } - else { - if (record->tap.count) { - unregister_code(KC_9); - } - else { - } - unregister_mods(MOD_BIT(KC_LSFT)); - } - break; - - case 1: - if (record->event.pressed) { - register_mods(MOD_BIT(KC_LSFT)); - if (record->tap.count && !record->tap.interrupted) { - register_code(KC_0); - } - else { - record->tap.count = 0; - } - } - else { - if (record->tap.count) { - unregister_code(KC_0); - } - else { - } - unregister_mods(MOD_BIT(KC_LSFT)); - } - break; - } - return MACRO_NONE; + return MACRO_NONE; }; // Runs just one time when the keyboard initializes. @@ -198,28 +156,48 @@ void matrix_init_user(void) { }; +LEADER_EXTERNS(); + // Runs constantly in the background, in a loop. void matrix_scan_user(void) { - uint8_t layer = biton32(layer_state); + uint8_t layer = biton32(layer_state); - ergodox_board_led_off(); - ergodox_right_led_1_off(); - ergodox_right_led_2_off(); - ergodox_right_led_3_off(); - switch (layer) { - // TODO: Make this relevant to the ErgoDox EZ. - case 1: - ergodox_right_led_1_on(); - break; - case 2: - ergodox_right_led_2_on(); - break; - default: - // none - break; + ergodox_board_led_off(); + ergodox_right_led_1_off(); + ergodox_right_led_2_off(); + ergodox_right_led_3_off(); + switch (layer) { + // TODO: Make this relevant to the ErgoDox EZ. + case 1: + ergodox_right_led_1_on(); + break; + case 2: + ergodox_right_led_2_on(); + break; + default: + // none + break; + } + + LEADER_DICTIONARY() { + leading = false; + leader_end(); + + SEQ_ONE_KEY(KC_W) { + register_code(KC_LALT); + register_code(KC_F4); + unregister_code(KC_F4); + unregister_code(KC_LALT); } - -}; - + SEQ_ONE_KEY(KC_O) { + register_code(KC_LCTL); + register_code(KC_LSFT); + register_code(KC_O); + unregister_code(KC_O); + unregister_code(KC_LSFT); + unregister_code(KC_LCTL); + } + } +} diff --git a/keyboard/ergodox_ez/keymaps/erez_experimental/makefile.mk b/keyboard/ergodox_ez/keymaps/erez_experimental/makefile.mk index 4c3a314ed6d..faca18b5431 100644 --- a/keyboard/ergodox_ez/keymaps/erez_experimental/makefile.mk +++ b/keyboard/ergodox_ez/keymaps/erez_experimental/makefile.mk @@ -2,4 +2,4 @@ # for your own particular keymap SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend - +COMMAND_ENABLE = no # Commands for debug and configuration diff --git a/keyboard/ergodox_ez/keymaps/erez_experimental/readme.md b/keyboard/ergodox_ez/keymaps/erez_experimental/readme.md index a9c572390ae..66acfa187b9 100644 --- a/keyboard/ergodox_ez/keymaps/erez_experimental/readme.md +++ b/keyboard/ergodox_ez/keymaps/erez_experimental/readme.md @@ -4,6 +4,12 @@ This is my personal layout which I use to test out ideas which may or may not ma Changelog: +## May 24, 2016: + +* Implements Leader key example + * Leader, W sends Alt-F4 + * Leader, O sends Ctrl-shift-o (a shortcut I use in FrontApp) + ## May 8, 2016: * Makes bottom-right key send minus/underscore when tapped, L1 temporary toggle when held diff --git a/keyboard/ergodox_ez/keymaps/german-kinergo/compiled.hex b/keyboard/ergodox_ez/keymaps/german-kinergo/compiled.hex new file mode 100644 index 00000000000..1ecea9fa490 Binary files /dev/null and b/keyboard/ergodox_ez/keymaps/german-kinergo/compiled.hex differ diff --git a/keyboard/ergodox_ez/keymaps/german-kinergo/german-kinergo.hex b/keyboard/ergodox_ez/keymaps/german-kinergo/german-kinergo.hex deleted file mode 100644 index 03df4759676..00000000000 Binary files a/keyboard/ergodox_ez/keymaps/german-kinergo/german-kinergo.hex and /dev/null differ diff --git a/keyboard/ergodox_ez/keymaps/german-manuneo/compiled.hex b/keyboard/ergodox_ez/keymaps/german-manuneo/compiled.hex new file mode 100644 index 00000000000..bef079b16a8 Binary files /dev/null and b/keyboard/ergodox_ez/keymaps/german-manuneo/compiled.hex differ diff --git a/keyboard/ergodox_ez/keymaps/german-manuneo/german-manuneo.hex b/keyboard/ergodox_ez/keymaps/german-manuneo/german-manuneo.hex deleted file mode 100644 index ee1d30967d6..00000000000 Binary files a/keyboard/ergodox_ez/keymaps/german-manuneo/german-manuneo.hex and /dev/null differ diff --git a/keyboard/ergodox_ez/keymaps/german/compiled.hex b/keyboard/ergodox_ez/keymaps/german/compiled.hex new file mode 100644 index 00000000000..3979ad8c937 Binary files /dev/null and b/keyboard/ergodox_ez/keymaps/german/compiled.hex differ diff --git a/keyboard/ergodox_ez/keymaps/german/german.hex b/keyboard/ergodox_ez/keymaps/german/german.hex deleted file mode 100644 index ce54b547678..00000000000 Binary files a/keyboard/ergodox_ez/keymaps/german/german.hex and /dev/null differ diff --git a/keyboard/ergodox_ez/keymaps/j3rn/compiled.hex b/keyboard/ergodox_ez/keymaps/j3rn/compiled.hex new file mode 100644 index 00000000000..d925383407b Binary files /dev/null and b/keyboard/ergodox_ez/keymaps/j3rn/compiled.hex differ diff --git a/keyboard/ergodox_ez/keymaps/j3rn/j3rn.hex b/keyboard/ergodox_ez/keymaps/j3rn/j3rn.hex deleted file mode 100644 index 40fcc2ba0d6..00000000000 Binary files a/keyboard/ergodox_ez/keymaps/j3rn/j3rn.hex and /dev/null differ diff --git a/keyboard/ergodox_ez/keymaps/jack/compiled.hex b/keyboard/ergodox_ez/keymaps/jack/compiled.hex new file mode 100644 index 00000000000..b5f54dd926e Binary files /dev/null and b/keyboard/ergodox_ez/keymaps/jack/compiled.hex differ diff --git a/keyboard/ergodox_ez/keymaps/jack/jack.hex b/keyboard/ergodox_ez/keymaps/jack/jack.hex deleted file mode 100644 index cfccb872655..00000000000 Binary files a/keyboard/ergodox_ez/keymaps/jack/jack.hex and /dev/null differ diff --git a/keyboard/ergodox_ez/keymaps/jacobono/compiled.hex b/keyboard/ergodox_ez/keymaps/jacobono/compiled.hex new file mode 100644 index 00000000000..bfa00ed2e1d Binary files /dev/null and b/keyboard/ergodox_ez/keymaps/jacobono/compiled.hex differ diff --git a/keyboard/ergodox_ez/keymaps/jacobono/jacobono.hex b/keyboard/ergodox_ez/keymaps/jacobono/jacobono.hex deleted file mode 100644 index f780f648f37..00000000000 Binary files a/keyboard/ergodox_ez/keymaps/jacobono/jacobono.hex and /dev/null differ diff --git a/keyboard/ergodox_ez/keymaps/jgarr/compiled.hex b/keyboard/ergodox_ez/keymaps/jgarr/compiled.hex new file mode 100644 index 00000000000..d452983998f Binary files /dev/null and b/keyboard/ergodox_ez/keymaps/jgarr/compiled.hex differ diff --git a/keyboard/ergodox_ez/keymaps/jgarr/jgarr.hex b/keyboard/ergodox_ez/keymaps/jgarr/jgarr.hex deleted file mode 100644 index 38be3e46896..00000000000 Binary files a/keyboard/ergodox_ez/keymaps/jgarr/jgarr.hex and /dev/null differ diff --git a/keyboard/ergodox_ez/keymaps/kastyle/compiled.hex b/keyboard/ergodox_ez/keymaps/kastyle/compiled.hex new file mode 100644 index 00000000000..0a229cac5bd Binary files /dev/null and b/keyboard/ergodox_ez/keymaps/kastyle/compiled.hex differ diff --git a/keyboard/ergodox_ez/keymaps/kastyle/kastyle.hex b/keyboard/ergodox_ez/keymaps/kastyle/kastyle.hex deleted file mode 100644 index 684e65404ac..00000000000 Binary files a/keyboard/ergodox_ez/keymaps/kastyle/kastyle.hex and /dev/null differ diff --git a/keyboard/ergodox_ez/keymaps/kines-ish/compiled.hex b/keyboard/ergodox_ez/keymaps/kines-ish/compiled.hex new file mode 100644 index 00000000000..54524b326af Binary files /dev/null and b/keyboard/ergodox_ez/keymaps/kines-ish/compiled.hex differ diff --git a/keyboard/ergodox_ez/keymaps/kines-ish/kines-ish.hex b/keyboard/ergodox_ez/keymaps/kines-ish/kines-ish.hex deleted file mode 100644 index c04a78512a5..00000000000 Binary files a/keyboard/ergodox_ez/keymaps/kines-ish/kines-ish.hex and /dev/null differ diff --git a/keyboard/ergodox_ez/keymaps/mpiechotka/compiled.hex b/keyboard/ergodox_ez/keymaps/mpiechotka/compiled.hex new file mode 100644 index 00000000000..35a56dd4c15 Binary files /dev/null and b/keyboard/ergodox_ez/keymaps/mpiechotka/compiled.hex differ diff --git a/keyboard/ergodox_ez/keymaps/mpiechotka/mpiechotka.hex b/keyboard/ergodox_ez/keymaps/mpiechotka/mpiechotka.hex deleted file mode 100644 index 287cfcd6ebe..00000000000 Binary files a/keyboard/ergodox_ez/keymaps/mpiechotka/mpiechotka.hex and /dev/null differ diff --git a/keyboard/ergodox_ez/keymaps/msc/compiled.hex b/keyboard/ergodox_ez/keymaps/msc/compiled.hex new file mode 100644 index 00000000000..b30b84d293b Binary files /dev/null and b/keyboard/ergodox_ez/keymaps/msc/compiled.hex differ diff --git a/keyboard/ergodox_ez/keymaps/msc/msc.hex b/keyboard/ergodox_ez/keymaps/msc/msc.hex deleted file mode 100644 index a466a37af73..00000000000 Binary files a/keyboard/ergodox_ez/keymaps/msc/msc.hex and /dev/null differ diff --git a/keyboard/ergodox_ez/keymaps/naps62/compiled.hex b/keyboard/ergodox_ez/keymaps/naps62/compiled.hex new file mode 100644 index 00000000000..02cbf8be378 Binary files /dev/null and b/keyboard/ergodox_ez/keymaps/naps62/compiled.hex differ diff --git a/keyboard/ergodox_ez/keymaps/naps62/ergodox_ez.hex b/keyboard/ergodox_ez/keymaps/naps62/ergodox_ez.hex deleted file mode 100644 index e5f213ba827..00000000000 Binary files a/keyboard/ergodox_ez/keymaps/naps62/ergodox_ez.hex and /dev/null differ diff --git a/keyboard/ergodox_ez/keymaps/naps62/keymap.c b/keyboard/ergodox_ez/keymaps/naps62/keymap.c index b954a311e67..d8c28423cf6 100644 --- a/keyboard/ergodox_ez/keymaps/naps62/keymap.c +++ b/keyboard/ergodox_ez/keymaps/naps62/keymap.c @@ -158,12 +158,12 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) }; // Runs just one time when the keyboard initializes. -void * matrix_init_user(void) { +void matrix_init_user(void) { }; // Runs constantly in the background, in a loop. -void * matrix_scan_user(void) { +void matrix_scan_user(void) { uint8_t layer = biton32(layer_state); diff --git a/keyboard/ergodox_ez/keymaps/ordinary/compiled.hex b/keyboard/ergodox_ez/keymaps/ordinary/compiled.hex new file mode 100644 index 00000000000..af29caaab78 Binary files /dev/null and b/keyboard/ergodox_ez/keymaps/ordinary/compiled.hex differ diff --git a/keyboard/ergodox_ez/keymaps/ordinary/ordinary.hex b/keyboard/ergodox_ez/keymaps/ordinary/ordinary.hex deleted file mode 100644 index 1e740e4f39f..00000000000 Binary files a/keyboard/ergodox_ez/keymaps/ordinary/ordinary.hex and /dev/null differ diff --git a/keyboard/ergodox_ez/keymaps/osx_de/compiled.hex b/keyboard/ergodox_ez/keymaps/osx_de/compiled.hex new file mode 100644 index 00000000000..b1f6aabf919 Binary files /dev/null and b/keyboard/ergodox_ez/keymaps/osx_de/compiled.hex differ diff --git a/keyboard/ergodox_ez/keymaps/osx_de/osx_de.hex b/keyboard/ergodox_ez/keymaps/osx_de/osx_de.hex deleted file mode 100644 index e6ce5da90b2..00000000000 Binary files a/keyboard/ergodox_ez/keymaps/osx_de/osx_de.hex and /dev/null differ diff --git a/keyboard/ergodox_ez/keymaps/osx_de_adnw_koy/compiled.hex b/keyboard/ergodox_ez/keymaps/osx_de_adnw_koy/compiled.hex new file mode 100644 index 00000000000..715b5acec4b Binary files /dev/null and b/keyboard/ergodox_ez/keymaps/osx_de_adnw_koy/compiled.hex differ diff --git a/keyboard/ergodox_ez/keymaps/osx_de_adnw_koy/osx_de_adnw_koy.hex b/keyboard/ergodox_ez/keymaps/osx_de_adnw_koy/osx_de_adnw_koy.hex deleted file mode 100644 index f574150e344..00000000000 Binary files a/keyboard/ergodox_ez/keymaps/osx_de_adnw_koy/osx_de_adnw_koy.hex and /dev/null differ diff --git a/keyboard/ergodox_ez/keymaps/osx_de_experimental/compiled.hex b/keyboard/ergodox_ez/keymaps/osx_de_experimental/compiled.hex new file mode 100644 index 00000000000..0372ed8afa7 Binary files /dev/null and b/keyboard/ergodox_ez/keymaps/osx_de_experimental/compiled.hex differ diff --git a/keyboard/ergodox_ez/keymaps/osx_de_experimental/osx_de_experimental.hex b/keyboard/ergodox_ez/keymaps/osx_de_experimental/osx_de_experimental.hex deleted file mode 100644 index 3c7ab58597c..00000000000 Binary files a/keyboard/ergodox_ez/keymaps/osx_de_experimental/osx_de_experimental.hex and /dev/null differ diff --git a/keyboard/ergodox_ez/keymaps/osx_fr/compiled.hex b/keyboard/ergodox_ez/keymaps/osx_fr/compiled.hex new file mode 100644 index 00000000000..37112ba4294 Binary files /dev/null and b/keyboard/ergodox_ez/keymaps/osx_fr/compiled.hex differ diff --git a/keyboard/ergodox_ez/keymaps/osx_fr/osx_fr.hex b/keyboard/ergodox_ez/keymaps/osx_fr/osx_fr.hex deleted file mode 100644 index abe089a9f3b..00000000000 Binary files a/keyboard/ergodox_ez/keymaps/osx_fr/osx_fr.hex and /dev/null differ diff --git a/keyboard/ergodox_ez/keymaps/osx_kinesis_pnut/compiled.hex b/keyboard/ergodox_ez/keymaps/osx_kinesis_pnut/compiled.hex new file mode 100644 index 00000000000..8a7ad640d0b Binary files /dev/null and b/keyboard/ergodox_ez/keymaps/osx_kinesis_pnut/compiled.hex differ diff --git a/keyboard/ergodox_ez/keymaps/plover/compiled.hex b/keyboard/ergodox_ez/keymaps/plover/compiled.hex new file mode 100644 index 00000000000..5e04e24944d Binary files /dev/null and b/keyboard/ergodox_ez/keymaps/plover/compiled.hex differ diff --git a/keyboard/ergodox_ez/keymaps/plover/plover.hex b/keyboard/ergodox_ez/keymaps/plover/plover.hex deleted file mode 100644 index d63cbb8faba..00000000000 Binary files a/keyboard/ergodox_ez/keymaps/plover/plover.hex and /dev/null differ diff --git a/keyboard/ergodox_ez/keymaps/plums/compiled.hex b/keyboard/ergodox_ez/keymaps/plums/compiled.hex new file mode 100644 index 00000000000..5d928815a2e Binary files /dev/null and b/keyboard/ergodox_ez/keymaps/plums/compiled.hex differ diff --git a/keyboard/ergodox_ez/keymaps/plums/plums.hex b/keyboard/ergodox_ez/keymaps/plums/plums.hex deleted file mode 100644 index f950ba3ab25..00000000000 Binary files a/keyboard/ergodox_ez/keymaps/plums/plums.hex and /dev/null differ diff --git a/keyboard/ergodox_ez/keymaps/romanzolotarev-norman-osx/compiled.hex b/keyboard/ergodox_ez/keymaps/romanzolotarev-norman-osx/compiled.hex new file mode 100644 index 00000000000..0cc546325ed Binary files /dev/null and b/keyboard/ergodox_ez/keymaps/romanzolotarev-norman-osx/compiled.hex differ diff --git a/keyboard/ergodox_ez/keymaps/romanzolotarev-norman-osx/romanzolotarev-norman-osx.hex b/keyboard/ergodox_ez/keymaps/romanzolotarev-norman-osx/romanzolotarev-norman-osx.hex deleted file mode 100644 index 1be94c43d10..00000000000 Binary files a/keyboard/ergodox_ez/keymaps/romanzolotarev-norman-osx/romanzolotarev-norman-osx.hex and /dev/null differ diff --git a/keyboard/ergodox_ez/keymaps/romanzolotarev-norman-plover-osx-hjkl/compiled.hex b/keyboard/ergodox_ez/keymaps/romanzolotarev-norman-plover-osx-hjkl/compiled.hex new file mode 100644 index 00000000000..59b9fa1d142 Binary files /dev/null and b/keyboard/ergodox_ez/keymaps/romanzolotarev-norman-plover-osx-hjkl/compiled.hex differ diff --git a/keyboard/ergodox_ez/keymaps/romanzolotarev-norman-plover-osx-hjkl/romanzolotarev-norman-plover-osx-hjkl.hex b/keyboard/ergodox_ez/keymaps/romanzolotarev-norman-plover-osx-hjkl/romanzolotarev-norman-plover-osx-hjkl.hex deleted file mode 100644 index c341ba2b2b6..00000000000 Binary files a/keyboard/ergodox_ez/keymaps/romanzolotarev-norman-plover-osx-hjkl/romanzolotarev-norman-plover-osx-hjkl.hex and /dev/null differ diff --git a/keyboard/ergodox_ez/keymaps/romanzolotarev-norman-plover-osx/compiled.hex b/keyboard/ergodox_ez/keymaps/romanzolotarev-norman-plover-osx/compiled.hex new file mode 100644 index 00000000000..66d01f1c695 Binary files /dev/null and b/keyboard/ergodox_ez/keymaps/romanzolotarev-norman-plover-osx/compiled.hex differ diff --git a/keyboard/ergodox_ez/keymaps/romanzolotarev-norman-plover-osx/romanzolotarev-norman-plover-osx.hex b/keyboard/ergodox_ez/keymaps/romanzolotarev-norman-plover-osx/romanzolotarev-norman-plover-osx.hex deleted file mode 100644 index b5eded6e660..00000000000 Binary files a/keyboard/ergodox_ez/keymaps/romanzolotarev-norman-plover-osx/romanzolotarev-norman-plover-osx.hex and /dev/null differ diff --git a/keyboard/ergodox_ez/keymaps/romanzolotarev-norman-qwerty-osx/compiled.hex b/keyboard/ergodox_ez/keymaps/romanzolotarev-norman-qwerty-osx/compiled.hex new file mode 100644 index 00000000000..439d7639c42 Binary files /dev/null and b/keyboard/ergodox_ez/keymaps/romanzolotarev-norman-qwerty-osx/compiled.hex differ diff --git a/keyboard/ergodox_ez/keymaps/romanzolotarev-norman-qwerty-osx/romanzolotarev-norman-qwerty-osx.hex b/keyboard/ergodox_ez/keymaps/romanzolotarev-norman-qwerty-osx/romanzolotarev-norman-qwerty-osx.hex deleted file mode 100644 index 80ae0751b18..00000000000 Binary files a/keyboard/ergodox_ez/keymaps/romanzolotarev-norman-qwerty-osx/romanzolotarev-norman-qwerty-osx.hex and /dev/null differ diff --git a/keyboard/ergodox_ez/keymaps/sneako/compiled.hex b/keyboard/ergodox_ez/keymaps/sneako/compiled.hex new file mode 100644 index 00000000000..d3258909203 Binary files /dev/null and b/keyboard/ergodox_ez/keymaps/sneako/compiled.hex differ diff --git a/keyboard/ergodox_ez/keymaps/sneako/sneako.hex b/keyboard/ergodox_ez/keymaps/sneako/sneako.hex deleted file mode 100644 index 1db1728652a..00000000000 Binary files a/keyboard/ergodox_ez/keymaps/sneako/sneako.hex and /dev/null differ diff --git a/keyboard/ergodox_ez/keymaps/software_neo2/compiled.hex b/keyboard/ergodox_ez/keymaps/software_neo2/compiled.hex new file mode 100644 index 00000000000..a4aafc13843 Binary files /dev/null and b/keyboard/ergodox_ez/keymaps/software_neo2/compiled.hex differ diff --git a/keyboard/ergodox_ez/keymaps/software_neo2/software_neo2.hex b/keyboard/ergodox_ez/keymaps/software_neo2/software_neo2.hex deleted file mode 100644 index 5ad6b23a7ea..00000000000 Binary files a/keyboard/ergodox_ez/keymaps/software_neo2/software_neo2.hex and /dev/null differ diff --git a/keyboard/ergodox_ez/keymaps/supercoder/README.md b/keyboard/ergodox_ez/keymaps/supercoder/README.md new file mode 100644 index 00000000000..ad531b3da74 --- /dev/null +++ b/keyboard/ergodox_ez/keymaps/supercoder/README.md @@ -0,0 +1,29 @@ +SuperCoder 2000 layout for the ErgoDox +================================================== + +![SuperCoder 2000](images/supercoder_2000.jpg) + +Ever found yourself in need of entering binary codes rapidly? Ever wanted to use +all ten fingers to do so? Ever felt your SuperCoder 2000 too limiting, by only +having three buttons? We heard you! With this layout for the ErgoDox EZ, you +will be able to tap in binary at an unparalleled speed and accuracy! Efficiency +never seen before! + +Behold the Ultimate SuperCoder 2000 layout! + +![SuperCoder layout](images/layout.png) + +### To use it... + +To use this piece of top quality engineering, you can either +[download the hex file][hex] we have prepared for you, or you can compile it on +your own: + + [hex]: https://raw.githubusercontent.com/algernon/ergodox-supercoder/master/supercoder.hex + +``` +$ git clone https://github.com/jackhumbert/qmk_firmware.git +$ cd qmk_firmware/keyboard/ergodox_ez +$ git clone https://github.com/algernon/ergodox-supercoder.git keymaps/supercoder +$ make KEYMAP=supercoder +``` diff --git a/keyboard/ergodox_ez/keymaps/supercoder/compiled.hex b/keyboard/ergodox_ez/keymaps/supercoder/compiled.hex new file mode 100644 index 00000000000..e4113a75794 Binary files /dev/null and b/keyboard/ergodox_ez/keymaps/supercoder/compiled.hex differ diff --git a/keyboard/ergodox_ez/keymaps/supercoder/config_user.h b/keyboard/ergodox_ez/keymaps/supercoder/config_user.h new file mode 100644 index 00000000000..8da13837262 --- /dev/null +++ b/keyboard/ergodox_ez/keymaps/supercoder/config_user.h @@ -0,0 +1,9 @@ +#ifndef CONFIG_USER_H +#define CONFIG_USER_H 1 + +#include "config.h" + +#undef LOCKING_SUPPORT_ENABLE +#undef LOCKING_RESYNC_ENABLE + +#endif diff --git a/keyboard/ergodox_ez/keymaps/supercoder/images/layout.png b/keyboard/ergodox_ez/keymaps/supercoder/images/layout.png new file mode 100644 index 00000000000..c72958c6e76 Binary files /dev/null and b/keyboard/ergodox_ez/keymaps/supercoder/images/layout.png differ diff --git a/keyboard/ergodox_ez/keymaps/supercoder/images/supercoder_2000.jpg b/keyboard/ergodox_ez/keymaps/supercoder/images/supercoder_2000.jpg new file mode 100644 index 00000000000..d690eaf0206 Binary files /dev/null and b/keyboard/ergodox_ez/keymaps/supercoder/images/supercoder_2000.jpg differ diff --git a/keyboard/ergodox_ez/keymaps/supercoder/keymap.c b/keyboard/ergodox_ez/keymaps/supercoder/keymap.c new file mode 100644 index 00000000000..ca21d30fd20 --- /dev/null +++ b/keyboard/ergodox_ez/keymaps/supercoder/keymap.c @@ -0,0 +1,75 @@ +/* + * SuperCoder 2000 layout + */ + +#include "ergodox_ez.h" + +/* Layers */ + +#define SC2K 0 // default layer + +/* The Keymap */ + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + /* Keymap 0: Base Layer + * + * ,-----------------------------------------------------. ,-----------------------------------------------------. + * | 0 | 0 | 0 | 0 | 0 | 0 | 0 | | 1 | 1 | 1 | 1 | 1 | 1 | 1 | + * |-----------+------+------+------+------+-------------| |------+------+------+------+------+------+-----------| + * | 0 | 0 | 0 | 0 | 0 | 0 | 0 | | 1 | 1 | 1 | 1 | 1 | 1 | 1 | + * |-----------+------+------+------+------+------| | | |------+------+------+------+------+-----------| + * | 0 | 0 | 0 | 0 | 0 | 0 |------| |------| 1 | 1 | 1 | 1 | 1 | 1 | + * |-----------+------+------+------+------+------| 0 | | 1 |------+------+------+------+------+-----------| + * | 0 | 0 | 0 | 0 | 0 | 0 | | | | 1 | 1 | 1 | 1 | 1 | 1 | + * `-----------+------+------+------+------+-------------' `-------------+------+------+------+------+-----------' + * | 0 | 0 | 0 | 0 | 0 | | 1 | 1 | 1 | 1 | 1 | + * `-----------------------------------' `-----------------------------------' + * ,-------------. ,-------------. + * | DONE | DONE | | DONE | DONE | + * ,------|------|------| |------+------+------. + * | | | DONE | | DONE | | | + * | DONE | DONE |------| |------| DONE | DONE | + * | | | DONE | | DONE | | | + * `--------------------' `--------------------' + */ +[SC2K] = KEYMAP( + // left hand + KC_0 ,KC_0 ,KC_0 ,KC_0 ,KC_0 ,KC_0 ,KC_0 +,KC_0 ,KC_0 ,KC_0 ,KC_0 ,KC_0 ,KC_0 ,KC_0 +,KC_0 ,KC_0 ,KC_0 ,KC_0 ,KC_0 ,KC_0 +,KC_0 ,KC_0 ,KC_0 ,KC_0 ,KC_0 ,KC_0 ,KC_0 +,KC_0 ,KC_0 ,KC_0 ,KC_0 ,KC_0 + + ,KC_ENT ,KC_ENT + ,KC_ENT + ,KC_ENT ,KC_ENT ,KC_ENT + + // right hand + ,KC_1 ,KC_1 ,KC_1 ,KC_1 ,KC_1 ,KC_1 ,KC_1 + ,KC_1 ,KC_1 ,KC_1 ,KC_1 ,KC_1 ,KC_1 ,KC_1 + ,KC_1 ,KC_1 ,KC_1 ,KC_1 ,KC_1 ,KC_1 + ,KC_1 ,KC_1 ,KC_1 ,KC_1 ,KC_1 ,KC_1 ,KC_1 + ,KC_1 ,KC_1 ,KC_1 ,KC_1 ,KC_1 + + ,KC_ENT ,KC_ENT + ,KC_ENT + ,KC_ENT ,KC_ENT ,KC_ENT + ), +}; + +const uint16_t PROGMEM fn_actions[] = { +}; + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) +{ + return MACRO_NONE; +}; + +// Runs just one time when the keyboard initializes. +void matrix_init_user(void) { +}; + +// Runs constantly in the background, in a loop. +void matrix_scan_user(void) { +} diff --git a/keyboard/ergodox_ez/keymaps/supercoder/makefile.mk b/keyboard/ergodox_ez/keymaps/supercoder/makefile.mk new file mode 100644 index 00000000000..41a195d9c0c --- /dev/null +++ b/keyboard/ergodox_ez/keymaps/supercoder/makefile.mk @@ -0,0 +1,6 @@ +BOOTMAGIC_ENABLE=no +COMMAND_ENABLE=no +SLEEP_LED_ENABLE=no +UNICODE_ENABLE=no +MOUSEKEY_ENABLE=no +EXTRAKEY_ENABLE=no diff --git a/keyboard/ergodox_ez/keymaps/techtomas/compiled.hex b/keyboard/ergodox_ez/keymaps/techtomas/compiled.hex new file mode 100644 index 00000000000..6bab275241e Binary files /dev/null and b/keyboard/ergodox_ez/keymaps/techtomas/compiled.hex differ diff --git a/keyboard/ergodox_ez/keymaps/techtomas/keymap.c b/keyboard/ergodox_ez/keymaps/techtomas/keymap.c index b7d3b9a116d..1ff6618b984 100644 --- a/keyboard/ergodox_ez/keymaps/techtomas/keymap.c +++ b/keyboard/ergodox_ez/keymaps/techtomas/keymap.c @@ -4,65 +4,65 @@ #define BASE 0 // default layer #define SYMB 1 // symbols -#define MDIA 2 // media +#define APP 2 // app layer #define CNTL 3 // control layer const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Keymap 0: Basic layer * * ,--------------------------------------------------. ,--------------------------------------------------. - * | L1/` | 1 | 2 | 3 | 4 | 5 |CmdSpc| | - | 6 | 7 | 8 | 9 | 0 | = | + * | L2/` | 1 | 2 | 3 | 4 | 5 |CmdSpc| | - | 6 | 7 | 8 | 9 | 0 | = | * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * |Meh/Tab | Q | W | E | R | T | STab | | L3 | Y | U | I | O | P | Meh/\ | + * | MEH/Tab| Q | W | E | R | T | [ | | ] | Y | U | I | O | P | MEH/\ | * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * |Hyp/Esc | L3/A | S | D | F | G |------| |------| H | J | K | L | L2/; | Hyp/' | - * |--------+------+------+------+------+------| Tab | |AltGui|------+------+------+------+------+--------| - * | LShift | L3/Z | X | C | V | B | | | | N | M | , | . | L2// | RShift | + * |Hyp/Esc | A | S | D | F | G |------| |------| H | J | K | L | L2/; | Hyp/' | + * |--------+------+------+------+------+------| Tab | | STab |------+------+------+------+------+--------| + * | LShift | Z | X | C | V | B | | | | N | M | , | . | L2// | RShift | * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * |LCtrl | LAlt | LGui |Left |Right | | UP | Down | [ | ] | L1 | + * |L1/Lft|L3/Rht| LCtl | LAlt | LGui | | Rgui | Up | Dn | L3 | L1 | * `----------------------------------' `----------------------------------' * ,-------------. ,-------------. - * | LCtl | LGui | | LAlt |ShfGui| + * | LCtl | LGui | |AltGui|ShfGui| * ,-------|------|------| |------+--------+------. - * | | | Home | | PgUp | | | + * | | |L1/Hom| |L2/PUp| | | * | Backsp|Delete|------| |------| Enter | Space | - * | | | End | | PgDn | | | + * | | |L3/End| |L1/PDn| | | * `--------------------' `-----------------------' */ // If it accepts an argument (i.e, is a function), it doesn't need KC_. // Otherwise, it needs KC_* [BASE] = KEYMAP( // layer 0 : default // left hand - LT(SYMB,KC_GRV), KC_1, KC_2, KC_3, KC_4, KC_5, LGUI(KC_SPC), - MEH_T(KC_TAB), KC_Q, KC_W, KC_E, KC_R, KC_T, S(KC_TAB), - ALL_T(KC_ESC), LT(CNTL,KC_A), KC_S, KC_D, KC_F, KC_G, - KC_LSFT, LT(CNTL,KC_Z), KC_X, KC_C, KC_V, KC_B, KC_TAB, - KC_LCTL, KC_LALT, KC_LGUI, KC_LEFT, KC_RIGHT, - KC_LCTL, KC_LGUI, - KC_HOME, - KC_BSPC, KC_DELETE, KC_END, + LT(APP,KC_GRV), KC_1, KC_2, KC_3, KC_4, KC_5, LGUI(KC_SPC), + MEH_T(KC_TAB), KC_Q, KC_W, KC_E, KC_R, KC_T, KC_LBRC, + ALL_T(KC_ESC), KC_A, KC_S, KC_D, KC_F, KC_G, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_TAB, + LT(SYMB,KC_LEFT), LT(CNTL,KC_RIGHT), KC_LCTL, KC_LALT, KC_LGUI, + KC_LCTL, KC_LGUI, + LT(SYMB,KC_HOME), + KC_BSPC, KC_DELETE, LT(CNTL,KC_END), // right hand - KC_MINS, KC_6, KC_7, KC_8, KC_9, KC_0, KC_EQL, - KC_FN3, KC_Y, KC_U, KC_I, KC_O, KC_P, MEH_T(KC_BSLS), - KC_H, KC_J, KC_K, KC_L, LT(MDIA,KC_SCLN), ALL_T(KC_QUOT), - LALT(KC_LGUI), KC_N, KC_M, KC_COMM, KC_DOT, LT(MDIA,KC_SLSH), KC_RSFT, - KC_UP, KC_DOWN, KC_LBRC, KC_RBRC, KC_FN1, - KC_LALT, S(KC_LGUI), - KC_PGUP, - KC_PGDN,KC_ENT, KC_SPC + KC_MINS, KC_6, KC_7, KC_8, KC_9, KC_0, KC_EQL, + KC_RBRC, KC_Y, KC_U, KC_I, KC_O, KC_P, MEH_T(KC_BSLS), + KC_H, KC_J, KC_K, KC_L, LT(APP,KC_SCLN), ALL_T(KC_QUOT), + S(KC_TAB), KC_N, KC_M, KC_COMM, KC_DOT, LT(APP,KC_SLSH), KC_RSFT, + KC_RGUI, KC_UP, KC_DOWN, KC_FN3, KC_FN1, + LALT(KC_LGUI), S(KC_LGUI), + LT(APP,KC_PGUP), + LT(SYMB,KC_PGDN), KC_ENT, KC_SPC ), /* Keymap 1: Symbol Layer * * ,--------------------------------------------------. ,--------------------------------------------------. - * | | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | F11 | + * | | F1 | F2 | F3 | F4 | F5 | | | Tab | F6 | F7 | F8 | F9 | F10 | F11 | * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | ! | @ | { | } | | | < | | > | : | 7 | 8 | 9 | / | F12 | + * | | ! | @ | { | } | | | < | | > | : | 7 | 8 | 9 | / | F12 | * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | # | $ | ( | ) | ` |------| |------| ; | 4 | 5 | 6 | * | Prnt | + * | | # | $ | ( | ) | ` |------| |------| ; | 4 | 5 | 6 | * | | * |--------+------+------+------+------+------| F14 | | F15 |------+------+------+------+------+--------| * | | % | ^ | [ | ] | ~ | | | | & | 1 | 2 | 3 | - | Entr | * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | | | | 0 | . | = | + | | + * | | | | | | | 0 | . | = | + | | * `----------------------------------' `----------------------------------' * ,-------------. ,-------------. * | | | | | | @@ -84,66 +84,25 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS, // right hand - KC_TRNS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, + KC_TAB, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, S(KC_DOT), KC_COLN, KC_7, KC_8, KC_9, KC_BSLS, KC_F12, - KC_SCLN, KC_4, KC_5, KC_6, KC_ASTR, KC_PSCR, + KC_SCLN, KC_4, KC_5, KC_6, KC_ASTR, KC_TRNS, KC_F15, KC_AMPR, KC_1, KC_2, KC_3, KC_MINS, KC_ENT, KC_0, KC_DOT, KC_EQL, KC_PLUS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS ), -/* Keymap 2: Media Layer +/* Keymap 2: App Layer * * ,--------------------------------------------------. ,--------------------------------------------------. * | | | | | | | | | | | | | | | | * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | | | | | | | | | | | | | | | + * | | CmdQ | CmdW | | | | Stab | | Play | Prev | Next | | |PrtSc | | * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | | | | |------| |------| | | | | | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | | | | | | | | | | | | | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | | | | | | | | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | Prev | Next | | Prev | Next | - * ,------|------|------| |------+------+------. - * | | | VolUp| | VolUp| | | - * | Play | Mute |------| |------| Mute | Play | - * | | | VolDn| | VolDn| | | - * `--------------------' `--------------------' - */ -// Control -[MDIA] = KEYMAP( - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_MPRV, KC_MNXT, - KC_VOLU, - KC_MPLY, KC_MUTE, KC_VOLD, - // right hand - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_MPRV, KC_MNXT, - KC_VOLU, - KC_VOLD, KC_MUTE, KC_MPLY -), -/* Keymap 3: Control Layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | Sleep | | | | | | Pwr | | | | | | | | | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | | | MsUp | | | | | | | | | | | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | |MsLeft|MsDown|MsRght| Lclk |------| |------| Lft | Down | Up | Right| | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | | | | Rclk | | | | | | | | | | + * | | | | | | |------| |------| VolDn|VolUp | | | | | + * |--------+------+------+------+------+------| | | Mute |------+------+------+------+------+--------| + * | | CmdZ | CmdX | CmdC | CmdY | CtrlC| | | | | | | | | | * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' * | | | | | | | | | | | | * `----------------------------------' `----------------------------------' @@ -156,14 +115,55 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * `--------------------' `--------------------' */ // Control +[APP] = KEYMAP( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, LGUI(KC_Q), LGUI(KC_W), KC_TRNS, KC_TRNS, KC_TRNS, S(KC_TAB), + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, LGUI(KC_Z), LGUI(KC_X), LGUI(KC_C), LGUI(KC_V), LCTL(KC_C), KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, + // right hand + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_MPLY, KC_MPRV, KC_MNXT, KC_TRNS, KC_TRNS, KC_PSCR, KC_TRNS, + KC_VOLD, KC_VOLU, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_MUTE, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS +), +/* Keymap 3: Control Layer + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | Pwr | | | | | | | | | | | | | | | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | | | | MsUp | | | | | | | | | | | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | |MsLeft|MsDown|MsRght| Lclk |------| |------| Lft | Down | Up | Right| | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | | | | | Rclk | | | | | | | | | | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | | | | | | | | | | | | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | Shift| | | Home | End | + * ,------|------|------| |------+------+------. + * | | | LAtl | | | | | + * | | |------| |------| | | + * | | | | | | | | + * `--------------------' `--------------------' + */ +// Control [CNTL] = KEYMAP( - KC_SLEP, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PWR, + KC_PWR, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MS_U, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_R, KC_BTN1, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_BTN2, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, + KC_LSFT, KC_TRNS, + KC_LALT, KC_TRNS, KC_TRNS, KC_TRNS, // right hand KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, @@ -171,7 +171,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, + KC_HOME, KC_END, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS ), @@ -179,7 +179,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { const uint16_t PROGMEM fn_actions[] = { [1] = ACTION_LAYER_TAP_TOGGLE(SYMB), - [2] = ACTION_LAYER_TAP_TOGGLE(MDIA), + [2] = ACTION_LAYER_TAP_TOGGLE(APP), [3] = ACTION_LAYER_TAP_TOGGLE(CNTL) // FN1 - Momentary Layer 1 (Symbols) }; diff --git a/keyboard/ergodox_ez/keymaps/techtomas/readme.md b/keyboard/ergodox_ez/keymaps/techtomas/readme.md index 1ed80fc20c4..36e0591a8e6 100644 --- a/keyboard/ergodox_ez/keymaps/techtomas/readme.md +++ b/keyboard/ergodox_ez/keymaps/techtomas/readme.md @@ -6,28 +6,49 @@ The base layer is a merge of what I liked with the default layout and the ordina * The Caps Lock postion handles [Hyper/Esc](http://brettterpstra.com/2012/12/08/a-useful-caps-lock-key/) * The Tab key toggles MEH. -* The two vertical mods on the left board are Shift+Tab and Tab. -* The two vertical mods on the right board are Control Layer tap/toggle and Alt+Cmd. +* The top vertical mods on the left and right are [ and ]. +* The bottom vertical mods on the left and right are tab and shift+tab * The HYPER and MEH key are made in the same location on the right side of the board as well. Using Keyboard Maestro for OS X makes one-handed shortcuts very easy. +* Layer switching is focused around the thumb clusters plus some additional locations for convience. ## Symbol Layer -The symbol layer can be tap/toggled through the bottom right key and also toggled holding the tilde/grave key in the upper left corner. I haven't used the symbol layer enough to tell if this was a good place or not but it made sense in my head +The symbol layer can be tap/toggled with the bottom right key and also toggled on the thumb clusters. The bottom two vertical mods are set to F14 and F15 which is the default for changing screen brightness on the mac -## Media Layer -/ & ; will toggle the media layer which has play and volume controls assigned to the thumb cluster. I found this an easy way to quickly play/pause +## App Layer +The app layer is used to control media playback and also some application shortcuts (OS X Focused). +It can be toggled on the left board in the top left corner (tilde/grave) or using your pinky on the right side of the board using either ; or /. +There is one additional toggle on the right thumb cluster for quick access to play and mute key combos. + +### Current App shortcuts defined +* Q = CMD+Q +* W = CMD+W +* Z = CMD+Z +* X = CMD+X +* C = CMD+C +* V = CMD+V +* B = CTRL+C +* P = Print Screen ## Control Layer -The a and z keys toggle the control layer. +The control layer is meant to help easily navigate and select text. It can also be stacked ontop of the Symbol layer when needed. + +The right arrow key and End key toggle the control layer on the left board. There is also a tap toggle for the layer in the same position on the right side of the board. On the left board you have mouse control with left & right click in the location of the G and B keys. On the right board you have vim-style arrow keys using hjkl -The thumb cluster and mods all pass down to this layer. +The left thumb cluster moves shift and alt within easy reach while holding the toggle (end). So far I've found this convient to navigate and skip around text when using the hjkl arrow keys. I found that it was easy to get the alt key stuck on depending on what key you released first so I added the PREVENT_STUCK_MODIFIERS to the config.h to help with that. ## Changelog +* May 4th, 2016 (v1.2): + * Moved layer toggles around to match my habbits of typing + * Enabled Prevent Stuck Modifers in my config.h (L3 + Alt on cluster would get stuck) + * Changed media layer to be more like an app layer with some quick shortcuts (mac centric) + * Moved around the base layer arrow keys so mod keys were more accesible + * Apr 29, 2016 (V1.1): * Added F14 and F15 to symbol layer * Added control layer toggle to A key. diff --git a/keyboard/ergodox_ez/keymaps/techtomas/techtomas.hex b/keyboard/ergodox_ez/keymaps/techtomas/techtomas.hex deleted file mode 100644 index 8aa849208f1..00000000000 Binary files a/keyboard/ergodox_ez/keymaps/techtomas/techtomas.hex and /dev/null differ diff --git a/keyboard/ergodox_ez/keymaps/tm2030/compiled.hex b/keyboard/ergodox_ez/keymaps/tm2030/compiled.hex new file mode 100644 index 00000000000..35837dc3017 Binary files /dev/null and b/keyboard/ergodox_ez/keymaps/tm2030/compiled.hex differ diff --git a/keyboard/ergodox_ez/keymaps/tm2030/tm2030.hex b/keyboard/ergodox_ez/keymaps/tm2030/tm2030.hex deleted file mode 100644 index 1cd95d6d9a9..00000000000 Binary files a/keyboard/ergodox_ez/keymaps/tm2030/tm2030.hex and /dev/null differ diff --git a/keyboard/ergodox_ez/keymaps/tonyabra_osx/compiled.hex b/keyboard/ergodox_ez/keymaps/tonyabra_osx/compiled.hex new file mode 100644 index 00000000000..336362a58bf Binary files /dev/null and b/keyboard/ergodox_ez/keymaps/tonyabra_osx/compiled.hex differ diff --git a/keyboard/ergodox_ez/keymaps/tonyabra_osx/tonyabra_osx.hex b/keyboard/ergodox_ez/keymaps/tonyabra_osx/tonyabra_osx.hex deleted file mode 100644 index 75a2333d78e..00000000000 Binary files a/keyboard/ergodox_ez/keymaps/tonyabra_osx/tonyabra_osx.hex and /dev/null differ diff --git a/keyboard/ergodox_ez/keymaps/townk_osx/compiled.hex b/keyboard/ergodox_ez/keymaps/townk_osx/compiled.hex new file mode 100644 index 00000000000..ea088861a25 Binary files /dev/null and b/keyboard/ergodox_ez/keymaps/townk_osx/compiled.hex differ diff --git a/keyboard/ergodox_ez/keymaps/townk_osx/townk_osx.hex b/keyboard/ergodox_ez/keymaps/townk_osx/townk_osx.hex deleted file mode 100644 index 868d86e82d7..00000000000 Binary files a/keyboard/ergodox_ez/keymaps/townk_osx/townk_osx.hex and /dev/null differ diff --git a/keyboard/ergodox_ez/keymaps/twey/compiled.hex b/keyboard/ergodox_ez/keymaps/twey/compiled.hex new file mode 100644 index 00000000000..dafb3670530 Binary files /dev/null and b/keyboard/ergodox_ez/keymaps/twey/compiled.hex differ diff --git a/keyboard/ergodox_ez/keymaps/twey/twey.hex b/keyboard/ergodox_ez/keymaps/twey/twey.hex deleted file mode 100644 index 14f5b7c7980..00000000000 Binary files a/keyboard/ergodox_ez/keymaps/twey/twey.hex and /dev/null differ diff --git a/keyboard/ergodox_ez/keymaps/workman_osx_mdw/compiled.hex b/keyboard/ergodox_ez/keymaps/workman_osx_mdw/compiled.hex new file mode 100644 index 00000000000..72b215f0f6b Binary files /dev/null and b/keyboard/ergodox_ez/keymaps/workman_osx_mdw/compiled.hex differ diff --git a/keyboard/ergodox_ez/keymaps/workman_osx_mdw/workman_osx_mdw.hex b/keyboard/ergodox_ez/keymaps/workman_osx_mdw/workman_osx_mdw.hex deleted file mode 100644 index 39b4076a594..00000000000 Binary files a/keyboard/ergodox_ez/keymaps/workman_osx_mdw/workman_osx_mdw.hex and /dev/null differ diff --git a/keyboard/ergodox_ez/keymaps/zweihander-osx/compiled.hex b/keyboard/ergodox_ez/keymaps/zweihander-osx/compiled.hex new file mode 100644 index 00000000000..56a19987fb6 Binary files /dev/null and b/keyboard/ergodox_ez/keymaps/zweihander-osx/compiled.hex differ diff --git a/keyboard/ergodox_ez/keymaps/zweihander-osx/keymap.c b/keyboard/ergodox_ez/keymaps/zweihander-osx/keymap.c index e9963886be3..3444152bc3b 100644 --- a/keyboard/ergodox_ez/keymaps/zweihander-osx/keymap.c +++ b/keyboard/ergodox_ez/keymaps/zweihander-osx/keymap.c @@ -6,19 +6,26 @@ #define SYMB 1 // symbols #define MDIA 2 // media keys +#define SGWK 0 // "sagewick", ⌘S ⌘⇥ +#define SGWF 1 // "sagewick freshly", ⌘S ⌘⇥ ⌘R +#define BBED 2 // BBEdit +#define TMNL 3 // Terminal +#define SAFA 4 // Safari +#define ALFRED_LEAD_TIME 100 // time, in milliseconds, to let Alfred come to the fore and accept keyboard input + const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Keymap 0: Basic layer * * ,--------------------------------------------------. ,--------------------------------------------------. - * | = | 1 | 2 | 3 | 4 | 5 | ← | | → | 6 | 7 | 8 | 9 | 0 | - | + * | = | 1 | 2 | 3 | 4 | 5 | L1 | | L1 | 6 | 7 | 8 | 9 | 0 | - | * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | ⌦ | Q | W | E | R | T | L1 | | L1 | Y | U | I | O | P | \ | + * | ⌦ | Q | W | E | R | T | ~L1 | | ~L1 | Y | U | I | O | P | \ | * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| * | ⌫ | A | S | D | F | G |------| |------| H | J | K | L |; / L2| ' / L⌘ | * |--------+------+------+------+------+------| L⌘ | | L⌘ |------+------+------+------+------+--------| * | L⇧ | Z | X | C | V | B | | | | N | M | , | . | / / ⌃| R⇧ | * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | L⌃ | L⌥ | L⌘ | ← | → | | ↑ | ↓ | [ | ] | ~L1 | + * | L⌃ | L⌥ | L⌘ | ← | → | | ↑ | ↓ | [ | ] | | * `----------------------------------' `----------------------------------' * ,-------------. ,---------------. * | `~ | '" | | ⎋ | ⌫ | @@ -32,8 +39,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { // Otherwise, it needs KC_* [BASE] = KEYMAP( // layer 0 : default // left hand - KC_EQL, KC_1, KC_2, KC_3, KC_4, KC_5, KC_LEFT, - KC_DELT, KC_Q, KC_W, KC_E, KC_R, KC_T, TG(SYMB), + KC_EQL, KC_1, KC_2, KC_3, KC_4, KC_5, TG(SYMB), + KC_DELT, KC_Q, KC_W, KC_E, KC_R, KC_T, MO(SYMB), KC_BSPC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_LGUI, KC_LCTL, KC_LALT, KC_LGUI,KC_LEFT,KC_RGHT, @@ -41,11 +48,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_PGUP, KC_SPC,KC_BSPC,KC_LALT, // right hand - KC_RGHT, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, - TG(SYMB), KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, - KC_H, KC_J, KC_K, KC_L, LT(MDIA, KC_SCLN),GUI_T(KC_QUOT), - KC_LGUI, KC_N, KC_M, KC_COMM,KC_DOT, CTL_T(KC_SLSH), KC_RSFT, - KC_UP, KC_DOWN,KC_LBRC,KC_RBRC, KC_FN1, + TG(SYMB), KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, + MO(SYMB), KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, + KC_H, KC_J, KC_K, KC_L, LT(MDIA, KC_SCLN),GUI_T(KC_QUOT), + KC_LGUI, KC_N, KC_M, KC_COMM,KC_DOT, CTL_T(KC_SLSH), KC_RSFT, + KC_UP, KC_DOWN,KC_LBRC,KC_RBRC, KC_SPC , KC_ESC, KC_BSPC, KC_PGDN, KC_LCTL, KC_TAB, KC_ENT @@ -55,9 +62,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * ,--------------------------------------------------. ,--------------------------------------------------. * | | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | F11 | * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | [ | ] | { | } | | | | | / | 7 | 8 | 9 | * | F12 | + * | | [ | ] | { | } | " | | | | / | 7 | 8 | 9 | * | F12 | * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | < | > | ( | ) | |------| |------| - | 4 | 5 | 6 | + | | + * | | < | > | ( | ) | ' |------| |------| - | 4 | 5 | 6 | + | | * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| * | | | | | | | | | | & | 1 | 2 | 3 | = | | * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' @@ -75,8 +82,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [SYMB] = KEYMAP( // left hand KC_TRNS,KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS, - KC_TRNS,KC_LBRC,KC_RBRC,KC_LCBR,KC_RCBR,KC_TRNS,KC_TRNS, - KC_TRNS,KC_LABK,KC_RABK,KC_LPRN,KC_RPRN,KC_TRNS, + KC_TRNS,KC_LBRC,KC_RBRC,KC_LCBR,KC_RCBR,KC_DQUO,KC_TRNS, + KC_TRNS,KC_LABK,KC_RABK,KC_LPRN,KC_RPRN,KC_QUOT, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS,KC_TRNS, @@ -95,20 +102,20 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Keymap 2: Media keys * * ,--------------------------------------------------. ,--------------------------------------------------. - * | | F14 | F15 | | | | | | ⌘Q | ⌘W | ⌘⇧` | ⌘` | ⌥⇧⇥ | ⌥⇥ | Power | + * | | F14 | F15 | | | | | | ⌘Q | ⌘W | ⌘⇧` | ⌘` | | | Power | * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | | | PgUp | | | | | | ⌘] | ⌥⌘↑ | ↑ | ⌥⌘↓ | | | + * | | | | PgUp |⌘S⌘⇥⌘R| Term | | | | ⌘] | ⌥⌘↑ | ↑ | ⌥⌘↓ | | | * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | Home | PgDn | End | |------| |------| ⌘[ | ← | ↓ | → | | ⏯ | + * | | |Safari| PgDn | | |------| |------| ⌘[ | ← | ↓ | → | | ⏯ | * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | | | | | | | |L⇧+Spc| Spc | ⏮ | ⏭ | | | + * | | | | | |BBEdit| | | |L⇧+Spc| Spc | ⏮ | ⏭ | | | * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' * | | | | | | |VolUp |VolDn | Mute | | | * `----------------------------------' `----------------------------------' * ,-------------. ,-------------. * | | | | | | * ,------|------|------| |------+------+------. - * | | | | | | | | + * | | | Home | | End | | | * | | |------| |------| ⌘C | ⌘V | * | | | | | ⌘X | | | * `--------------------' `--------------------' @@ -116,15 +123,15 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { // MEDIA AND MOUSE [MDIA] = KEYMAP( KC_TRNS, KC_F14 , KC_F15 , KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, /* F14 dims screen, F15 brightens */ - KC_TRNS, KC_TRNS, KC_TRNS, KC_PGUP, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_HOME, KC_PGDN, KC_END , KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_PGUP, M(SGWF), M(TMNL), KC_TRNS, + KC_TRNS, KC_TRNS, M(SAFA), KC_PGDN, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, M(BBED), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, + KC_HOME, KC_TRNS, KC_TRNS, KC_TRNS, // right hand - LGUI(KC_Q), LGUI(KC_W), LGUI(LSFT(KC_GRV)), LGUI(KC_GRV), LALT(LSFT(KC_TAB)), LALT(KC_TAB), KC_PWR, + LGUI(KC_Q), LGUI(KC_W), LGUI(LSFT(KC_GRV)), LGUI(KC_GRV), KC_TRNS, KC_TRNS, KC_PWR, KC_TRNS, LGUI(KC_RBRC), LGUI(LALT(KC_UP)), KC_UP , LGUI(LALT(KC_DOWN)), KC_TRNS, KC_TRNS, LGUI(KC_LBRC), KC_LEFT, KC_DOWN, KC_RGHT, KC_TRNS, KC_MPLY, KC_TRNS, LSFT(KC_SPC), KC_SPC , KC_MPRV, KC_MNXT, KC_TRNS, KC_TRNS, @@ -139,23 +146,62 @@ const uint16_t PROGMEM fn_actions[] = { [1] = ACTION_LAYER_TAP_TOGGLE(SYMB) // FN1 - Momentary Layer 1 (Symbols) }; -// action_get_macro() is unused — remove the “#if 0” and “#endif” lines to reenable -#if 0 const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { // MACRODOWN only works in this function switch(id) { - case 0: - if (record->event.pressed) { - register_code(KC_RSFT); - } else { - unregister_code(KC_RSFT); - } - break; + case SGWK: + if (record->event.pressed) { + return MACRO( + I(10), + D(LGUI), T(S), U(LGUI), + D(LGUI), T(TAB), U(LGUI), + END); + } + break; + case SGWF: + if (record->event.pressed) { + return MACRO( + I(10), + D(LGUI), T(S), U(LGUI), + D(LGUI), T(TAB), U(LGUI), + D(LGUI), T(R), U(LGUI), + END); + } + break; + case BBED: + if (record->event.pressed) { + return MACRO( + I(10), + D(LALT), T(SPC), U(LALT), W(ALFRED_LEAD_TIME), + T(B), T(B), T(E), T(D), T(I), T(T), + T(ENT), + END); + } + break; + case TMNL: + if (record->event.pressed) { + return MACRO( + I(10), + D(LALT), T(SPC), U(LALT), W(ALFRED_LEAD_TIME), + T(T), T(E), T(R), T(M), T(I), T(N), T(A), T(L), + T(ENT), + END); + } + break; + case SAFA: + if (record->event.pressed) { + return MACRO( + I(10), + D(LALT), T(SPC), U(LALT), W(ALFRED_LEAD_TIME), + T(S), T(A), T(F), T(A), T(R), T(I), + T(ENT), + END); + } + break; } return MACRO_NONE; }; -#endif // Runs just one time when the keyboard initializes. void matrix_init_user(void) { diff --git a/keyboard/ergodox_ez/keymaps/zweihander-osx/zweihander-osx.hex b/keyboard/ergodox_ez/keymaps/zweihander-osx/zweihander-osx.hex deleted file mode 100644 index b76c3ec8e84..00000000000 Binary files a/keyboard/ergodox_ez/keymaps/zweihander-osx/zweihander-osx.hex and /dev/null differ diff --git a/keyboard/ergodox_ez/makeallhex.sh b/keyboard/ergodox_ez/makeallhex.sh deleted file mode 100755 index 9ea899e1aee..00000000000 --- a/keyboard/ergodox_ez/makeallhex.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/bash -#a quick tool to rebuild all the hex files for the keymaps in the ./keymaps/ directory -make clean -for f in ./keymaps/* - do - MAPNAME=$(echo "$f"|sed -r 's#^./keymaps/##') - make KEYMAP=$MAPNAME - mv ergodox_ez.hex "$f/$MAPNAME.hex" -done diff --git a/keyboard/ergodox_ez/matrix.c b/keyboard/ergodox_ez/matrix.c index c4f5b179f0d..7266cca9855 100644 --- a/keyboard/ergodox_ez/matrix.c +++ b/keyboard/ergodox_ez/matrix.c @@ -50,7 +50,7 @@ static matrix_row_t matrix_debouncing[MATRIX_ROWS]; static matrix_row_t read_cols(uint8_t row); static void init_cols(void); -static void unselect_rows(); +static void unselect_rows(void); static void select_row(uint8_t row); static uint8_t mcp23018_reset_loop; diff --git a/keyboard/ergodox_ez/readme.md b/keyboard/ergodox_ez/readme.md index 97a10ff4d8f..5f0becc6cff 100644 --- a/keyboard/ergodox_ez/readme.md +++ b/keyboard/ergodox_ez/readme.md @@ -4,7 +4,7 @@ There are two main ways you could customize the ErgoDox EZ. ## The Easy Way: Use an existing firmware file and just flash it -1. Download and install the [Teensy Loader](https://www.pjrc.com/teensy/loader.html) +1. Download and install the [Teensy Loader](https://www.pjrc.com/teensy/loader.html). Some Linux distributions already provide a binary (may be called `teensy-loader-cli`), so you may prefer to use this. 2. Find a firmware file you like. You can find a few if these in the keymaps subdirectory right here. The file you need ends with .hex, and you can look at its .c counterpart (or its PNG image) to see what you'll be getting. You can also use the [Massdrop configurator](https://keyboard-configurator.massdrop.com/ext/ergodox) to create a firmware Hex file you like. 3. Download the firmware file 4. Connect the keyboard, press its Reset button (gently insert a paperclip into the hole in the top-right corner) and flash it using the Teensy loader you installed on step 1 and the firmware you downloaded. @@ -15,12 +15,12 @@ This requires a little bit of familiarity with coding. 1. Go to https://github.com/jackhumbert/qmk_firmware and read the Readme at the base of this repository, top to bottom. Then come back here :) 2. Clone the repository (download it) -3. Set up a build environment as per [the build guide](/BUILD_GUIDE.md) +3. Set up a build environment as per [the build guide](/doc/BUILD_GUIDE.md) - Using a Mac and have homebrew? just run `brew tap osx-cross/avr && brew install avr-libc` 4. Copy `keyboard/ergodox_ez/keymaps/default/keymap.c` into `keymaps/your_name/keymap.c` (for example, `keymaps/german/keymap.c`) 5. Edit this file, changing keycodes to your liking (see "Finding the keycodes you need" below). Try to edit the comments as well, so the "text graphics" represent your layout correctly. See below for more tips on sharing your work. -6. Compile your firmware by running `make clean` followed by `make KEYMAP=your_name`. For example, `make KEYMAP=german`. This will result in a hex file, which will always be called `ergodox_ez.hex`, regardless of your keymap name. -6. Flash this hex file using the [Teensy loader](https://www.pjrc.com/teensy/loader.html) as described in step 4 in the "Easy Way" above. +6. Compile your firmware by running `make keymap=your_name`. For example, `make keymap=german`. This will result in a hex file, which will be called `ergodox_ez_your_name.hex`, e.g. `ergodox_ez_german.hex`. +6. Flash this hex file using the [Teensy loader](https://www.pjrc.com/teensy/loader.html) as described in step 4 in the "Easy Way" above. If you prefer you can automatically flash the hex file after successfull build by running `make teensy keymap=your_name`. 7. Submit your work as a pull request to this repository, so others can also use it. :) See below on specifics. Good luck! :) @@ -31,7 +31,7 @@ The ErgoDox EZ firmware is open-source, so it would be wonderful to have your co 1. All work goes inside your keymap subdirectory (`keymaps/german` in this example). 2. `keymap.c` - this is your actual keymap file; please update the ASCII comments in the file so they correspond with what you did. -3. `german.hex` - a compiled version of your keymap. Commit it to the repo with `git add -f` as hex files are ignored by default. This allows people to just download your hex file and flash it without having to set up a build toolchain to make it. +3. `compiled.hex` - a compiled version of your keymap. This allows people to just download your hex file and flash it without having to set up a build toolchain to make it. 3. `readme.md` - a Readme file, which GitHub would display by default when people go to your directory. Explain what's different about your keymap, what you tweaked or how it works. No specific format to follow, just communicate what you did. :) 4. Any graphics you wish to add. This is absolutely not a must. If you feel like it, you can use [Keyboard Layout Editor](http://keyboard-layout-editor.com) to make something and grab a screenshot, but it's really not a must. If you do have graphics, your Readme can just embed the graphic as a link, just like I did with the default layout. diff --git a/keyboard/ergodox_ez/util/compile_keymap.py b/keyboard/ergodox_ez/util/compile_keymap.py new file mode 100644 index 00000000000..7076a6ecb2e --- /dev/null +++ b/keyboard/ergodox_ez/util/compile_keymap.py @@ -0,0 +1,710 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +"""Compiler for keymap.c files + +This scrip will generate a keymap.c file from a simple +markdown file with a specific layout. + +Usage: + python compile_keymap.py INPUT_PATH [OUTPUT_PATH] +""" +from __future__ import division +from __future__ import print_function +from __future__ import absolute_import +from __future__ import unicode_literals + +import os +import io +import re +import sys +import json +import unicodedata +import collections +import itertools as it + +PY2 = sys.version_info.major == 2 + +if PY2: + chr = unichr + + +KEYBOARD_LAYOUTS = { + # These map positions in the parsed layout to + # positions in the KEYMAP MATRIX + 'ergodox_ez': [ + [ 0, 1, 2, 3, 4, 5, 6], [38, 39, 40, 41, 42, 43, 44], + [ 7, 8, 9, 10, 11, 12, 13], [45, 46, 47, 48, 49, 50, 51], + [14, 15, 16, 17, 18, 19 ], [ 52, 53, 54, 55, 56, 57], + [20, 21, 22, 23, 24, 25, 26], [58, 59, 60, 61, 62, 63, 64], + [27, 28, 29, 30, 31 ], [ 65, 66, 67, 68, 69], + [ 32, 33], [70, 71 ], + [ 34], [72 ], + [ 35, 36, 37], [73, 74, 75 ], + ] +} + +ROW_INDENTS = { + 'ergodox_ez': [0, 0, 0, 0, 0, 1, 0, 0, 0, 2, 5, 0, 6, 0, 4, 0] +} + +BLANK_LAYOUTS = [ +# Compact Layout +""" +.------------------------------------.------------------------------------. +| | | | | | | | | | | | | | | +!-----+----+----+----+----+----------!-----+----+----+----+----+----+-----! +| | | | | | | | | | | | | | | +!-----+----+----+----x----x----! ! !----x----x----+----+----+-----! +| | | | | | |-----!-----! | | | | | | +!-----+----+----+----x----x----! ! !----x----x----+----+----+-----! +| | | | | | | | | | | | | | | +'-----+----+----+----+----+----------'----------+----+----+----+----+-----' + | | | | | | ! | | | | | + '------------------------' '------------------------' + .-----------. .-----------. + | | | ! | | + .-----+-----+-----! !-----+-----+-----. + ! ! | | ! | ! ! + ! ! !-----! !-----! ! ! + | | | | ! | | | + '-----------------' '-----------------' +""", + +# Wide Layout +""" +.---------------------------------------------. .---------------------------------------------. +| | | | | | | | ! | | | | | | | +!-------+-----+-----+-----+-----+-------------! !-------+-----+-----+-----+-----+-----+-------! +| | | | | | | | ! | | | | | | | +!-------+-----+-----+-----x-----x-----! ! ! !-----x-----x-----+-----+-----+-------! +| | | | | | |-------! !-------! | | | | | | +!-------+-----+-----+-----x-----x-----! ! ! !-----x-----x-----+-----+-----+-------! +| | | | | | | | ! | | | | | | | +'-------+-----+-----+-----+-----+-------------' '-------------+-----+-----+-----+-----+-------' + | | | | | | ! | | | | | + '------------------------------' '------------------------------' + .---------------. .---------------. + | | | ! | | + .-------+-------+-------! !-------+-------+-------. + ! ! | | ! | ! ! + ! ! !-------! !-------! ! ! + | | | | ! | | | + '-----------------------' '-----------------------' +""", +] + + +DEFAULT_CONFIG = { + "keymaps_includes": [ + "keymap_common.h", + ], + 'filler': "-+.'!:x", + 'separator': "|", + 'default_key_prefix': ["KC_"], +} + + +SECTIONS = [ + 'layout_config', + 'layers', +] + + +# Markdown Parsing + +ONELINE_COMMENT_RE = re.compile(r""" + ^ # comment must be at the start of the line + \s* # arbitrary whitespace + // # start of the comment + (.*) # the comment + $ # until the end of line +""", re.MULTILINE | re.VERBOSE +) + +INLINE_COMMENT_RE = re.compile(r""" + ([\,\"\[\]\{\}\d]) # anythig that might end a expression + \s+ # comment must be preceded by whitespace + // # start of the comment + \s # and succeded by whitespace + (?:[^\"\]\}\{\[]*) # the comment (except things which might be json) + $ # until the end of line +""", re.MULTILINE | re.VERBOSE) + +TRAILING_COMMA_RE = re.compile(r""" + , # the comma + (?:\s*) # arbitrary whitespace + $ # only works if the trailing comma is followed by newline + (\s*) # arbitrary whitespace + ([\]\}]) # end of an array or object +""", re.MULTILINE | re.VERBOSE) + + +def loads(raw_data): + if isinstance(raw_data, bytes): + raw_data = raw_data.decode('utf-8') + + raw_data = ONELINE_COMMENT_RE.sub(r"", raw_data) + raw_data = INLINE_COMMENT_RE.sub(r"\1", raw_data) + raw_data = TRAILING_COMMA_RE.sub(r"\1\2", raw_data) + return json.loads(raw_data) + + +def parse_config(path): + def reset_section(): + section.update({ + 'name': section.get('name', ""), + 'sub_name': "", + 'start_line': -1, + 'end_line': -1, + 'code_lines': [], + }) + + def start_section(line_index, line): + end_section() + if line.startswith("# "): + name = line[2:] + elif line.startswith("## "): + name = line[3:] + else: + name = "" + + name = name.strip().replace(" ", "_").lower() + if name in SECTIONS: + section['name'] = name + else: + section['sub_name'] = name + section['start_line'] = line_index + + def end_section(): + if section['start_line'] >= 0: + if section['name'] == 'layout_config': + config.update(loads("\n".join( + section['code_lines'] + ))) + elif section['sub_name'].startswith('layer'): + layer_name = section['sub_name'] + config['layer_lines'][layer_name] = section['code_lines'] + + reset_section() + + def amend_section(line_index, line): + section['end_line'] = line_index + section['code_lines'].append(line) + + config = DEFAULT_CONFIG.copy() + config.update({ + 'layer_lines': collections.OrderedDict(), + 'macro_ids': {'UM'}, + 'unicode_macros': {}, + }) + + section = {} + reset_section() + + with io.open(path, encoding="utf-8") as fh: + for i, line in enumerate(fh): + if line.startswith("#"): + start_section(i, line) + elif line.startswith(" "): + amend_section(i, line[4:]) + else: + # TODO: maybe parse description + pass + + end_section() + assert 'layout' in config + return config + +# header file parsing + +IF0_RE = re.compile(r""" + ^ + #if 0 + $.*? + #endif +""", re.MULTILINE | re.DOTALL | re.VERBOSE) + + +COMMENT_RE = re.compile(r""" + /\* + .*? + \*/" +""", re.MULTILINE | re.DOTALL | re.VERBOSE) + + +def read_header_file(path): + with io.open(path, encoding="utf-8") as fh: + data = fh.read() + data, _ = COMMENT_RE.subn("", data) + data, _ = IF0_RE.subn("", data) + return data + + +def regex_partial(re_str_fmt, flags): + def partial(*args, **kwargs): + re_str = re_str_fmt.format(*args, **kwargs) + return re.compile(re_str, flags) + return partial + + +KEYDEF_REP = regex_partial(r""" + #define + \s + ( + (?:{}) # the prefixes + (?:\w+) # the key name + ) # capture group end +""", re.MULTILINE | re.DOTALL | re.VERBOSE) + + +ENUM_RE = re.compile(r""" + ( + enum + \s\w+\s + \{ + .*? # the enum content + \} + ; + ) # capture group end +""", re.MULTILINE | re.DOTALL | re.VERBOSE) + + +ENUM_KEY_REP = regex_partial(r""" + ( + {} # the prefixes + \w+ # the key name + ) # capture group end +""", re.MULTILINE | re.DOTALL | re.VERBOSE) + + +def parse_keydefs(config, data): + prefix_options = "|".join(config['key_prefixes']) + keydef_re = KEYDEF_REP(prefix_options) + enum_key_re = ENUM_KEY_REP(prefix_options) + for match in keydef_re.finditer(data): + yield match.groups()[0] + + for enum_match in ENUM_RE.finditer(data): + enum = enum_match.groups()[0] + for key_match in enum_key_re.finditer(enum): + yield key_match.groups()[0] + + +def parse_valid_keys(config, out_path): + basepath = os.path.abspath(os.path.join(os.path.dirname(out_path))) + dirpaths = [] + subpaths = [] + while len(subpaths) < 6: + path = os.path.join(basepath, *subpaths) + dirpaths.append(path) + dirpaths.append(os.path.join(path, "tmk_core", "common")) + dirpaths.append(os.path.join(path, "quantum")) + subpaths.append('..') + + includes = set(config['keymaps_includes']) + includes.add("keycode.h") + + valid_keycodes = set() + for dirpath, include in it.product(dirpaths, includes): + include_path = os.path.join(dirpath, include) + if os.path.exists(include_path): + header_data = read_header_file(include_path) + valid_keycodes.update( + parse_keydefs(config, header_data) + ) + return valid_keycodes + + +# Keymap Parsing + +def iter_raw_codes(layer_lines, filler, separator): + filler_re = re.compile("[" + filler + " ]") + for line in layer_lines: + line, _ = filler_re.subn("", line.strip()) + if not line: + continue + codes = line.split(separator) + for code in codes[1:-1]: + yield code + + +def iter_indexed_codes(raw_codes, key_indexes): + key_rows = {} + key_indexes_flat = [] + + for row_index, key_indexes in enumerate(key_indexes): + for key_index in key_indexes: + key_rows[key_index] = row_index + key_indexes_flat.extend(key_indexes) + assert len(raw_codes) == len(key_indexes_flat) + for raw_code, key_index in zip(raw_codes, key_indexes_flat): + # we keep track of the row mostly for layout purposes + yield raw_code, key_index, key_rows[key_index] + + +LAYER_CHANGE_RE = re.compile(r""" + (DF|TG|MO)\(\d+\) +""", re.VERBOSE) + + +MACRO_RE = re.compile(r""" + M\(\w+\) +""", re.VERBOSE) + + +UNICODE_RE = re.compile(r""" + U[0-9A-F]{4} +""", re.VERBOSE) + + +NON_CODE = re.compile(r""" + ^[^A-Z0-9_]$ +""", re.VERBOSE) + + +def parse_uni_code(raw_code): + macro_id = "UC_" + ( + unicodedata.name(raw_code) + .replace(" ", "_") + .replace("-", "_") + ) + code = "M({})".format(macro_id) + uc_hex = "{:04X}".format(ord(raw_code)) + return code, macro_id, uc_hex + + +def parse_key_code(raw_code, key_prefixes, valid_keycodes): + if raw_code in valid_keycodes: + return raw_code + + for prefix in key_prefixes: + code = prefix + raw_code + if code in valid_keycodes: + return code + + +def parse_code(raw_code, key_prefixes, valid_keycodes): + if not raw_code: + return 'KC_TRNS', None, None + + if LAYER_CHANGE_RE.match(raw_code): + return raw_code, None, None + + if MACRO_RE.match(raw_code): + macro_id = raw_code[2:-1] + return raw_code, macro_id, None + + if UNICODE_RE.match(raw_code): + hex_code = raw_code[1:] + return parse_uni_code(chr(int(hex_code, 16))) + + if NON_CODE.match(raw_code): + return parse_uni_code(raw_code) + + code = parse_key_code(raw_code, key_prefixes, valid_keycodes) + return code, None, None + + +def parse_keymap(config, key_indexes, layer_lines, valid_keycodes): + keymap = {} + raw_codes = list(iter_raw_codes( + layer_lines, config['filler'], config['separator'] + )) + indexed_codes = iter_indexed_codes(raw_codes, key_indexes) + key_prefixes = config['key_prefixes'] + for raw_code, key_index, row_index in indexed_codes: + code, macro_id, uc_hex = parse_code( + raw_code, key_prefixes, valid_keycodes + ) + # TODO: line numbers for invalid codes + err_msg = "Could not parse key '{}' on row {}".format( + raw_code, row_index + ) + assert code is not None, err_msg + # print(repr(raw_code), repr(code), macro_id, uc_hex) + if macro_id: + config['macro_ids'].add(macro_id) + if uc_hex: + config['unicode_macros'][macro_id] = uc_hex + keymap[key_index] = (code, row_index) + return keymap + + +def parse_keymaps(config, valid_keycodes): + keymaps = collections.OrderedDict() + key_indexes = config.get( + 'key_indexes', KEYBOARD_LAYOUTS[config['layout']] + ) + # TODO: maybe validate key_indexes + + for layer_name, layer_lines, in config['layer_lines'].items(): + keymaps[layer_name] = parse_keymap( + config, key_indexes, layer_lines, valid_keycodes + ) + return keymaps + +# keymap.c output + +USERCODE = """ +// Runs just one time when the keyboard initializes. +void matrix_init_user(void) { + +}; + +// Runs constantly in the background, in a loop. +void matrix_scan_user(void) { + uint8_t layer = biton32(layer_state); + + ergodox_board_led_off(); + ergodox_right_led_1_off(); + ergodox_right_led_2_off(); + ergodox_right_led_3_off(); + switch (layer) { + case L1: + ergodox_right_led_1_on(); + break; + case L2: + ergodox_right_led_2_on(); + break; + case L3: + ergodox_right_led_3_on(); + break; + case L4: + ergodox_right_led_1_on(); + ergodox_right_led_2_on(); + break; + case L5: + ergodox_right_led_1_on(); + ergodox_right_led_3_on(); + break; + // case L6: + // ergodox_right_led_2_on(); + // ergodox_right_led_3_on(); + // break; + // case L7: + // ergodox_right_led_1_on(); + // ergodox_right_led_2_on(); + // ergodox_right_led_3_on(); + // break; + default: + ergodox_board_led_off(); + break; + } +}; +""" + +MACROCODE = """ +#define UC_MODE_WIN 0 +#define UC_MODE_LINUX 1 +#define UC_MODE_OSX 2 + +// TODO: allow default mode to be configured +static uint16_t unicode_mode = UC_MODE_WIN; + +uint16_t hextokeycode(uint8_t hex) {{ + if (hex == 0x0) {{ + return KC_P0; + }} + if (hex < 0xA) {{ + return KC_P1 + (hex - 0x1); + }} + return KC_A + (hex - 0xA); +}} + +void unicode_action_function(uint16_t hi, uint16_t lo) {{ + switch (unicode_mode) {{ + case UC_MODE_WIN: + register_code(KC_LALT); + + register_code(KC_PPLS); + unregister_code(KC_PPLS); + + register_code(hextokeycode((hi & 0xF0) >> 4)); + unregister_code(hextokeycode((hi & 0xF0) >> 4)); + register_code(hextokeycode((hi & 0x0F))); + unregister_code(hextokeycode((hi & 0x0F))); + register_code(hextokeycode((lo & 0xF0) >> 4)); + unregister_code(hextokeycode((lo & 0xF0) >> 4)); + register_code(hextokeycode((lo & 0x0F))); + unregister_code(hextokeycode((lo & 0x0F))); + + unregister_code(KC_LALT); + break; + case UC_MODE_LINUX: + register_code(KC_LCTL); + register_code(KC_LSFT); + + register_code(KC_U); + unregister_code(KC_U); + + register_code(hextokeycode((hi & 0xF0) >> 4)); + unregister_code(hextokeycode((hi & 0xF0) >> 4)); + register_code(hextokeycode((hi & 0x0F))); + unregister_code(hextokeycode((hi & 0x0F))); + register_code(hextokeycode((lo & 0xF0) >> 4)); + unregister_code(hextokeycode((lo & 0xF0) >> 4)); + register_code(hextokeycode((lo & 0x0F))); + unregister_code(hextokeycode((lo & 0x0F))); + + unregister_code(KC_LCTL); + unregister_code(KC_LSFT); + break; + case UC_MODE_OSX: + break; + }} +}} + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) {{ + if (!record->event.pressed) {{ + return MACRO_NONE; + }} + // MACRODOWN only works in this function + switch(id) {{ + case UM: + unicode_mode = (unicode_mode + 1) % 2; + break; +{macro_cases} +{unicode_macro_cases} + default: + break; + }} + return MACRO_NONE; +}}; +""" + + +UNICODE_MACRO_TEMPLATE = """ +case {macro_id}: + unicode_action_function(0x{hi:02x}, 0x{lo:02x}); + break; +""".strip() + + +def unicode_macro_cases(config): + for macro_id, uc_hex in config['unicode_macros'].items(): + hi = int(uc_hex, 16) >> 8 + lo = int(uc_hex, 16) & 0xFF + unimacro_keys = ", ".join( + "T({})".format( + "KP_" + digit if digit.isdigit() else digit + ) for digit in uc_hex + ) + yield UNICODE_MACRO_TEMPLATE.format( + macro_id=macro_id, hi=hi, lo=lo + ) + + +def iter_keymap_lines(keymap, row_indents=None): + col_widths = {} + col = 0 + # first pass, figure out the column widths + prev_row_index = None + for code, row_index in keymap.values(): + if row_index != prev_row_index: + col = 0 + if row_indents: + col = row_indents[row_index] + col_widths[col] = max(len(code), col_widths.get(col, 0)) + prev_row_index = row_index + col += 1 + + # second pass, yield the cell values + col = 0 + prev_row_index = None + for key_index in sorted(keymap): + code, row_index = keymap[key_index] + if row_index != prev_row_index: + col = 0 + yield "\n" + if row_indents: + for indent_col in range(row_indents[row_index]): + pad = " " * (col_widths[indent_col] - 4) + yield (" /*-*/" + pad) + col = row_indents[row_index] + else: + yield pad + yield " {}".format(code) + if key_index < len(keymap) - 1: + yield "," + # This will be yielded on the next iteration when + # we know that we're not at the end of a line. + pad = " " * (col_widths[col] - len(code)) + prev_row_index = row_index + col += 1 + + +def iter_keymap_parts(config, keymaps): + # includes + for include_path in config['keymaps_includes']: + yield '#include "{}"\n'.format(include_path) + + yield "\n" + + # definitions + for i, macro_id in enumerate(sorted(config['macro_ids'])): + yield "#define {} {}\n".format(macro_id, i) + + yield "\n" + + for i, layer_name in enumerate(config['layer_lines']): + yield '#define L{0:<3} {0:<5} // {1}\n'.format(i, layer_name) + + yield "\n" + + # keymaps + yield "const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {\n" + + for i, layer_name in enumerate(config['layer_lines']): + # comment + layer_lines = config['layer_lines'][layer_name] + prefixed_lines = " * " + " * ".join(layer_lines) + yield "/*\n{} */\n".format(prefixed_lines) + + # keymap codes + keymap = keymaps[layer_name] + row_indents = ROW_INDENTS.get(config['layout']) + keymap_lines = "".join(iter_keymap_lines(keymap, row_indents)) + yield "[L{0}] = KEYMAP({1}\n),\n".format(i, keymap_lines) + + yield "};\n\n" + + # no idea what this is for + yield "const uint16_t PROGMEM fn_actions[] = {};\n" + + # macros + yield MACROCODE.format( + macro_cases="", + unicode_macro_cases="\n".join(unicode_macro_cases(config)), + ) + + # TODO: dynamically create blinking lights + yield USERCODE + + +def main(argv=sys.argv[1:]): + if not argv or '-h' in argv or '--help' in argv: + print(__doc__) + return 0 + + in_path = os.path.abspath(argv[0]) + if not os.path.exists(in_path): + print("No such file '{}'".format(in_path)) + return 1 + + if len(argv) > 1: + out_path = os.path.abspath(argv[1]) + else: + dirname = os.path.dirname(in_path) + out_path = os.path.join(dirname, "keymap.c") + + config = parse_config(in_path) + valid_keys = parse_valid_keys(config, out_path) + keymaps = parse_keymaps(config, valid_keys) + + with io.open(out_path, mode="w", encoding="utf-8") as fh: + for part in iter_keymap_parts(config, keymaps): + fh.write(part) + + +if __name__ == '__main__': + sys.exit(main()) diff --git a/keyboard/ergodox_ez/util/readme.md b/keyboard/ergodox_ez/util/readme.md new file mode 100644 index 00000000000..26c5e5d99cc --- /dev/null +++ b/keyboard/ergodox_ez/util/readme.md @@ -0,0 +1,3 @@ +# ErgoDox EZ Utilities + +The Python script in this directory, by [mbarkhau](https://github.com/mbarkhau) allows you to write out a basic ErgoDox EZ keymap using Markdown notation, and then transpile it to C, which you can then compile. It's experimental, but if you're not comfortable using C, it's a nice option. diff --git a/keyboard/gh60/Makefile b/keyboard/gh60/Makefile index 4c8f9dc8ab8..730bef56c32 100644 --- a/keyboard/gh60/Makefile +++ b/keyboard/gh60/Makefile @@ -1,135 +1,112 @@ -#---------------------------------------------------------------------------- -# On command line: -# -# make all = Make software. -# -# make clean = Clean out built project files. -# -# make coff = Convert ELF to AVR COFF. -# -# make extcoff = Convert ELF to AVR Extended COFF. -# -# make program = Download the hex file to the device. -# Please customize your programmer settings(PROGRAM_CMD) -# -# make teensy = Download the hex file to the device, using teensy_loader_cli. -# (must have teensy_loader_cli installed). -# -# make dfu = Download the hex file to the device, using dfu-programmer (must -# have dfu-programmer installed). -# -# make flip = Download the hex file to the device, using Atmel FLIP (must -# have Atmel FLIP installed). -# -# make dfu-ee = Download the eeprom file to the device, using dfu-programmer -# (must have dfu-programmer installed). -# -# make flip-ee = Download the eeprom file to the device, using Atmel FLIP -# (must have Atmel FLIP installed). -# -# make debug = Start either simulavr or avarice as specified for debugging, -# with avr-gdb or avr-insight as the front end for debugging. -# -# make filename.s = Just compile filename.c into the assembler code only. -# -# make filename.i = Create a preprocessed source file for use in submitting -# bug reports to the GCC project. -# -# To rebuild project do "make clean" then "make all". -#---------------------------------------------------------------------------- - -# Target file name (without extension). -TARGET = gh60_lufa - -# Directory common source filess exist -TMK_DIR = ../../tmk_core - -# Directory keyboard dependent files exist -TARGET_DIR = . - -# project specific files -SRC = keymap_common.c \ - matrix.c \ - led.c - -ifdef KEYMAP - SRC := keymaps/$(KEYMAP).c $(SRC) -else - SRC := keymaps/poker.c $(SRC) -endif - -CONFIG_H = config.h - - -# MCU name -#MCU = at90usb1287 -MCU = atmega32u4 - -# Processor frequency. -# This will define a symbol, F_CPU, in all source code files equal to the -# processor frequency in Hz. You can then use this symbol in your source code to -# calculate timings. Do NOT tack on a 'UL' at the end, this will be done -# automatically to create a 32-bit value in your source code. -# -# This will be an integer division of F_USB below, as it is sourced by -# F_USB after it has run through any CPU prescalers. Note that this value -# does not *change* the processor frequency - it should merely be updated to -# reflect the processor speed set externally so that the code can use accurate -# software delays. -F_CPU = 16000000 - - -# -# LUFA specific -# -# Target architecture (see library "Board Types" documentation). -ARCH = AVR8 - -# Input clock frequency. -# This will define a symbol, F_USB, in all source code files equal to the -# input clock frequency (before any prescaling is performed) in Hz. This value may -# differ from F_CPU if prescaling is used on the latter, and is required as the -# raw input clock is fed directly to the PLL sections of the AVR for high speed -# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' -# at the end, this will be done automatically to create a 32-bit value in your -# source code. -# -# If no clock division is performed on the input clock inside the AVR (via the -# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. -F_USB = $(F_CPU) - -# Interrupt driven control endpoint task(+60) -OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT - - -# Boot Section Size in *bytes* -# Teensy halfKay 512 -# Teensy++ halfKay 1024 -# Atmel DFU loader 4096 -# LUFA bootloader 4096 -# USBaspLoader 2048 -OPT_DEFS += -DBOOTLOADER_SIZE=4096 - - -# Build Options -# comment out to disable the options. -# -BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE = yes # Mouse keys(+4700) -EXTRAKEY_ENABLE = yes # Audio control and System control(+450) -CONSOLE_ENABLE = yes # Console for debug(+400) -COMMAND_ENABLE = yes # Commands for debug and configuration -#SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend -NKRO_ENABLE = yes # USB Nkey Rollover - not yet supported in LUFA - - -# Optimize size but this may cause error "relocation truncated to fit" -#EXTRALDFLAGS = -Wl,--relax - -# Search Path -VPATH += $(TARGET_DIR) -VPATH += $(TMK_DIR) - -include $(TMK_DIR)/protocol/lufa.mk -include $(TMK_DIR)/common.mk -include $(TMK_DIR)/rules.mk \ No newline at end of file +#---------------------------------------------------------------------------- +# On command line: +# +# make all = Make software. +# +# make clean = Clean out built project files. +# +# make coff = Convert ELF to AVR COFF. +# +# make extcoff = Convert ELF to AVR Extended COFF. +# +# make program = Download the hex file to the device. +# Please customize your programmer settings(PROGRAM_CMD) +# +# make teensy = Download the hex file to the device, using teensy_loader_cli. +# (must have teensy_loader_cli installed). +# +# make dfu = Download the hex file to the device, using dfu-programmer (must +# have dfu-programmer installed). +# +# make flip = Download the hex file to the device, using Atmel FLIP (must +# have Atmel FLIP installed). +# +# make dfu-ee = Download the eeprom file to the device, using dfu-programmer +# (must have dfu-programmer installed). +# +# make flip-ee = Download the eeprom file to the device, using Atmel FLIP +# (must have Atmel FLIP installed). +# +# make debug = Start either simulavr or avarice as specified for debugging, +# with avr-gdb or avr-insight as the front end for debugging. +# +# make filename.s = Just compile filename.c into the assembler code only. +# +# make filename.i = Create a preprocessed source file for use in submitting +# bug reports to the GCC project. +# +# To rebuild project do "make clean" then "make all". +#---------------------------------------------------------------------------- + +# MCU name +#MCU = at90usb1287 +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Boot Section Size in *bytes* +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +OPT_DEFS += -DBOOTLOADER_SIZE=4096 + + +# Build Options +# comment out to disable the options. +# +BOOTMAGIC_ENABLE ?= yes # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700) +EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450) +# CONSOLE_ENABLE ?= yes # Console for debug(+400) +# COMMAND_ENABLE ?= yes # Commands for debug and configuration +KEYBOARD_LOCK_ENABLE ?= yes # Allow locking of keyboard via magic key +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +# SLEEP_LED_ENABLE ?= yes # Breathing sleep LED during USB suspend +NKRO_ENABLE ?= yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +# BACKLIGHT_ENABLE ?= yes # Enable keyboard backlight functionality +# MIDI_ENABLE ?= YES # MIDI controls +# UNICODE_ENABLE ?= YES # Unicode +# BLUETOOTH_ENABLE ?= yes # Enable Bluetooth with the Adafruit EZ-Key HID + + +ifndef QUANTUM_DIR + include ../../Makefile +endif + diff --git a/keyboard/gh60/Makefile.pjrc b/keyboard/gh60/Makefile.pjrc deleted file mode 100644 index 8ed73a248d1..00000000000 --- a/keyboard/gh60/Makefile.pjrc +++ /dev/null @@ -1,116 +0,0 @@ -#---------------------------------------------------------------------------- -# On command line: -# -# make all = Make software. -# -# make clean = Clean out built project files. -# -# make coff = Convert ELF to AVR COFF. -# -# make extcoff = Convert ELF to AVR Extended COFF. -# -# make program = Download the hex file to the device. -# Please customize your programmer settings(PROGRAM_CMD) -# -# make teensy = Download the hex file to the device, using teensy_loader_cli. -# (must have teensy_loader_cli installed). -# -# make dfu = Download the hex file to the device, using dfu-programmer (must -# have dfu-programmer installed). -# -# make flip = Download the hex file to the device, using Atmel FLIP (must -# have Atmel FLIP installed). -# -# make dfu-ee = Download the eeprom file to the device, using dfu-programmer -# (must have dfu-programmer installed). -# -# make flip-ee = Download the eeprom file to the device, using Atmel FLIP -# (must have Atmel FLIP installed). -# -# make debug = Start either simulavr or avarice as specified for debugging, -# with avr-gdb or avr-insight as the front end for debugging. -# -# make filename.s = Just compile filename.c into the assembler code only. -# -# make filename.i = Create a preprocessed source file for use in submitting -# bug reports to the GCC project. -# -# To rebuild project do "make clean" then "make all". -#---------------------------------------------------------------------------- - -# Target file name (without extension). -TARGET = gh60_pjrc - -# Directory common source filess exist -TMK_DIR = ../../tmk_core - -# Directory keyboard dependent files exist -TARGET_DIR = . - -# project specific files -SRC = keymap_common.c \ - matrix.c \ - led.c - -ifdef KEYMAP - SRC := keymaps/$(KEYMAP).c $(SRC) -else - SRC := keymaps/poker.c $(SRC) -endif - -CONFIG_H = config.h - - -# MCU name, you MUST set this to match the board you are using -# type "make clean" after changing this, so all files will be rebuilt -MCU = atmega32u4 -#MCU = at90usb1286 - - -# Processor frequency. -# Normally the first thing your program should do is set the clock prescaler, -# so your program will run at the correct speed. You should also set this -# variable to same clock speed. The _delay_ms() macro uses this, and many -# examples use this variable to calculate timings. Do not add a "UL" here. -F_CPU = 16000000 - - -# Boot Section Size in *bytes* -# Teensy halfKay 512 -# Atmel DFU loader 4096 -# LUFA bootloader 4096 -OPT_DEFS += -DBOOTLOADER_SIZE=4096 - - -# Build Options -# comment out to disable the options. -# -BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE = yes # Mouse keys(+5000) -EXTRAKEY_ENABLE = yes # Audio control and System control(+600) -CONSOLE_ENABLE = yes # Console for debug -COMMAND_ENABLE = yes # Commands for debug and configuration -SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend -NKRO_ENABLE = yes # USB Nkey Rollover(+500) -#PS2_MOUSE_ENABLE = yes # PS/2 mouse(TrackPoint) support - - -# Search Path -VPATH += $(TARGET_DIR) -VPATH += $(TMK_DIR) - -include $(TMK_DIR)/protocol/pjrc.mk -include $(TMK_DIR)/common.mk -include $(TMK_DIR)/rules.mk - -plain: OPT_DEFS += -DKEYMAP_PLAIN -plain: all - -poker: OPT_DEFS += -DKEYMAP_POKER -poker: all - -poker_set: OPT_DEFS += -DKEYMAP_POKER_SET -poker_set: all - -poker_bit: OPT_DEFS += -DKEYMAP_POKER_BIT -poker_bit: all diff --git a/keyboard/gh60/README.md b/keyboard/gh60/README.md index 41a757ea3ae..bf209be8c6a 100644 --- a/keyboard/gh60/README.md +++ b/keyboard/gh60/README.md @@ -1,141 +1,60 @@ -GH60 keyboard firmware -====================== -DIY compact keyboard designed and run by komar007 and Geekhack community. - -- Both Rev.A and Rev.B PCB are supported by one firmware binary(issue #64) - -## GH60 Resources -- [KOMAR's project page](http://blog.komar.be/projects/gh60-programmable-keyboard/) -- [Prototyping](http://geekhack.org/index.php?topic=34959.0) -- [Rev.A PCB test](http://geekhack.org/index.php?topic=37570.0) -- [Rev.B PCB test](http://geekhack.org/index.php?topic=50685.0) -- [Group buy](http://geekhack.org/index.php?topic=41464.0) - - -## Build -Move to this directory then just run `make` like: - - $ make - -Use `make -f Makefile.pjrc` if you want to use PJRC stack but I find no reason to do so now. - - -## Keymap -Several version of keymap are available in advance but you are recommended to define your favorite layout yourself. To define your own keymap create file named `.c` in the keymaps folder, and see keymap document(you can find in top README.md) and existent keymap files. - -To build firmware binary hex file with a certain keymap just do `make` with `KEYMAP` option like: - - $ make KEYMAP=[poker|poker_set|poker_bit|plain|hasu|spacefn|hhkb|] - - -### 1 Poker -[poker.c](keymaps/poker.c) emulates original Poker layers -while both [poker_bit.c](keymaps/poker_bit.c) and [poker_set.c](keymaps/poker_set.c) implement the same layout in different ways and they fix a minor issue of original Poker and enhance arrow keys. - - Fn + Esc = ` - Fn + {left, down, up, right} = {home, pgdown, pgup, end} - -#### 1.0 Default layer - ,-----------------------------------------------------------. - | `| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Backsp | - |-----------------------------------------------------------| - |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \| - |-----------------------------------------------------------| - |Caps | A| S| D| F| G| H| J| K| L| ;| '|Return | - |-----------------------------------------------------------| - |Shift | Z| X| C| V| B| N| M| ,| .| /|Shift | - |-----------------------------------------------------------| - |Ctrl|Gui |Alt | Space |Fn |Gui |App |Ctrl| - `-----------------------------------------------------------' -#### 1.1 Poker Fn layer - ,-----------------------------------------------------------. - |Esc| F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12| | - |-----------------------------------------------------------| - | |FnQ| Up| | | | | | |Cal| |Hom|Ins| | - |-----------------------------------------------------------| - | |Lef|Dow|Rig| | |Psc|Slk|Pau| |Tsk|End| | - |-----------------------------------------------------------| - | |Del| |Web|Mut|VoU|VoD| |PgU|PgD|Del| Up | - |-----------------------------------------------------------| - | | | | FnS |Fn |Left|Down|Righ| - `-----------------------------------------------------------' - - -### 2. Plain -Without any Fn layer this will be useful if you want to use key remapping tool like AHK on host. -See [plain.c](keymaps/plain.c) for detail. - -#### 1.0 Plain Default layer - ,-----------------------------------------------------------. - |Esc| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Backsp | - |-----------------------------------------------------------| - |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \| - |-----------------------------------------------------------| - |Caps | A| S| D| F| G| H| J| K| L| ;| '|Return | - |-----------------------------------------------------------| - |Shift | Z| X| C| V| B| N| M| ,| .| /|Shift | - |-----------------------------------------------------------| - |Ctrl|Gui |Alt | Space |Alt |Gui |App |Ctrl| - `-----------------------------------------------------------' - - -### 3. Hasu -This is my favorite keymap with HHKB Fn, Vi cursor and Mousekey layer. See [hasu.c](keymaps/hasu.c) for detail. - - -### 4. SpaceFN -This layout proposed by spiceBar uses space bar to change layer with using Dual role key technique. See [spacefn.c](keymaps/spacefn.c) and [SpaceFN discussion](http://geekhack.org/index.php?topic=51069.0). - -#### 4.0 Default layer - ,-----------------------------------------------------------. - |Esc| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Backsp | - |-----------------------------------------------------------| - |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \| - |-----------------------------------------------------------| - |Caps | A| S| D| F| G| H| J| K| L| ;| '|Return | - |-----------------------------------------------------------| - |Shift | Z| X| C| V| B| N| M| ,| .| /|Shift | - |-----------------------------------------------------------| - |Ctrl|Gui |Alt | Space/Fn |Alt |Gui |App |Ctrl| - `-----------------------------------------------------------' -#### 4.1 SpaceFN layer - ,-----------------------------------------------------------. - |` | F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12|Delete | - |-----------------------------------------------------------| - | | | | | | | |Hom|Up |End|Psc|Slk|Pau|Ins | - |-----------------------------------------------------------| - | | | | | | |PgU|Lef|Dow|Rig| | | | - |-----------------------------------------------------------| - | | | | | |Spc|PgD|` |~ | | | | - |-----------------------------------------------------------| - | | | | Fn | | | | | - `-----------------------------------------------------------' - - -### 5. HHKB -[hhkb.c](keymaps/hhkb.c) emulates original HHKB layers. -#### 5.0: Default layer - ,-----------------------------------------------------------. - |Esc| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =| \| `| - |-----------------------------------------------------------| - |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]|Bspc | - |-----------------------------------------------------------| - |Ctrl | A| S| D| F| G| H| J| K| L|Fn3| '|Return | - |-----------------------------------------------------------| - |Shift | Z| X| C| V| B| N| M| ,| .| /|Shift |Fn | - |-----------------------------------------------------------| - | |Gui |Alt | Space | |Alt |Gui | | - `-----------------------------------------------------------' -#### 5.1: HHKB Fn layer - ,-----------------------------------------------------------. - |Pwr| F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12|Ins|Del| - |-----------------------------------------------------------| - |Caps | | | | | | | |Psc|Slk|Pus|Up | | | - |-----------------------------------------------------------| - | |VoD|VoU|Mut|Ejc| | *| /|Hom|PgU|Lef|Rig|Enter | - |-----------------------------------------------------------| - | | | | | | | +| -|End|PgD|Dow| | | - |-----------------------------------------------------------| - | | | | | | | | | - `-----------------------------------------------------------' - +## gh60 Rev C keyboard firmware + +![gh60 Rev C PCB](gh60revc.jpg) + + /* Column pin configuration + * col: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 + * pin: F0 F1 E6 C7 C6 B6 D4 B1 B7 B5 B4 D7 D6 B3 (Rev.C) + */ + + /* Row pin configuration + * row: 0 1 2 3 4 + * pin: D0 D1 D2 D3 D5 + */ + + GPIO pads + 0 F7 WASD LEDs + 1 F6 ESC LED + 2 F5 FN LED + 3 F4 POKER Arrow LEDs + + B2 Capslock LED + B0 not connected + +Functions to controls LED clusters + + gh60_caps_led_on() + gh60_poker_leds_on() + gh60_fn_led_on() + gh60_esc_led_on() + gh60_wasd_leds_on() + + gh60_caps_led_off() + gh60_poker_leds_off() + gh60_fn_led_off() + gh60_esc_led_off() + gh60_wasd_leds_off() + +====================== + +## Quantum MK Firmware + +For the full Quantum feature list, see [the parent README.md](/README.md). + +## Building + +Download or clone the whole firmware and navigate to the keyboard/gh60_rev_c folder. Once your dev env is setup, you'll be able to type `make` to generate your .hex - you can then use the Teensy Loader to program your .hex file. + +Depending on which keymap you would like to use, you will have to compile slightly differently. + +### Default +To build with the default keymap, simply run `make`. + +### Other Keymaps +Several version of keymap are available in advance but you are recommended to define your favorite layout yourself. To define your own keymap create file named `.c` in the keymaps folder, and see keymap document (you can find in top README.md) and existent keymap files. + +To build the firmware binary hex file with a keymap just do `make` with `KEYMAP` option like: +``` +$ make KEYMAP=[default|jack|] +``` +Keymaps follow the format **__\.c__** and are stored in the `keymaps` folder. diff --git a/keyboard/gh60/config.h b/keyboard/gh60/config.h index e9c0f4366dc..4813c4e786f 100644 --- a/keyboard/gh60/config.h +++ b/keyboard/gh60/config.h @@ -1,70 +1,161 @@ -/* -Copyright 2012 Jun Wako - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#ifndef CONFIG_H -#define CONFIG_H - - -/* USB Device descriptor parameter */ -#define VENDOR_ID 0xFEED -#define PRODUCT_ID 0x6060 -#define DEVICE_VER 0x0001 -#define MANUFACTURER geekhack -#define PRODUCT GH60 -#define DESCRIPTION t.m.k. keyboard firmware for GH60 - -/* key matrix size */ -#define MATRIX_ROWS 5 -#define MATRIX_COLS 14 - -/* define if matrix has ghost */ -//#define MATRIX_HAS_GHOST - -/* Set 0 if debouncing isn't needed */ -#define DEBOUNCE 5 - -/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ -#define LOCKING_SUPPORT_ENABLE -/* Locking resynchronize hack */ -#define LOCKING_RESYNC_ENABLE - -/* key combination for command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - - - -/* - * Feature disable options - * These options are also useful to firmware size reduction. - */ - -/* disable debug print */ -//#define NO_DEBUG - -/* disable print */ -//#define NO_PRINT - -/* disable action features */ -//#define NO_ACTION_LAYER -//#define NO_ACTION_TAPPING -//#define NO_ACTION_ONESHOT -//#define NO_ACTION_MACRO -//#define NO_ACTION_FUNCTION - -#endif +/* +Copyright 2012 Jun Wako + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#ifndef CONFIG_H +#define CONFIG_H + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x6060 +#define DEVICE_VER 0x0001 +#define MANUFACTURER geekhack +#define PRODUCT GH60 +#define DESCRIPTION t.m.k. keyboard firmware for GH60 + +/* key matrix size */ +#define MATRIX_ROWS 5 +#define MATRIX_COLS 14 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ + #define MATRIX_ROW_PINS { D0, D1, D2, D3, D5 } +// Rev A +// #define MATRIX_COL_PINS { F0, F1, E6, C7, C6, B6, D4, B1, B0, B5, B4, D7, D6, B3 } +// Rev B/C + #define MATRIX_COL_PINS { F0, F1, E6, C7, C6, B6, D4, B1, B7, B5, B4, D7, D6, B3 } +#define UNUSED_PINS + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION COL2ROW + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCING_DELAY 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ +#define BACKLIGHT_LEVELS 3 + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +/* + * Force NKRO + * + * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved + * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the + * makefile for this to work.) + * + * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N) + * until the next keyboard reset. + * + * NKRO may prevent your keystrokes from being detected in the BIOS, but it is + * fully operational during normal computer usage. + * + * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N) + * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by + * bootmagic, NKRO mode will always be enabled until it is toggled again during a + * power-up. + * + */ +//#define FORCE_NKRO + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + +/* key combination for magic key command */ +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) + +/* control how magic key switches layers */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false + +/* override magic key keymap */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM +//#define MAGIC_KEY_HELP1 H +//#define MAGIC_KEY_HELP2 SLASH +//#define MAGIC_KEY_DEBUG D +//#define MAGIC_KEY_DEBUG_MATRIX X +//#define MAGIC_KEY_DEBUG_KBD K +//#define MAGIC_KEY_DEBUG_MOUSE M +//#define MAGIC_KEY_VERSION V +//#define MAGIC_KEY_STATUS S +//#define MAGIC_KEY_CONSOLE C +//#define MAGIC_KEY_LAYER0_ALT1 ESC +//#define MAGIC_KEY_LAYER0_ALT2 GRAVE +//#define MAGIC_KEY_LAYER0 0 +//#define MAGIC_KEY_LAYER1 1 +//#define MAGIC_KEY_LAYER2 2 +//#define MAGIC_KEY_LAYER3 3 +//#define MAGIC_KEY_LAYER4 4 +//#define MAGIC_KEY_LAYER5 5 +//#define MAGIC_KEY_LAYER6 6 +//#define MAGIC_KEY_LAYER7 7 +//#define MAGIC_KEY_LAYER8 8 +//#define MAGIC_KEY_LAYER9 9 +//#define MAGIC_KEY_BOOTLOADER PAUSE +//#define MAGIC_KEY_LOCK CAPS +//#define MAGIC_KEY_EEPROM E +//#define MAGIC_KEY_NKRO N +//#define MAGIC_KEY_SLEEP_LED Z + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +/* disable debug print */ +//#define NO_DEBUG + +/* disable print */ +//#define NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION + +#endif diff --git a/keyboard/gh60_rev_c/gh60.c b/keyboard/gh60/gh60.c similarity index 100% rename from keyboard/gh60_rev_c/gh60.c rename to keyboard/gh60/gh60.c diff --git a/keyboard/gh60_rev_c/gh60.h b/keyboard/gh60/gh60.h similarity index 100% rename from keyboard/gh60_rev_c/gh60.h rename to keyboard/gh60/gh60.h diff --git a/keyboard/gh60_rev_c/gh60revc.jpg b/keyboard/gh60/gh60revc.jpg similarity index 100% rename from keyboard/gh60_rev_c/gh60revc.jpg rename to keyboard/gh60/gh60revc.jpg diff --git a/keyboard/gh60/keymap_common.h b/keyboard/gh60/keymap_common.h deleted file mode 100644 index 896badd7481..00000000000 --- a/keyboard/gh60/keymap_common.h +++ /dev/null @@ -1,84 +0,0 @@ -/* -Copyright 2012,2013 Jun Wako - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ -#ifndef KEYMAP_COMMON_H -#define KEYMAP_COMMON_H - -#include -#include -#include -#include "keycode.h" -#include "action.h" -#include "action_macro.h" -#include "report.h" -#include "host.h" -#include "print.h" -#include "debug.h" -#include "keymap.h" - - -extern const uint8_t keymaps[][MATRIX_ROWS][MATRIX_COLS]; -extern const uint16_t fn_actions[]; - - -/* GH60 keymap definition macro - * K2C, K31 and K3C are extra keys for ISO - */ -#define KEYMAP( \ - K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, \ - K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \ - K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, \ - K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, \ - K40, K41, K42, K45, K49, K4A, K4B, K4C, K4D \ -) { \ - { KC_##K00, KC_##K01, KC_##K02, KC_##K03, KC_##K04, KC_##K05, KC_##K06, KC_##K07, KC_##K08, KC_##K09, KC_##K0A, KC_##K0B, KC_##K0C, KC_##K0D }, \ - { KC_##K10, KC_##K11, KC_##K12, KC_##K13, KC_##K14, KC_##K15, KC_##K16, KC_##K17, KC_##K18, KC_##K19, KC_##K1A, KC_##K1B, KC_##K1C, KC_##K1D }, \ - { KC_##K20, KC_##K21, KC_##K22, KC_##K23, KC_##K24, KC_##K25, KC_##K26, KC_##K27, KC_##K28, KC_##K29, KC_##K2A, KC_##K2B, KC_##K2C, KC_##K2D }, \ - { KC_##K30, KC_##K31, KC_##K32, KC_##K33, KC_##K34, KC_##K35, KC_##K36, KC_##K37, KC_##K38, KC_##K39, KC_##K3A, KC_##K3B, KC_##K3C, KC_##K3D }, \ - { KC_##K40, KC_##K41, KC_##K42, KC_NO, KC_NO, KC_##K45, KC_NO, KC_NO, KC_NO, KC_##K49, KC_##K4A, KC_##K4B, KC_##K4C, KC_##K4D } \ -} - -/* ANSI valiant. No extra keys for ISO */ -#define KEYMAP_ANSI( \ - K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, \ - K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \ - K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2D, \ - K30, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3D, \ - K40, K41, K42, K45, K4A, K4B, K4C, K4D \ -) KEYMAP( \ - K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, \ - K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \ - K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, NO, K2D, \ - K30, NO, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, NO, K3D, \ - K40, K41, K42, K45, NO, K4A, K4B, K4C, K4D \ -) - - -#define KEYMAP_HHKB( \ - K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K49,\ - K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \ - K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2D, \ - K30, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3D, K3C, \ - K40, K41, K42, K45, K4A, K4B, K4C, K4D \ -) KEYMAP( \ - K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, \ - K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \ - K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, NO, K2D, \ - K30, NO, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, \ - K40, K41, K42, K45, K49, K4A, K4B, K4C, K4D \ -) - -#endif diff --git a/keyboard/gh60/keymaps/default/compiled.hex b/keyboard/gh60/keymaps/default/compiled.hex new file mode 100644 index 00000000000..5c253e970ad Binary files /dev/null and b/keyboard/gh60/keymaps/default/compiled.hex differ diff --git a/keyboard/gh60_rev_c/keymaps/default.c b/keyboard/gh60/keymaps/default/keymap.c similarity index 100% rename from keyboard/gh60_rev_c/keymaps/default.c rename to keyboard/gh60/keymaps/default/keymap.c diff --git a/keyboard/gh60/keymaps/hasu.c b/keyboard/gh60/keymaps/hasu.c deleted file mode 100644 index e6af28585b9..00000000000 --- a/keyboard/gh60/keymaps/hasu.c +++ /dev/null @@ -1,145 +0,0 @@ -#include "keymap_common.h" - -/* - * Hasu - */ -const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - /* Keymap 0: Default Layer - * ,-----------------------------------------------------------. - * |Esc| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Backsp | - * |-----------------------------------------------------------| - * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \| - * |-----------------------------------------------------------| - * |Caps | A| S| D| F| G| H| J| K| L|Fn3| '|Return | - * |-----------------------------------------------------------| - * |Shift | Z| X| C| V| B| N| M| ,| .|Fn2|Shift | - * |-----------------------------------------------------------| - * |Ctrl|Gui |Alt | Space |Alt |Fn4 |Fn4 |Fn1 | - * `-----------------------------------------------------------' - */ - KEYMAP_ANSI( - ESC, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, BSPC, \ - TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC,RBRC,BSLS, \ - LCTL,A, S, D, F, G, H, J, K, L, FN2, QUOT, ENT, \ - LSFT,Z, X, C, V, B, N, M, COMM,DOT, FN1, FN9, \ - LCTL,LGUI,LALT, SPC, RALT,FN3, FN3, FN0), - /* Keymap 1: colemak */ - KEYMAP_ANSI( - GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, BSPC, \ - TAB, Q, W, F, P, G, J, L, U, Y, SCLN,LBRC,RBRC,BSLS, \ - BSPC,A, R, S, T, D, H, N, E, I, O, QUOT, ENT, \ - LSFT,Z, X, C, V, B, K, M, COMM,DOT, SLSH, RSFT, \ - LCTL,LGUI,LALT, SPC, RALT,RGUI,APP, FN0), - /* Keymap 2: dvorak */ - KEYMAP_ANSI( - GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, LBRC,RBRC,BSPC, \ - TAB, QUOT,COMM,DOT, P, Y, F, G, C, R, L, SLSH,EQL, BSLS, \ - CAPS,A, O, E, U, I, D, H, T, N, S, MINS, ENT, \ - LSFT,SCLN,Q, J, K, X, B, M, W, V, Z, RSFT, \ - LCTL,LGUI,LALT, SPC, RALT,RGUI,APP, FN0), - /* Keymap 3: workman */ - KEYMAP_ANSI( - GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, BSPC, \ - TAB, Q, D, R, W, B, J, F, U, P, SCLN,LBRC,RBRC,BSLS, \ - BSPC,A, S, H, T, G, Y, N, E, O, I, QUOT, ENT, \ - LSFT,Z, X, M, C, V, K, L, COMM,DOT, SLSH, RSFT, \ - LCTL,LGUI,LALT, SPC, RALT,RGUI,APP, FN0), - - /* Overlay 4: HHKB mode - * ,-----------------------------------------------------------. - * |Esc| F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12|Delete | - * |-----------------------------------------------------------| - * |Caps | | | | | | | |Psc|Slk|Pus|Up | |Inser| - * |-----------------------------------------------------------| - * |Contro|VoD|VoU|Mut| | | *| /|Hom|PgU|Lef|Rig|Enter | - * |-----------------------------------------------------------| - * |Shift | | | | | | +| -|End|PgD|Dow|Shift | - * |-----------------------------------------------------------| - * |Ctrl|Gui |Alt | Space |Alt |Gui |App | | - * `-----------------------------------------------------------' - */ - KEYMAP_ANSI( - GRV, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, DEL, \ - CAPS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,PSCR,SLCK,PAUS,UP, TRNS,INS, \ - LCTL,VOLD,VOLU,MUTE,TRNS,TRNS,PAST,PSLS,HOME,PGUP,LEFT,RGHT, ENT, \ - LSFT,TRNS,TRNS,TRNS,TRNS,TRNS,PPLS,PMNS,END, PGDN,DOWN, RSFT, \ - LCTL,LGUI,LALT, SPC, RALT,RGUI,FN4, TRNS), - /* Overlay 5: Vi mode (Slash) - * ,-----------------------------------------------------------. - * | `| F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12|Backsp | - * |-----------------------------------------------------------| - * |Tab |Hom|PgD|Up |PgU|End|Hom|PgD|PgU|End| | | | | - * |-----------------------------------------------------------| - * |Contro| |Lef|Dow|Rig| |Lef|Dow|Up |Rig| | |Return | - * |-----------------------------------------------------------| - * |Shift | | | | | |Hom|PgD|PgU|End| |Shift | - * |-----------------------------------------------------------| - * |Ctrl|Gui |Alt | Space |Alt |Gui |App |Ctrl| - * `-----------------------------------------------------------' - */ - KEYMAP_ANSI( - GRV, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, BSPC, \ - TAB, HOME,PGDN,UP, PGUP,END, HOME,PGDN,PGUP,END, TRNS,TRNS,TRNS,TRNS, \ - LCTL,TRNS,LEFT,DOWN,RGHT,TRNS,LEFT,DOWN,UP, RGHT,TRNS,TRNS, ENT, \ - LSFT,TRNS,TRNS,TRNS,TRNS,TRNS,HOME,PGDN,PGUP,END, TRNS, RSFT, \ - LCTL,LGUI,LALT, SPC, RALT,RGUI,APP, RCTL), - /* Overlay 6: Mouse mode (Semicolon/App) - * ,-----------------------------------------------------------. - * | `| F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12|Backsp | - * |-----------------------------------------------------------| - * |Tab | | | | | |MwL|MwD|MwU|MwR| | | | | - * |-----------------------------------------------------------| - * |Contro| |Ac0|Ac1|Ac1| |McL|McD|McU|McR| | |Return | - * |-----------------------------------------------------------| - * |Shift | | | | |Mb3|Mb2|Mb1|Mb4|Mb5| |Shift | - * |-----------------------------------------------------------| - * |Ctrl|Gui |Alt | Space | | | | | - * `-----------------------------------------------------------' - * Mc: Mouse Cursor / Mb: Mouse Button / Mw: Mouse Wheel - */ - KEYMAP_ANSI( - GRV, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, BSPC, \ - TAB, TRNS,TRNS,TRNS,TRNS,TRNS,WH_L,WH_D,WH_U,WH_R,TRNS,TRNS,TRNS,TRNS, \ - LCTL,TRNS,ACL0,ACL1,ACL2,TRNS,MS_L,MS_D,MS_U,MS_R,TRNS,TRNS, ENT, \ - LSFT,TRNS,TRNS,TRNS,TRNS,BTN3,BTN2,BTN1,BTN4,BTN5,TRNS, RSFT, \ - LCTL,LGUI,LALT, BTN1, TRNS,TRNS,TRNS,RCTL), - /* Overlay 7: Layout selector - * ,-----------------------------------------------------------. - * | Lq| Lc| Ld| Lw| | | | | | | | | | | - * |-----------------------------------------------------------| - * | |Lq |Lw | | | | | | | | | | | | - * |-----------------------------------------------------------| - * | | | |Ld | | | | | | | | | | - * |-----------------------------------------------------------| - * | | | |Lc | | | | | | | | | - * |-----------------------------------------------------------| - * | | | | | | | | | - * `-----------------------------------------------------------' - * Lq: set Qwerty layout - * Lc: set Colemak layout - * Ld: set Dvorak layout - * Lw: set Workman layout - */ - KEYMAP_ANSI( - FN5, FN6, FN7, FN8, TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, \ - TRNS,FN5, FN8, TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, \ - TRNS,TRNS,TRNS,FN7, TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, TRNS, \ - TRNS,TRNS,TRNS,FN6, TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, TRNS, \ - TRNS,TRNS,TRNS, TRNS, TRNS,TRNS,TRNS,TRNS), -}; - -/* - * Fn action definition - */ -const uint16_t PROGMEM fn_actions[] = { - [0] = ACTION_LAYER_MOMENTARY(4), - [1] = ACTION_LAYER_TAP_KEY(5, KC_SLASH), - [2] = ACTION_LAYER_TAP_KEY(6, KC_SCLN), - [3] = ACTION_LAYER_MOMENTARY(6), - [4] = ACTION_LAYER_MOMENTARY(7), // to Layout selector - [5] = ACTION_DEFAULT_LAYER_SET(0), // set qwerty layout - [6] = ACTION_DEFAULT_LAYER_SET(1), // set colemak layout - [7] = ACTION_DEFAULT_LAYER_SET(2), // set dvorak layout - [8] = ACTION_DEFAULT_LAYER_SET(3), // set workman layout - [9] = ACTION_MODS_TAP_KEY(MOD_RSFT, KC_GRV), -}; diff --git a/keyboard/gh60/keymaps/hhkb.c b/keyboard/gh60/keymaps/hhkb.c deleted file mode 100644 index ce1b816ecb0..00000000000 --- a/keyboard/gh60/keymaps/hhkb.c +++ /dev/null @@ -1,52 +0,0 @@ -#include "keymap_common.h" - -/* - * HHKB Layout - */ -const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - /* 0: Default layer - * ,-----------------------------------------------------------. - * |Esc| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =| \| `| - * |-----------------------------------------------------------| - * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]|Bspc | - * |-----------------------------------------------------------| - * |Ctrl | A| S| D| F| G| H| J| K| L|Fn3| '|Return | - * |-----------------------------------------------------------| - * |Shift | Z| X| C| V| B| N| M| ,| .| /|Shift |Fn | - * |-----------------------------------------------------------| - * | |Gui |Alt | Space | |Alt |Gui | | - * `-----------------------------------------------------------' - */ - KEYMAP_HHKB( - ESC, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, BSLS, GRV, \ - TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC,RBRC,BSPC, \ - LCTL,A, S, D, F, G, H, J, K, L, SCLN,QUOT, ENT, \ - LSFT,Z, X, C, V, B, N, M, COMM,DOT, SLSH, RSFT,FN0, \ - NO, LGUI,LALT, SPC, NO, RALT,RGUI,NO), - /* 1: HHKB Fn layer - * ,-----------------------------------------------------------. - * |Pwr| F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12|Ins|Del| - * |-----------------------------------------------------------| - * |Caps | | | | | | | |Psc|Slk|Pus|Up | | | - * |-----------------------------------------------------------| - * | |VoD|VoU|Mut|Ejc| | *| /|Hom|PgU|Lef|Rig|Enter | - * |-----------------------------------------------------------| - * | | | | | | | +| -|End|PgD|Dow| | | - * |-----------------------------------------------------------| - * | | | | | | | | | - * `-----------------------------------------------------------' - */ - KEYMAP_HHKB( - PWR, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, INS, DEL, \ - CAPS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,PSCR,SLCK,PAUS,UP, TRNS,TRNS, \ - TRNS,VOLD,VOLU,MUTE,EJCT,TRNS,PAST,PSLS,HOME,PGUP,LEFT,RGHT, PENT, \ - TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,PPLS,PMNS,END, PGDN,DOWN, TRNS,TRNS, \ - TRNS,TRNS,TRNS, TRNS, TRNS,TRNS,TRNS,TRNS), -}; - -/* - * Fn action definition - */ -const uint16_t PROGMEM fn_actions[] = { - [0] = ACTION_LAYER_MOMENTARY(1), -}; diff --git a/keyboard/gh60/keymaps/plain.c b/keyboard/gh60/keymaps/plain.c deleted file mode 100644 index 3138c18077f..00000000000 --- a/keyboard/gh60/keymaps/plain.c +++ /dev/null @@ -1,11 +0,0 @@ -#include "keymap_common.h" - -const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - /* 0: qwerty */ - KEYMAP(ESC, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, BSPC, \ - TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC,RBRC,BSLS, \ - CAPS,A, S, D, F, G, H, J, K, L, SCLN,QUOT,NO, ENT, \ - LSFT,NO, Z, X, C, V, B, N, M, COMM,DOT, SLSH,NO, RSFT, \ - LCTL,LGUI,LALT, SPC, RALT,RGUI,APP, RCTL), -}; -const uint16_t PROGMEM fn_actions[] = {}; diff --git a/keyboard/gh60/keymaps/poker.c b/keyboard/gh60/keymaps/poker.c deleted file mode 100644 index 7a612ee44d0..00000000000 --- a/keyboard/gh60/keymaps/poker.c +++ /dev/null @@ -1,104 +0,0 @@ -#include "keymap_common.h" - -const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - /* 0: qwerty */ - KEYMAP_ANSI( - GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, BSPC, \ - TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC,RBRC,BSLS, \ - CAPS,A, S, D, F, G, H, J, K, L, SCLN,QUOT, ENT, \ - LSFT,Z, X, C, V, B, N, M, COMM,DOT, SLSH, RSFT, \ - LCTL,LGUI,LALT, SPC, FN0, RGUI,APP, RCTL), - /* 1: colemak */ - KEYMAP_ANSI( - GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, BSPC, \ - TAB, Q, W, F, P, G, J, L, U, Y, SCLN,LBRC,RBRC,BSLS, \ - BSPC,A, R, S, T, D, H, N, E, I, O, QUOT, ENT, \ - LSFT,Z, X, C, V, B, K, M, COMM,DOT, SLSH, RSFT, \ - LCTL,LGUI,LALT, SPC, FN0, RGUI,APP, RCTL), - /* 2: dvorak */ - KEYMAP_ANSI( - GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, LBRC,RBRC,BSPC, \ - TAB, QUOT,COMM,DOT, P, Y, F, G, C, R, L, SLSH,EQL, BSLS, \ - CAPS,A, O, E, U, I, D, H, T, N, S, MINS, ENT, \ - LSFT,SCLN,Q, J, K, X, B, M, W, V, Z, RSFT, \ - LCTL,LGUI,LALT, SPC, FN0, RGUI,APP, RCTL), - /* 3: workman */ - KEYMAP_ANSI( - GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, BSPC, \ - TAB, Q, D, R, W, B, J, F, U, P, SCLN,LBRC,RBRC,BSLS, \ - BSPC,A, S, H, T, G, Y, N, E, O, I, QUOT, ENT, \ - LSFT,Z, X, M, C, V, K, L, COMM,DOT, SLSH, RSFT, \ - LCTL,LGUI,LALT, SPC, FN0, RGUI,APP, RCTL), - /* 4: Poker with Arrow */ - KEYMAP_ANSI( - TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, \ - TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, \ - TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, TRNS, \ - TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, UP, \ - TRNS,TRNS,TRNS, TRNS, TRNS,LEFT,DOWN,RGHT), - /* 5: Poker with Esc */ - KEYMAP_ANSI( - ESC, TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, \ - TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, \ - TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, TRNS, \ - TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, TRNS, \ - TRNS,TRNS,TRNS, TRNS, TRNS,TRNS,TRNS,TRNS), - /* 6: Poker Fn - * ,-----------------------------------------------------------. - * |Esc| F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12| | - * |-----------------------------------------------------------| - * | |FnQ| Up| | | | | | |Cal| |Hom|Ins|FnL | - * |-----------------------------------------------------------| - * | |Lef|Dow|Rig| | |Psc|Slk|Pau| |Tsk|End| | - * |-----------------------------------------------------------| - * | |Del| |Web|Mut|VoU|VoD| |PgU|PgD|Del| | - * |-----------------------------------------------------------| - * | | | | FnS | | | | | - * `-----------------------------------------------------------' - * Fn: to Fn overlay - * FnL: to Layout selector overaly - * FnQ: toggle Esc overlay - * FnS: toggle Arrow overlay - */ - KEYMAP_ANSI( - ESC, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, TRNS, \ - TRNS,FN2, UP, TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,CALC,TRNS,HOME,INS, FN4, \ - TRNS,LEFT,DOWN,RGHT,TRNS,TRNS,PSCR,SLCK,PAUS,TRNS,FN3, END, TRNS, \ - TRNS,DEL, TRNS,WHOM,MUTE,VOLU,VOLD,TRNS,PGUP,PGDN,DEL, TRNS, \ - TRNS,TRNS,TRNS, FN1, TRNS,TRNS,TRNS,TRNS), - /* 7: Layout selector - * ,-----------------------------------------------------------. - * | Lq| Lc| Ld| Lw| | | | | | | | | | | - * |-----------------------------------------------------------| - * | |Lq |Lw | | | | | | | | | | | | - * |-----------------------------------------------------------| - * | | | |Ld | | | | | | | | | | - * |-----------------------------------------------------------| - * | | | |Lc | | | | | | | | | - * |-----------------------------------------------------------| - * | | | | | | | | | - * `-----------------------------------------------------------' - * Lq: set Qwerty layout - * Lc: set Colemak layout - * Ld: set Dvorak layout - * Lw: set Workman layout - */ - KEYMAP_ANSI( - FN5, FN6, FN7, FN8, TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, \ - TRNS,FN5, FN8, TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, \ - TRNS,TRNS,TRNS,FN7, TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, TRNS, \ - TRNS,TRNS,TRNS,FN6, TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, TRNS, \ - TRNS,TRNS,TRNS, TRNS, TRNS,TRNS,TRNS,TRNS), -}; -const uint16_t PROGMEM fn_actions[] = { - /* Poker Layout */ - [0] = ACTION_LAYER_MOMENTARY(6), // to Fn overlay - [1] = ACTION_LAYER_TOGGLE(4), // toggle arrow overlay - [2] = ACTION_LAYER_TOGGLE(5), // toggle Esc overlay - [3] = ACTION_MODS_KEY(MOD_RCTL|MOD_RSFT, KC_ESC), // Task(RControl,RShift+Esc) - [4] = ACTION_LAYER_MOMENTARY(7), // to Layout selector - [5] = ACTION_DEFAULT_LAYER_SET(0), // set qwerty layout - [6] = ACTION_DEFAULT_LAYER_SET(1), // set colemak layout - [7] = ACTION_DEFAULT_LAYER_SET(2), // set dvorak layout - [8] = ACTION_DEFAULT_LAYER_SET(3), // set workman layout -}; diff --git a/keyboard/gh60/keymaps/poker_bit.c b/keyboard/gh60/keymaps/poker_bit.c deleted file mode 100644 index b8870fdd81d..00000000000 --- a/keyboard/gh60/keymaps/poker_bit.c +++ /dev/null @@ -1,50 +0,0 @@ -#include "keymap_common.h" - -// Poker fix with toggle and bit operation -// Fn + Esc = ` -// Fn + {left, down, up, right} = {home, pgdown, pgup, end} -const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - /* 0: qwerty */ - KEYMAP_ANSI( - GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, BSPC, \ - TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC,RBRC,BSLS, \ - LCTL,A, S, D, F, G, H, J, K, L, SCLN,QUOT, ENT, \ - LSFT,Z, X, C, V, B, N, M, COMM,DOT, SLSH, RSFT, \ - LCTL,LGUI,LALT, SPC, FN0, RGUI,APP, RCTL), - /* 4: Poker Default + Fn'd */ - [4] = KEYMAP_ANSI( - TRNS,F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, TRNS, \ - CAPS,FN2, UP, TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,CALC,TRNS,HOME,INS, TRNS, \ - TRNS,LEFT,DOWN,RGHT,TRNS,TRNS,PSCR,SLCK,PAUS,TRNS,FN4, END, TRNS, \ - TRNS,DEL, TRNS,WHOM,MUTE,VOLU,VOLD,TRNS,PGUP,PGDN,DEL, TRNS, \ - TRNS,TRNS,TRNS, FN1, TRNS,TRNS,TRNS,TRNS), - /* 5: Poker with Arrow */ - KEYMAP_ANSI( - TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, \ - TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, \ - TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, TRNS, \ - TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, PGUP, \ - TRNS,TRNS,TRNS, TRNS, FN3, HOME,PGDN,END), - /* 6: Poker with Esc */ - KEYMAP_ANSI( - ESC, TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, \ - TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, \ - TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, TRNS, \ - TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, TRNS, \ - TRNS,TRNS,TRNS, TRNS, TRNS,TRNS,TRNS,TRNS), - /* 7: Poker with Arrow + Fn'd */ - KEYMAP_ANSI( - TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, \ - TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, \ - TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, TRNS, \ - TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, UP, \ - TRNS,TRNS,TRNS, TRNS, TRNS,LEFT,DOWN,RGHT), -}; -const uint16_t PROGMEM fn_actions[] = { - /* Poker Layout */ - [0] = ACTION_LAYER_BIT_XOR(1, 0b0101, ON_BOTH), // Poker Fn(with fix for Esc) - [1] = ACTION_LAYER_TOGGLE(5), // Poker Arrow toggle - [2] = ACTION_LAYER_TOGGLE(6), // Poker Esc toggle - [3] = ACTION_LAYER_BIT_XOR(1, 0b1101, ON_BOTH), // Poker Fn(with fix for Arrow) - [4] = ACTION_MODS_KEY(MOD_RCTL|MOD_RSFT, KC_ESC), // FN3 Task(RControl,RShift+Esc) -}; diff --git a/keyboard/gh60/keymaps/poker_set.c b/keyboard/gh60/keymaps/poker_set.c deleted file mode 100644 index aaa31fc5717..00000000000 --- a/keyboard/gh60/keymaps/poker_set.c +++ /dev/null @@ -1,82 +0,0 @@ -#include "keymap_common.h" - -// Poker fix with set(state transition) -// Fn + Esc = ` -// Fn + {left, down, up, right} = {home, pgdown, pgup, end} -const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - /* 0: qwerty */ - KEYMAP_ANSI( - GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, BSPC, \ - TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC,RBRC,BSLS, \ - LCTL,A, S, D, F, G, H, J, K, L, SCLN,QUOT, ENT, \ - LSFT,Z, X, C, V, B, N, M, COMM,DOT, SLSH, RSFT, \ - LCTL,LGUI,LALT, SPC, FN0, RGUI,APP, RCTL), - /* 1: Poker with Arrow */ - KEYMAP_ANSI( - TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, \ - TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, \ - TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, TRNS, \ - TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, UP, \ - TRNS,TRNS,TRNS, TRNS, FN1, LEFT,DOWN,RGHT), - /* 2: Poker with Esc */ - KEYMAP_ANSI( - ESC, TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, \ - TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, \ - TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, TRNS, \ - TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, TRNS, \ - TRNS,TRNS,TRNS, TRNS, FN2, TRNS,TRNS,TRNS), - /* 3: Poker with Arrow and Esc */ - KEYMAP_ANSI( - ESC, TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, \ - TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, \ - TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, TRNS, \ - TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, UP, \ - TRNS,TRNS,TRNS, TRNS, FN3, LEFT,DOWN,RGHT), - /* 4: Poker Fn'd */ - KEYMAP_ANSI( - ESC, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, TRNS, \ - TRNS,FN6, UP, TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,CALC,TRNS,HOME,INS, TRNS, \ - TRNS,LEFT,DOWN,RGHT,TRNS,TRNS,PSCR,SLCK,PAUS,TRNS,FN8, END, TRNS, \ - TRNS,DEL, TRNS,WHOM,MUTE,VOLU,VOLD,TRNS,PGUP,PGDN,DEL, TRNS, \ - TRNS,TRNS,TRNS, FN5, FN4, TRNS,TRNS,TRNS), - /* 5: Poker Fn'd arrow */ - KEYMAP_ANSI( - ESC, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, TRNS, \ - TRNS,FN7, UP, TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,CALC,TRNS,HOME,INS, TRNS, \ - TRNS,LEFT,DOWN,RGHT,TRNS,TRNS,PSCR,SLCK,PAUS,TRNS,FN8, END, TRNS, \ - TRNS,DEL, TRNS,WHOM,MUTE,VOLU,VOLD,TRNS,PGUP,PGDN,DEL, PGUP, \ - TRNS,TRNS,TRNS, FN4, FN5, HOME,PGDN,END), - /* 6: Poker Fn'd Esc */ - KEYMAP_ANSI( - GRV, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, TRNS, \ - TRNS,FN4, UP, TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,CALC,TRNS,HOME,INS, TRNS, \ - TRNS,LEFT,DOWN,RGHT,TRNS,TRNS,PSCR,SLCK,PAUS,TRNS,FN8, END, TRNS, \ - TRNS,DEL, TRNS,WHOM,MUTE,VOLU,VOLD,TRNS,PGUP,PGDN,DEL, TRNS, \ - TRNS,TRNS,TRNS, FN7, FN6, TRNS,TRNS,TRNS), - /* 7: Poker Fn'd Arrow + Esc */ - KEYMAP_ANSI( - GRV, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, TRNS, \ - TRNS,FN5, UP, TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,CALC,TRNS,HOME,INS, TRNS, \ - TRNS,LEFT,DOWN,RGHT,TRNS,TRNS,PSCR,SLCK,PAUS,TRNS,FN8, END, TRNS, \ - TRNS,DEL, TRNS,WHOM,MUTE,VOLU,VOLD,TRNS,PGUP,PGDN,DEL, PGUP, \ - TRNS,TRNS,TRNS, FN6, FN7, HOME,PGDN,END), -}; - -/* - * Fn action definition - */ -const uint16_t PROGMEM fn_actions[] = { - /* Poker Layout */ - [0] = ACTION_LAYER_SET(4, ON_PRESS), // FN0 move to Fn'd when press - [1] = ACTION_LAYER_SET(5, ON_PRESS), // FN1 move to Fn'd arrow when press - [2] = ACTION_LAYER_SET(6, ON_PRESS), // FN2 move to Fn'd Esc when press - [3] = ACTION_LAYER_SET(7, ON_PRESS), // FN3 move to Fn'd arrow + Esc when press - - //[4] = ACTION_LAYER_CLEAR(ON_RELEASE), // FN4 clear overlay when release - [4] = ACTION_LAYER_SET(0, ON_RELEASE), // FN4 clear overlay when release - [5] = ACTION_LAYER_SET(1, ON_RELEASE), // FN5 move to arrow when release - [6] = ACTION_LAYER_SET(2, ON_RELEASE), // FN6 move to Esc when release - [7] = ACTION_LAYER_SET(3, ON_RELEASE), // FN7 move to arrow + Esc when release - - [8] = ACTION_MODS_KEY(MOD_RCTL|MOD_RSFT, KC_ESC), // FN8 Task(RControl,RShift+Esc) -}; diff --git a/keyboard/gh60/keymaps/spacefn.c b/keyboard/gh60/keymaps/spacefn.c deleted file mode 100644 index 8077dcee7b2..00000000000 --- a/keyboard/gh60/keymaps/spacefn.c +++ /dev/null @@ -1,55 +0,0 @@ -#include "keymap_common.h" - -/* - * SpaceFN - * http://geekhack.org/index.php?topic=51069.0 - */ -const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - /* Keymap 0: Default Layer - * ,-----------------------------------------------------------. - * |Esc| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Backsp | - * |-----------------------------------------------------------| - * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \| - * |-----------------------------------------------------------| - * |Caps | A| S| D| F| G| H| J| K| L| ;| '|Return | - * |-----------------------------------------------------------| - * |Shift | Z| X| C| V| B| N| M| ,| .| /|Shift | - * |-----------------------------------------------------------| - * |Ctrl|Gui |Alt | Space |Alt |Gui |App |Ctrl| - * `-----------------------------------------------------------' - */ - KEYMAP_ANSI( - ESC, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, BSPC, \ - TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC,RBRC,BSLS, \ - CAPS,A, S, D, F, G, H, J, K, L, SCLN,QUOT, ENT, \ - LSFT,Z, X, C, V, B, N, M, COMM,DOT, SLSH, RSFT, \ - LCTL,LGUI,LALT, FN0, RALT,RGUI,APP, RCTL), - - /* Overlay 1: SpaceFN - * ,-----------------------------------------------------------. - * |` | F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12|Delete | - * |-----------------------------------------------------------| - * | | | | | | | |Hom|Up |End|Psc|Slk|Pau|Ins | - * |-----------------------------------------------------------| - * | | | | | | |PgU|Lef|Dow|Rig| | | | - * |-----------------------------------------------------------| - * | | | | | |Spc|PgD|` |~ | | | | - * |-----------------------------------------------------------| - * | | | | | | | | | - * `-----------------------------------------------------------' - */ - KEYMAP_ANSI( - GRV, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, DEL, \ - TRNS,TRNS,TRNS,ESC, TRNS,TRNS,TRNS,HOME,UP, END, PSCR,SLCK,PAUS,INS, \ - TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,PGUP,LEFT,DOWN,RGHT,TRNS,TRNS, TRNS, \ - TRNS,TRNS,TRNS,TRNS,TRNS,SPC, PGDN,GRV, FN1, TRNS,TRNS, TRNS, \ - TRNS,TRNS,TRNS, TRNS, TRNS,TRNS,TRNS,TRNS), -}; - -/* - * Fn action definition - */ -const uint16_t PROGMEM fn_actions[] = { - [0] = ACTION_LAYER_TAP_KEY(1, KC_SPACE), - [1] = ACTION_MODS_KEY(MOD_LSFT, KC_GRV), // tilde -}; diff --git a/keyboard/gh60/led.c b/keyboard/gh60/led.c deleted file mode 100644 index 50659d7247c..00000000000 --- a/keyboard/gh60/led.c +++ /dev/null @@ -1,31 +0,0 @@ -/* -Copyright 2012 Jun Wako -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#include -#include "stdint.h" -#include "led.h" - - -void led_set(uint8_t usb_led) -{ - if (usb_led & (1< - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -/* - * scan matrix - */ -#include -#include -#include -#include -#include "print.h" -#include "debug.h" -#include "util.h" -#include "matrix.h" - - -#ifndef DEBOUNCE -# define DEBOUNCE 5 -#endif -static uint8_t debouncing = DEBOUNCE; - -/* matrix state(1:on, 0:off) */ -static matrix_row_t matrix[MATRIX_ROWS]; -static matrix_row_t matrix_debouncing[MATRIX_ROWS]; - -static matrix_row_t read_cols(void); -static void init_cols(void); -static void unselect_rows(void); -static void select_row(uint8_t row); - - -inline -uint8_t matrix_rows(void) -{ - return MATRIX_ROWS; -} - -inline -uint8_t matrix_cols(void) -{ - return MATRIX_COLS; -} - -void matrix_init(void) -{ - // initialize row and col - unselect_rows(); - init_cols(); - - // initialize matrix state: all keys off - for (uint8_t i=0; i < MATRIX_ROWS; i++) { - matrix[i] = 0; - matrix_debouncing[i] = 0; - } -} - -uint8_t matrix_scan(void) -{ - for (uint8_t i = 0; i < MATRIX_ROWS; i++) { - select_row(i); - _delay_us(30); // without this wait read unstable value. - matrix_row_t cols = read_cols(); - if (matrix_debouncing[i] != cols) { - matrix_debouncing[i] = cols; - if (debouncing) { - debug("bounce!: "); debug_hex(debouncing); debug("\n"); - } - debouncing = DEBOUNCE; - } - unselect_rows(); - } - - if (debouncing) { - if (--debouncing) { - _delay_ms(1); - } else { - for (uint8_t i = 0; i < MATRIX_ROWS; i++) { - matrix[i] = matrix_debouncing[i]; - } - } - } - - return 1; -} - -bool matrix_is_modified(void) -{ - if (debouncing) return false; - return true; -} - -inline -bool matrix_is_on(uint8_t row, uint8_t col) -{ - return (matrix[row] & ((matrix_row_t)1<.c` in the keymaps folder, and see keymap document (you can find in top README.md) and existent keymap files. - -To build the firmware binary hex file with a keymap just do `make` with `KEYMAP` option like: -``` -$ make KEYMAP=[default|jack|] -``` -Keymaps follow the format **__\.c__** and are stored in the `keymaps` folder. diff --git a/keyboard/ghost_squid/Makefile.lufa b/keyboard/ghost_squid/Makefile.lufa deleted file mode 100644 index 54adb1e3d81..00000000000 --- a/keyboard/ghost_squid/Makefile.lufa +++ /dev/null @@ -1,117 +0,0 @@ -#---------------------------------------------------------------------------- -# On command line: -# -# make all = Make software. -# -# make clean = Clean out built project files. -# -# make coff = Convert ELF to AVR COFF. -# -# make extcoff = Convert ELF to AVR Extended COFF. -# -# make program = Download the hex file to the device. -# Please customize your programmer settings(PROGRAM_CMD) -# -# make teensy = Download the hex file to the device, using teensy_loader_cli. -# (must have teensy_loader_cli installed). -# -# make dfu = Download the hex file to the device, using dfu-programmer (must -# have dfu-programmer installed). -# -# make flip = Download the hex file to the device, using Atmel FLIP (must -# have Atmel FLIP installed). -# -# make dfu-ee = Download the eeprom file to the device, using dfu-programmer -# (must have dfu-programmer installed). -# -# make flip-ee = Download the eeprom file to the device, using Atmel FLIP -# (must have Atmel FLIP installed). -# -# make debug = Start either simulavr or avarice as specified for debugging, -# with avr-gdb or avr-insight as the front end for debugging. -# -# make filename.s = Just compile filename.c into the assembler code only. -# -# make filename.i = Create a preprocessed source file for use in submitting -# bug reports to the GCC project. -# -# To rebuild project do "make clean" then "make all". -#---------------------------------------------------------------------------- - -# Target file name (without extension). -TARGET = ghostsquid_lufa - -# Directory common source filess exist -TMK_DIR = ../../tmk_core - -# Directory keyboard dependent files exist -TARGET_DIR = . - -# List C source files here. (C dependencies are automatically generated.) -SRC = keymap.c \ - matrix.c \ - led.c - -CONFIG_H = config.h - -# MCU name -MCU = atmega32u2 - -# Processor frequency. -# This will define a symbol, F_CPU, in all source code files equal to the -# processor frequency in Hz. You can then use this symbol in your source code to -# calculate timings. Do NOT tack on a 'UL' at the end, this will be done -# automatically to create a 32-bit value in your source code. -# -# This will be an integer division of F_USB below, as it is sourced by -# F_USB after it has run through any CPU prescalers. Note that this value -# does not *change* the processor frequency - it should merely be updated to -# reflect the processor speed set externally so that the code can use accurate -# software delays. -F_CPU = 16000000 - -# -# LUFA specific -# -# Target architecture (see library "Board Types" documentation). -ARCH = AVR8 - -# Input clock frequency. -# This will define a symbol, F_USB, in all source code files equal to the -# input clock frequency (before any prescaling is performed) in Hz. This value may -# differ from F_CPU if prescaling is used on the latter, and is required as the -# raw input clock is fed directly to the PLL sections of the AVR for high speed -# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' -# at the end, this will be done automatically to create a 32-bit value in your -# source code. -# -# If no clock division is performed on the input clock inside the AVR (via the -# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. -F_USB = $(F_CPU) - - -# Build Options -# comment out to disable the options. -# -#BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE = yes # Mouse keys(+4700) -EXTRAKEY_ENABLE = yes # Audio control and System control(+450) -#CONSOLE_ENABLE = yes # Console for debug(+400) -COMMAND_ENABLE = yes # Commands for debug and configuration -#SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend -#NKRO_ENABLE = yes # USB Nkey Rollover - not yet supported in LUFA - - -# Boot Section Size in bytes -# Teensy halfKay 512 -# Atmel DFU loader 4096 -# LUFA bootloader 4096 -OPT_DEFS += -DBOOTLOADER_SIZE=4096 - -# Search Path -VPATH += $(TARGET_DIR) -VPATH += $(TMK_DIR) - -include $(TMK_DIR)/protocol/lufa.mk -include $(TMK_DIR)/common.mk -include $(TMK_DIR)/rules.mk diff --git a/keyboard/ghost_squid/README.md b/keyboard/ghost_squid/README.md deleted file mode 100644 index dda67e6ba19..00000000000 --- a/keyboard/ghost_squid/README.md +++ /dev/null @@ -1,20 +0,0 @@ -The Ghost Squid controller -========================== -Custom controller for the Cooler Master QuickFire XT keyboard designed by bpiphany. - -*Note that this is not the official firmware* - -Build ------ -Move to this directory then just run `make` like: - - $ make -f Makefile.lufa - -At the moment only the LUFA stack is supported. - - -Bootloader ---------- -To enter bootloader by hardware use a magnet above the controller before connecting the usb cable. - -It is still possible to use Boot Magic and Command (LSFT+RSFT+PAUS) to access the bootloader though. diff --git a/keyboard/ghost_squid/config.h b/keyboard/ghost_squid/config.h deleted file mode 100644 index 54f03143c13..00000000000 --- a/keyboard/ghost_squid/config.h +++ /dev/null @@ -1,43 +0,0 @@ -/* -Copyright 2014 Ralf Schmitt - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#ifndef CONFIG_H -#define CONFIG_H - -/* USB Device descriptor parameter */ -#define VENDOR_ID 0xFEED // 0x2516 (original CM XT value) -#define PRODUCT_ID 0x001A -#define DEVICE_VER 0x0000 -#define MANUFACTURER Cooler Master -#define PRODUCT Cooler Master QuickFire XT - -/* message strings */ -#define DESCRIPTION t.m.k. keyboard firmware for Cooler Master QuickFire XT - -/* matrix size */ -#define MATRIX_ROWS 8 -#define MATRIX_COLS 18 - -/* Set 0 if need no debouncing */ -#define DEBOUNCE 5 - -/* key combination for command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - -#endif diff --git a/keyboard/ghost_squid/keymap.c b/keyboard/ghost_squid/keymap.c deleted file mode 100644 index e9ad9efe1af..00000000000 --- a/keyboard/ghost_squid/keymap.c +++ /dev/null @@ -1,102 +0,0 @@ -/* -Copyright 2014 Ralf Schmitt - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#include -#include -#include -#include "keycode.h" -#include "action.h" -#include "action_macro.h" -#include "report.h" -#include "host.h" -#include "debug.h" -#include "keymap.h" - -/* - Matrix col/row mapping - - ,----. ,-------------------. ,-------------------. ,-------------------. ,--------------. - |06/6| |07/4|08/4|08/2|08/6| |15/5|11/6|12/2|12/4| |14/4|14/5|14/6|14/0| |13/5|13/7|15/7| - `----' `-------------------' `-------------------' `-------------------' `--------------' - ,-------------------------------------------------------------------------. ,--------------. ,-------------------. - |06/4|06/5|07/5|08/5|09/5|09/4|10/4|10/5|11/5|12/5|05/5|05/4|11/4| 14/2| |17/4|02/4|04/4| |16/1|17/1|04/1|04/0| - |-------------------------------------------------------------------------| |--------------| |-------------------| - |06/2 |06/7|07/7|08/7|09/7|09/2|10/2|10/7|11/7|12/7|05/7|05/2|11/2| 14/3| |16/4|02/5|04/5| |16/7|17/7|04/7| | - |-------------------------------------------------------------------------| '--------------' |-------------- 02/7| - |02/7 |06/3|07/3|08/3|09/3|09/6|10/6|10/3|11/3|12/3|05/3|05/6| 14/1| |16/2|17/2|04/2| | - |-------------------------------------------------------------------------| ,----. |-------------------| - |01/2 |06/1|07/1|08/1|09/1|09/0|10/0|10/1|11/1|12/1|05/0| 01/3| |02/6| |16/3|17/3|04/3| | - |-------------------------------------------------------------------------| ,--------------. |-------------- 02/3| - |15/4|03/2|13/6| 16/6 |13/0|0/3|12/0|15/1| |02/0|16/0|17/0| | 17/6 |04/6| | - `-------------------------------------------------------------------------' `--------------' `-------------------' -*/ - -#define KEYMAP( \ - KG6, KH4, KI4, KI2, KI6, KP5, KL6, KM2, KM4, KO4, KO5, KO6, KO0, KN5, KN7, KP7, \ - KG4, KG5, KH5, KI5, KJ5, KJ4, KK4, KK5, KL5, KM5, KF5, KF4, KL4, KO2, KR4, KC4, KE4, KQ1, KR1, KE1, KE0, \ - KG2, KG7, KH7, KI7, KJ7, KJ2, KK2, KK7, KL7, KM7, KF7, KF2, KL2, KO3, KQ4, KC5, KE5, KQ7, KR7, KE7, KC7, \ - KH2, KG3, KH3, KI3, KJ3, KJ6, KK6, KK3, KL3, KM3, KF3, KF6, KO1, KQ2, KR2, KE2, \ - KB2, KH6, KG1, KH1, KI1, KJ1, KJ0, KK0, KK1, KL1, KM1, KF0, KB3, KC6, KQ3, KR3, KE3, KC3, \ - KP4, KD2, KN6, KQ6, KN0, KA3, KM0, KP1, KC0, KQ0, KR0, KR6, KE6 \ -) { \ -/* 0 1 2 3 4 5 6 7 */ \ -/* A 0 */ {KC_NO, KC_NO, KC_NO, KC_##KA3, KC_NO, KC_NO, KC_NO, KC_NO },\ -/* B 1 */ {KC_NO, KC_NO, KC_##KB2, KC_##KB3, KC_NO, KC_NO, KC_NO, KC_NO },\ -/* C 2 */ {KC_##KC0, KC_NO, KC_NO, KC_##KC3, KC_##KC4, KC_##KC5, KC_##KC6, KC_##KC7},\ -/* D 3 */ {KC_NO, KC_NO, KC_##KD2, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO },\ -/* E 4 */ {KC_##KE0, KC_##KE1, KC_##KE2, KC_##KE3, KC_##KE4, KC_##KE5, KC_##KE6, KC_##KE7},\ -/* F 5 */ {KC_##KF0, KC_NO, KC_##KF2, KC_##KF3, KC_##KF4, KC_##KF5, KC_##KF6, KC_##KF7},\ -/* G 6 */ {KC_NO, KC_##KG1, KC_##KG2, KC_##KG3, KC_##KG4, KC_##KG5, KC_##KG6, KC_##KG7},\ -/* H 7 */ {KC_NO, KC_##KH1, KC_##KH2, KC_##KH3, KC_##KH4, KC_##KH5, KC_##KH6, KC_##KH7},\ -/* I 8 */ {KC_NO, KC_##KI1, KC_##KI2, KC_##KI3, KC_##KI4, KC_##KI5, KC_##KI6, KC_##KI7},\ -/* J 9 */ {KC_##KJ0, KC_##KJ1, KC_##KJ2, KC_##KJ3, KC_##KJ4, KC_##KJ5, KC_##KJ6, KC_##KJ7},\ -/* K 10 */ {KC_##KK0, KC_##KK1, KC_##KK2, KC_##KK3, KC_##KK4, KC_##KK5, KC_##KK6, KC_##KK7},\ -/* L 11 */ {KC_NO, KC_##KL1, KC_##KL2, KC_##KL3, KC_##KL4, KC_##KL5, KC_##KL6, KC_##KL7},\ -/* M 12 */ {KC_##KM0, KC_##KM1, KC_##KM2, KC_##KM3, KC_##KM4, KC_##KM5, KC_NO, KC_##KM7},\ -/* N 13 */ {KC_##KN0, KC_NO, KC_NO, KC_NO, KC_NO, KC_##KN5, KC_##KN6, KC_##KN7},\ -/* O 14 */ {KC_##KO0, KC_##KO1, KC_##KO2, KC_##KO3, KC_##KO4, KC_##KO5, KC_##KO6, KC_NO },\ -/* P 15 */ {KC_NO, KC_##KP1, KC_NO, KC_NO, KC_##KP4, KC_##KP5, KC_NO, KC_##KP7},\ -/* Q 16 */ {KC_##KQ0, KC_##KQ1, KC_##KQ2, KC_##KQ3, KC_##KQ4, KC_NO, KC_##KQ6, KC_##KQ7},\ -/* R 17 */ {KC_##KR0, KC_##KR1, KC_##KR2, KC_##KR3, KC_##KR4, KC_NO, KC_##KR6, KC_##KR7} \ -} - -#include "keymap_ansi.h" - -#define KEYMAPS_SIZE (sizeof(keymaps) / sizeof(keymaps[0])) -#define FN_ACTIONS_SIZE (sizeof(fn_actions) / sizeof(fn_actions[0])) - -/* translates key to keycode */ -uint8_t keymap_key_to_keycode(uint8_t layer, keypos_t key) -{ - if (layer < KEYMAPS_SIZE) { - return pgm_read_byte(&keymaps[(layer)][(key.col)][(key.row)]); - } else { - return pgm_read_byte(&keymaps[0][(key.col)][(key.row)]); - } -} - -/* translates Fn keycode to action */ -action_t keymap_fn_to_action(uint8_t keycode) -{ - action_t action; - if (FN_INDEX(keycode) < FN_ACTIONS_SIZE) { - action.code = pgm_read_word(&fn_actions[FN_INDEX(keycode)]); - } else { - action.code = ACTION_NO; - } - return action; -} diff --git a/keyboard/ghost_squid/keymap_ansi.h b/keyboard/ghost_squid/keymap_ansi.h deleted file mode 100644 index ed1088baa9b..00000000000 --- a/keyboard/ghost_squid/keymap_ansi.h +++ /dev/null @@ -1,23 +0,0 @@ - -static const uint8_t PROGMEM keymaps[][MATRIX_COLS][MATRIX_ROWS] = { - /* Layer 0: Standard ANSI layer */ - KEYMAP(\ - ESC, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, PSCR,SLCK,PAUS, \ - GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS, EQL,BSPC, INS, HOME,PGUP, NLCK,PSLS,PAST,PMNS, \ - TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC,RBRC,BSLS, DEL, END, PGDN, P7, P8, P9, PPLS, \ - CAPS,A, S, D, F, G, H, J, K, L, SCLN,QUOT, ENT, P4, P5, P6, \ - LSFT,NUBS,Z, X, C, V, B, N, M, COMM,DOT, SLSH, RSFT, UP, P1, P2, P3, PENT, \ - LCTL,LGUI,LALT, SPC, RALT,RGUI, FN0,RCTL, LEFT,DOWN,RGHT, P0, PDOT), \ - /* Layer 1: Function layer */ - KEYMAP(\ - CALC,MYCM,WSCH,WHOM,MAIL,VOLD,VOLU,MSEL,MSTP,MPLY,MPRV,MNXT,TRNS, WAKE, PWR,SLEP, \ - TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, TRNS,TRNS,TRNS, TRNS,TRNS,TRNS,TRNS, \ - TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, TRNS,TRNS,TRNS, TRNS,TRNS,TRNS,TRNS, \ - TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, TRNS, TRNS,TRNS,TRNS, \ - TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, TRNS, TRNS, TRNS,TRNS,TRNS,TRNS, \ - TRNS,TRNS,TRNS, TRNS, TRNS,TRNS,TRNS,TRNS, TRNS,TRNS,TRNS, TRNS,TRNS) -}; - -static const uint16_t PROGMEM fn_actions[] = { - [0] = ACTION_LAYER_MOMENTARY(1) -}; diff --git a/keyboard/ghost_squid/led.c b/keyboard/ghost_squid/led.c deleted file mode 100644 index da5dbd7ae23..00000000000 --- a/keyboard/ghost_squid/led.c +++ /dev/null @@ -1,60 +0,0 @@ -/* -Copyright 2014 Ralf Schmitt - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#include -#include "stdint.h" -#include "led.h" - -/* LED pin configuration - * - * Scroll Lock PB7 - * CAPS PC6 - * NUMLOCK PC5 - * - */ -void led_set(uint8_t usb_led) -{ - DDRB |= (1<<7); - DDRC |= (1<<5) | (1<<6); - - if (usb_led & (1< - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#include -#include -#include -#include -#include "print.h" -#include "debug.h" -#include "util.h" -#include "matrix.h" - -#ifndef DEBOUNCE -# define DEBOUNCE 0 -#endif -static uint8_t debouncing = DEBOUNCE; - -static matrix_row_t matrix[MATRIX_ROWS]; -static matrix_row_t matrix_debouncing[MATRIX_ROWS]; - -static uint8_t read_rows(void); -static void init_rows(void); -static void unselect_cols(void); -static void select_col(uint8_t col); - -inline uint8_t matrix_rows(void) -{ - return MATRIX_ROWS; -} - -inline uint8_t matrix_cols(void) -{ - return MATRIX_COLS; -} - -void matrix_init(void) -{ - unselect_cols(); - init_rows(); - for (uint8_t i=0; i < MATRIX_ROWS; i++) { - matrix[i] = 0; - matrix_debouncing[i] = 0; - } -} - -uint8_t matrix_scan(void) -{ - for (uint8_t col = 0; col < MATRIX_COLS; col++) { - select_col(col); - _delay_us(3); - uint8_t rows = read_rows(); - for (uint8_t row = 0; row < MATRIX_ROWS; row++) { - bool prev_bit = matrix_debouncing[row] & ((matrix_row_t)1< - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#ifndef CONFIG_H -#define CONFIG_H - - -#define VENDOR_ID 0xFEED -#define PRODUCT_ID 0xBB00 -#define MANUFACTURER t.m.k. -#define DEVICE_VER 0x0100 -#define PRODUCT Happy Buckling Keyboard - -#define DESCRIPTION mod version of IBM Model M keyboard - -/* matrix size */ -#define MATRIX_ROWS 12 -#define MATRIX_COLS 8 - -/* define if matrix has ghost */ -#define MATRIX_HAS_GHOST - -/* Set 0 if need no debouncing */ -#define DEBOUNCE 5 - -/* legacy keymap support */ -#define USE_LEGACY_KEYMAP - -/* key combination for command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_LCTRL) | MOD_BIT(KC_LALT) | MOD_BIT(KC_LGUI)) || \ - keyboard_report->mods == (MOD_BIT(KC_LALT) | MOD_BIT(KC_RALT)) \ -) - -#endif diff --git a/keyboard/hbkb/keymap.c b/keyboard/hbkb/keymap.c deleted file mode 100644 index b89bdf8e425..00000000000 --- a/keyboard/hbkb/keymap.c +++ /dev/null @@ -1,231 +0,0 @@ -/* -Copyright 2012 Jun Wako - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -/* - * Keymap for Macway mod - */ -#include -#include -#include -#include "keycode.h" -#include "print.h" -#include "debug.h" -#include "util.h" -#include "keymap.h" - - -/* - * Layout: 59key - * ,-----------------------------------------------------------. - * |Esc| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =| \| `| - * |-----------------------------------------------------------| - * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| BS | - * |-----------------------------------------------------------| - * |Contro| A| S| D| F| G| H| J| K| L|Fn3| '|Return | - * |-----------------------------------------------------------| - * |Shift | Z| X| C| V| B| N| M| ,| .|Fn2|Shift | - * |-----------------------------------------------------------| - * |Ctrl | |Alt | Fn4 |Alt | |Fn1 | - * `-----' `---------------------------------------' `-----' - * - * Matrix: 12x8 - * | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 - * ---+---------+---------+---------+---------+---------+---------+---------+--------- - * 0 | | | LCTRL | | | | RCTRL | - * 1 | | LSHIFT | | | | | RSHIFT | - * 2 | | Tab | Grave | 1 | Q | A | Z | - * 3 | | Cpslck | | 2 | W | S | X | - * 4 | | | | 3 | E | D | C | - * 5 | G | T | 5 | 4 | R | F | V | B - * 6 | | Bckspc | | | Key*1 | Bckslsh | Enter | Space - * 7 | H | Y | 6 | 7 | U | J | M | N - * 8 | | Rbrckt | Equal | 8 | I | K | Comma | - * 9 | | | | 9 | O | L | Dot | - * A | | Lbrckt | Minus | 0 | P | Smcolon | | Slash - * B | LALT | | | | | | | RALT - * Key*1 This key locates between Equal and Backspace. - * - * Original matrix here: http://geekhack.org/showthread.php?7767-Wireless-Model-M&p=133911&viewfull=1#post133911 - */ -#define KEYMAP( \ - K22, K23, K33, K43, K53, K52, K72, K73, K83, K93, KA3, KA2, K82, K64, K61, \ - K21, K24, K34, K44, K54, K51, K71, K74, K84, K94, KA4, KA1, K81, K65, \ - K31, K25, K35, K45, K55, K50, K70, K75, K85, K95, KA5, KA0, K66, \ - K11, K26, K36, K46, K56, K57, K77, K76, K86, K96, KA7, K16, \ - K02, KB0, K67, KB7, K06 \ -) { \ - { KC_NO, KC_NO, KC_##K02, KC_NO, KC_NO, KC_NO, KC_##K06, KC_NO }, \ - { KC_NO, KC_##K11, KC_NO, KC_NO, KC_NO, KC_NO, KC_##K16, KC_NO }, \ - { KC_NO, KC_##K21, KC_##K22, KC_##K23, KC_##K24, KC_##K25, KC_##K26, KC_NO }, \ - { KC_NO, KC_##K31, KC_NO, KC_##K33, KC_##K34, KC_##K35, KC_##K36, KC_NO }, \ - { KC_NO, KC_NO, KC_NO, KC_##K43, KC_##K44, KC_##K45, KC_##K46, KC_NO }, \ - { KC_##K50, KC_##K51, KC_##K52, KC_##K53, KC_##K54, KC_##K55, KC_##K56, KC_##K57 }, \ - { KC_NO, KC_##K61, KC_NO, KC_NO, KC_##K64, KC_##K65, KC_##K66, KC_##K67 }, \ - { KC_##K70, KC_##K71, KC_##K72, KC_##K73, KC_##K74, KC_##K75, KC_##K76, KC_##K77 }, \ - { KC_NO, KC_##K81, KC_##K82, KC_##K83, KC_##K84, KC_##K85, KC_##K86, KC_NO }, \ - { KC_NO, KC_NO, KC_NO, KC_##K93, KC_##K94, KC_##K95, KC_##K96, KC_NO }, \ - { KC_##KA0, KC_##KA1, KC_##KA2, KC_##KA3, KC_##KA4, KC_##KA5, KC_NO, KC_##KA7 }, \ - { KC_##KB0, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_##KB7 }, \ -} - -#define KEYCODE(layer, row, col) (pgm_read_byte(&keymaps[(layer)][(row)][(col)])) - - -// Assign Fn key(0-7) to a layer to which switch with the Fn key pressed. -static const uint8_t PROGMEM fn_layer[] = { - 0, // Fn0 - 1, // Fn1 - 2, // Fn2 - 3, // Fn3 - 4, // Fn4 - 0, // Fn5 - 0, // Fn6 - 0 // Fn7 -}; - -// Assign Fn key(0-7) to a keycode sent when release Fn key without use of the layer. -// See layer.c for details. -static const uint8_t PROGMEM fn_keycode[] = { - KC_NO, // Fn0 - KC_NO, // Fn1 - KC_SLSH, // Fn2 - KC_SCLN, // Fn3 - KC_SPC, // Fn4 - KC_NO, // Fn5 - KC_NO, // Fn6 - KC_NO // Fn7 -}; - -static const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - /* Layer 0: Default Layer - * ,-----------------------------------------------------------. - * |Esc| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =| \| `| - * |-----------------------------------------------------------| - * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| BS | - * |-----------------------------------------------------------| - * |Contro| A| S| D| F| G| H| J| K| L|Fn3| '|Return | - * |-----------------------------------------------------------| - * |Shift | Z| X| C| V| B| N| M| ,| .|Fn2|Shift | - * |-----------------------------------------------------------| - * |Ctrl | |Alt | Fn4 |Alt | |Fn1 | - * `-----' `---------------------------------------' `-----' - */ - KEYMAP(ESC, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, BSLS,GRV, \ - TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC,RBRC,BSPC, \ - LCTL,A, S, D, F, G, H, J, K, L, FN3, QUOT,ENT, \ - LSFT,Z, X, C, V, B, N, M, COMM,DOT, FN2, FN1, \ - LGUI, LALT, FN4, RALT, FN1), - - - /* Layer 1: HHKB mode (HHKB Fn) - * ,-----------------------------------------------------------. - * |Esc| F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12|Ins|Del| - * |-----------------------------------------------------------| - * |Caps | | | | | | | |Psc|Slk|Pus|Up | | | - * |-----------------------------------------------------------| - * |Contro|VoD|VoU|Mut| | | *| /|Hom|PgU|Lef|Rig| | - * |-----------------------------------------------------------| - * |Shift | | | | | | +| -|End|PgD|Dow|Shift | - * |-----------------------------------------------------------| - * |Ctrl | |Alt | Space |Alt | |Fn1 | - * `-----' `---------------------------------------' `-----' - */ - KEYMAP(ESC, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, INS, DEL, \ - CAPS,NO, NO, NO, NO, NO, NO, NO, PSCR,SLCK,BRK, UP, NO, NO, \ - LCTL,VOLD,VOLU,MUTE,NO, NO, PAST,PSLS,HOME,PGUP,LEFT,RGHT,NO, \ - LSFT,NO, NO, NO, NO, NO, PPLS,PMNS,END, PGDN,DOWN,FN1, \ - LGUI, LALT, SPC, RALT, FN1), - - - /* Layer 2: Vi mode (Quote/Rmeta) - * ,-----------------------------------------------------------. - * | `| F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12| | | - * |-----------------------------------------------------------| - * | \ |Hom|PgD|Up |PgU|End|Hom|PgD|PgU|End| | | | | - * |-----------------------------------------------------------| - * |Contro| |Lef|Dow|Rig| |Lef|Dow|Up |Rig| | | | - * |-----------------------------------------------------------| - * |Shift | | | | | |Hom|PgD|PgU|End|xxx|Shift | - * |-----------------------------------------------------------| - * |Ctrl | |Alt | Space |Alt | |Fn1 | - * `-----' `---------------------------------------' `-----' - */ - KEYMAP(GRV, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, NO, NO, \ - BSLS,HOME,PGDN,UP, PGUP,END, HOME,PGDN,PGUP,END, NO, NO, NO, NO, \ - LCTL,NO, LEFT,DOWN,RGHT,NO, LEFT,DOWN,UP, RGHT,NO, NO, NO, \ - LSFT,NO, NO, NO, NO, NO, HOME,PGDN,PGUP,END, FN2, RSFT, \ - LGUI, LALT, SPC, RALT, NO), - - - - /* Layer 3: Mouse mode (Semicolon) - * ,-----------------------------------------------------------. - * | `| F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12| | | - * |-----------------------------------------------------------| - * | \ |MwL|MwD|McU|MwU|MwR|MwL|MwD|MwU|MwR| | | | | - * |-----------------------------------------------------------| - * |Contro| |McL|McD|McR| |McL|McD|McU|McR|xxx| | | - * |-----------------------------------------------------------| - * |Shift | | |Mb1|Mb2|Mb3|Mb2|Mb1| | | |Shift | - * |-----------------------------------------------------------| - * |Ctrl | |Alt | Space |Alt | | | - * `-----' `---------------------------------------' `-----' - * Mc: Mouse Cursor / Mb: Mouse Button / Mw: Mouse Wheel - */ - KEYMAP(GRV, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, NO, NO, \ - BSLS,WH_L,WH_D,MS_U,WH_U,WH_R,WH_L,WH_D,WH_U,WH_R,NO, NO, NO, NO, \ - LCTL,NO, MS_L,MS_D,MS_R,NO, MS_L,MS_D,MS_U,MS_R,FN3, NO, NO, \ - LSFT,NO, NO, BTN1,BTN2,BTN3,BTN2,BTN1,NO, NO, NO, RSFT, \ - LGUI, LALT, BTN1, RALT, NO), - - - /* Layer 4: Matias half keyboard style (Space) - * ,-----------------------------------------------------------. - * |Esc| F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12|Delete | - * |-----------------------------------------------------------| - * |Backs| P| O| I| U| Y| T| R| E| W| Q| | |Tab | - * |-----------------------------------------------------------| - * |Contro| ;| L| K| J| H| G| F| D| S| A|Con|Control | - * |-----------------------------------------------------------| - * |Shift | /| .| ,| M| N| B| V| C| X| Z|Shift | - * |-----------------------------------------------------------| - * |Ctrl | |Alt | Fn4 |Alt | | | - * `-----' `---------------------------------------' `-----' - */ - KEYMAP(MINS,0, 9, 8, 7, 6, 5, 4, 3, 2, 1, NO, NO, NO, ESC, \ - BSPC,P, O, I, U, Y, T, R, E, W, Q, NO, NO, TAB, \ - LCTL,SCLN,L, K, J, H, G, F, D, S, A, RCTL,RCTL, \ - LSFT,SLSH,DOT, COMM,M, N, B, V, C, X, Z, RSFT, \ - LGUI, LALT, FN4, RALT, NO), - -}; - - -uint8_t keymap_get_keycode(uint8_t layer, uint8_t row, uint8_t col) -{ - return KEYCODE(layer, row, col); -} - -uint8_t keymap_fn_layer(uint8_t index) -{ - return pgm_read_byte(&fn_layer[index]); -} - -uint8_t keymap_fn_keycode(uint8_t index) -{ - return pgm_read_byte(&fn_keycode[index]); -} diff --git a/keyboard/hbkb/led.c b/keyboard/hbkb/led.c deleted file mode 100644 index fc0eeb0ff72..00000000000 --- a/keyboard/hbkb/led.c +++ /dev/null @@ -1,24 +0,0 @@ -/* -Copyright 2012 Jun Wako - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#include "stdint.h" -#include "led.h" - - -void led_set(uint8_t usb_led) -{ -} diff --git a/keyboard/hbkb/matrix.c b/keyboard/hbkb/matrix.c deleted file mode 100644 index ee32312d9a2..00000000000 --- a/keyboard/hbkb/matrix.c +++ /dev/null @@ -1,206 +0,0 @@ -/* -Copyright 2012 Jun Wako - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#include -#include -#include -#include -#include "print.h" -#include "debug.h" -#include "util.h" -#include "matrix.h" - - -/* - * Happy Buckling Keyboard(IBM Model M mod) - * - * Pin usage: - * COL: PD0-7 - * ROW: PB0-7, PF4-7 - */ -#ifndef DEBOUNCE -# define DEBOUNCE 10 -#endif -static uint8_t debouncing = DEBOUNCE; - -/* matrix state(1:on, 0:off) */ -static matrix_row_t matrix[MATRIX_ROWS]; -static matrix_row_t matrix_debouncing[MATRIX_ROWS]; - -#ifdef MATRIX_HAS_GHOST -static bool matrix_has_ghost_in_row(uint8_t row); -#endif -static matrix_row_t read_cols(void); -static void unselect_rows(void); -static void select_row(uint8_t row); - - -inline -uint8_t matrix_rows(void) -{ - return MATRIX_ROWS; -} - -inline -uint8_t matrix_cols(void) -{ - return MATRIX_COLS; -} - -void matrix_init(void) -{ - // JTAG disable for PORT F. write JTD bit twice within four cycles. - MCUCR |= (1<event.pressed` (see keymap_default.c). + +```c +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) // this is the function signature -- just copy/paste it into your keymap file as it is. +{ + switch(id) { + case 0: // this would trigger when you hit a key mapped as M(0) + if (record->event.pressed) { + return MACRO( I(255), T(H), T(E), T(L), T(L), W(255), T(O), END ); // this sends the string 'hello' when the macro executes + } + break; + } + return MACRO_NONE; +}; +``` +A macro can include the following commands: + +* I() change interval of stroke in milliseconds. +* D() press key. +* U() release key. +* T() type key(press and release). +* W() wait (milliseconds). +* END end mark. + +So above you can see the stroke interval changed to 255ms between each keystroke, then a bunch of keys being typed, waits a while, then the macro ends. + +Note: Using macros to have your keyboard send passwords for you is a bad idea. + +### Additional keycode aliases for software-implemented layouts (Colemak, Dvorak, etc) + +Everything is assuming you're in Qwerty (in software) by default, but there is built-in support for using a Colemak or Dvorak layout by including this at the top of your keymap: + + #include "keymap_.h" + +Where is "colemak" or "dvorak". After including this line, you will get access to: -###Pros -* No risks: Everything is all reversible -* No need for PCB trace patching, case cutting or any other destructive mod -* Can keep original controller intact -* Can change all HHKB behavior as you like + * `CM_*` for all of the Colemak-equivalent characters + * `DV_*` for all of the Dvorak-equivalent characters + +These implementations assume you're using Colemak or Dvorak on your OS, not on your keyboard - this is referred to as a software-implemented layout. If your computer is in Qwerty and your keymap is in Colemak or Dvorak, this is referred to as a firmware-implemented layout, and you won't need these features. -###Cons -* Void your warranty -* Lose USB hub function of Pro2 +To give an example, if you're using software-implemented Colemak, and want to get an `F`, you would use `CM_F` - `KC_F` under these same circumstances would result in `T`. -##DISCLAIMER -I'm not a professional of electronics nor MCU programming. This may damage your HHKB. -And my English writing is poor, I'm not sure I can convey my notions accurately. +## Additional language support +In `quantum/keymap_extras/`, you'll see various language files - these work the same way as the alternative layout ones do. Most are defined by their two letter country/language code followed by an underscore and a 4-letter abbreviation of its name. `FR_UGRV` which will result in a `ù` when using a software-implemented AZERTY layout. It's currently difficult to send such characters in just the firmware (but it's being worked on - see Unicode support). -##Documents -See [doc/HHKB.txt](doc/HHKB.txt) and files under [doc/](doc/) for internal of HHKB and this controller. +## Unicode support +You can currently send 4 hex digits with your OS-specific modifier key (RALT for OSX with the "Unicode Hex Input" layout) - this is currently limited to supporting one OS at a time, and requires a recompile for switching. 8 digit hex codes are being worked on. The keycode function is `UC(n)`, where *n* is a 4 digit hexidecimal. Enable from the Makefile. -##Build Firmware & Program -See [this document](../../doc/build.md) first. +## Other firmware shortcut keycodes -### Configuration -If your target is **HHKB JP** you need to set `HHKB_JP` build option in `Makefile` or use `Makefile.jp` instead of `Makefile`. +* `RESET` - puts the MCU in DFU mode for flashing new firmware (with `make dfu`) +* `DEBUG` - the firmware into debug mode - you'll need hid_listen to see things +* `BL_ON` - turns the backlight on +* `BL_OFF` - turns the backlight off +* `BL_` - sets the backlight to level *n* +* `BL_INC` - increments the backlight level by one +* `BL_DEC` - decrements the backlight level by one +* `BL_TOGG` - toggles the backlight +* `BL_STEP` - steps through the backlight levels -If you use other than **TMK Alt Controller Board** set proper `MCU`, `BOOTLOADER_SIZE` and other build options in `Makefile` and `config.h`. At least PJRC Teensy requires changing `BOOTLOADER_SIZE` to 512. +Enable the backlight from the Makefile. -### Build -Several version of keymap are available in advance but you are recommended to define your favorite layout yourself. Just `make` with `KEYMAP` option like: +## MIDI functionalty - $ make -f Makefile. KEYMAP=(hasu|hhkb|spacefn|) +This is still a WIP, but check out `quantum/keymap_midi.c` to see what's happening. Enable from the Makefile. -You can omit `-f` option when you use `Makefile`. `Makefile` is used for **Pro2 and Pro**, `Makefile.jp` fits for **JP** model and `Makefile.rn42` supports Bluetooth module **RN-42**. `Makefile.pjrc` uses **PJRC** as output protocol instead of **LUFA**. +## Bluetooth functionality +This requires [some hardware changes](https://www.reddit.com/r/MechanicalKeyboards/comments/3psx0q/the_planck_keyboard_with_bluetooth_guide_and/?ref=search_posts), but can be enabled via the Makefile. The firmware will still output characters via USB, so be aware of this when charging via a computer. It would make sense to have a switch on the Bluefruit to turn it off at will. -### Program -First, push reset button on board to start bootloader. +## Building -This command programs the controller with [dfu-programmer] if the tool is installed and configured properly. +Download or clone the whole firmware and navigate to the keyboard/planck folder. Once your dev env is setup, you'll be able to type `make` to generate your .hex - you can then use `make dfu` to program your PCB once you hit the reset button. - $ make -f Makefile. KEYMAP= dfu +Depending on which keymap you would like to use, you will have to compile slightly differently. -Or you can also use [FLIP] command to program. Also the tool should be installed and configured properly. FLIP GUI application is also available. +### Default +To build with the default keymap, simply run `make`. - $ make -f Makefile. KEYMAP= flip +### Other Keymaps +Several version of keymap are available in advance but you are recommended to define your favorite layout yourself. To define your own keymap create a file in the keymaps folder named `.c` and see keymap document (you can find in top README.md) and existent keymap files. -Use [Teensy Loader] if your controller is Teensy/Teensy++. - - -##Keymap -To define your own keymap create a file in the keymaps folder named `.c` and see keymap document (you can find in top README.md) and existent keymap files. - - -##Hardware -You have some options for hardware. Development boards with USB AVR family(ATMega32U4, AT90USB1286) like Teensy will work while MegaAVR with [V-USB] library is also cheaper option for DIY. - -###1. TMK Alt Controller Board -Design files are available at [Keyboard Controller Board for HHKB(KiCad project)](https://github.com/tmk/HHKB_controller) and see [Controller Distribution thread](http://geekhack.org/index.php?topic=56494.0) if you get an assembled one. - - -###2. PJRC Teensy -See [this thread](http://geekhack.org/index.php?topic=57008.0). - - -###3. V-USB version -See [V-USB controller for HHKB](doc/V-USB.md). - - -[LUFA]: http://www.fourwalledcubicle.com/LUFA.php -[PJRC]: http://www.pjrc.com/teensy/usb_keyboard.html -[dfu-programmer]: http://dfu-programmer.sourceforge.net/ -[FLIP]: http://www.atmel.com/tools/FLIP.aspx -[Teensy Loader]: http://www.pjrc.com/teensy/loader.html -[V-USB]: http://www.obdev.at/products/vusb/index.html +To build the firmware binary hex file with a keymap just do `make` with `KEYMAP` option like: +``` +$ make KEYMAP=[default|jack|] +``` +Keymaps follow the format **__\.c__** and are stored in the `keymaps` folder. diff --git a/keyboard/hhkb/config.h b/keyboard/hhkb/config.h index c0acc0a7edb..ee66e44571f 100644 --- a/keyboard/hhkb/config.h +++ b/keyboard/hhkb/config.h @@ -1,5 +1,5 @@ /* -Copyright 2011 Jun Wako +Copyright 2012 Jun Wako This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -18,43 +18,43 @@ along with this program. If not, see . #ifndef CONFIG_H #define CONFIG_H +#include "config_common.h" +/* USB Device descriptor parameter */ #define VENDOR_ID 0xFEED #define PRODUCT_ID 0xCAFE #define DEVICE_VER 0x0104 -#define MANUFACTURER t.m.k. +#define MANUFACTURER q.m.k #define PRODUCT HHKB mod -#define DESCRIPTION t.m.k. keyboard firmware for HHKB mod +#define DESCRIPTION q.m.k keyboard firmware for HHKB - -/* matrix size */ -#ifdef HHKB_JP -# define MATRIX_ROWS 16 -#else -# define MATRIX_ROWS 8 -#endif +/* key matrix size */ +#define MATRIX_ROWS 8 #define MATRIX_COLS 8 +#define TAPPING_TERM 200 + +/* number of backlight levels */ +#define BACKLIGHT_LEVELS 3 + +/* Set 0 if debouncing isn't needed */ +#define DEBOUNCE 5 + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +//#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +//#define LOCKING_RESYNC_ENABLE /* key combination for command */ -#define IS_COMMAND() (keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) - - -/* period of tapping(ms) */ -#define TAPPING_TERM 300 -/* tap count needed for toggling a feature */ -#define TAPPING_TOGGLE 5 -/* Oneshot timeout(ms) */ -#define ONESHOT_TIMEOUT 300 - -/* Boot Magic salt key: Space */ -#define BOOTMAGIC_KEY_SALT KC_SPACE - +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) /* * Feature disable options * These options are also useful to firmware size reduction. - */ +*/ + /* disable debug print */ //#define NO_DEBUG diff --git a/keyboard/hhkb/config_rn42.h b/keyboard/hhkb/config_rn42.h deleted file mode 100644 index 21e73f1c531..00000000000 --- a/keyboard/hhkb/config_rn42.h +++ /dev/null @@ -1,112 +0,0 @@ -/* -Copyright 2011 Jun Wako - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#ifndef CONFIG_H -#define CONFIG_H - - -#define VENDOR_ID 0xFEED -#define PRODUCT_ID 0x4242 -#define DEVICE_VER 0x0104 -#define MANUFACTURER t.m.k. -#define PRODUCT HHKB mod -#define DESCRIPTION t.m.k. keyboard firmware for HHKB mod - - -/* matrix size */ -#ifdef HHKB_JP -# define MATRIX_ROWS 16 -#else -# define MATRIX_ROWS 8 -#endif -#define MATRIX_COLS 8 - - -/* key combination for command */ -#define IS_COMMAND() (keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) - - -/* period of tapping(ms) */ -#define TAPPING_TERM 300 -/* tap count needed for toggling a feature */ -#define TAPPING_TOGGLE 5 -/* Oneshot timeout(ms) */ -#define ONESHOT_TIMEOUT 300 - -/* Boot Magic salt key: Space */ -#define BOOTMAGIC_KEY_SALT KC_FN6 - -/* power control of key switch board */ -#define HHKB_POWER_SAVING - -/* - * Hardware Serial(UART) - * Baud rate are calculated with round off(+0.5). - */ -#ifdef __AVR_ATmega32U4__ - /* iom32u4.h has no definition of UCSR1D. copy from iom32u2.h */ - #define UCSR1D _SFR_MEM8(0xCB) - #define RTSEN 0 - #define CTSEN 1 - - #define SERIAL_UART_BAUD 115200 - #define SERIAL_UART_DATA UDR1 - #define SERIAL_UART_UBRR ((F_CPU/(16.0*SERIAL_UART_BAUD)-1+0.5)) - #define SERIAL_UART_RXD_VECT USART1_RX_vect - #define SERIAL_UART_TXD_READY (UCSR1A&(1<>8); /* baud rate */ \ - UCSR1B |= (1< select row 0-7 PB1 output - 7 7 8 HC4051 C(bit2)/ PB2 output - 8 8 9 LS145 A(bit0)\ PB3 output - 9 9 10 LS145 B(bit1) > select column 0-7 PB4 output - 10 10 11 LS145 C(bit2)/ PB5 output - 11 11 12 LS145 ~D(enable) Low(0) enables selected column PB6 output - 12 12 13 GND GND - 13 13 14 GND GND - 15 GND - 14 HC4051(Z2) ~Enable of Z2 row0-7 PC6 - 15 HC4051(Z3) ~Enable of Z3 row8-15 PC7 - - NOTE: Probably HYS changes threshold for upstroke and makes hysteresis in the result. - NOTE: HYS should be given High(1) when previous KEY state is Low(0). - NOTE: 1KOhm didn't work as pullup resistor on KEY. AVR internal pullup or 10KOhm resistor was OK. - NOTE: JP has two HC4051(Z2,Z3) and line 5, 6 and 7 are connected to both of them. - - (HHKB_connector.jpg) - - -Keyswitch matrix ----------------- -HHKB switch matrix is ghost-free and bounce-free. - - Pro/Pro2(8x8): - COL 0 1 2 3 4 5 6 7 - ROW --------------------------------------------------------------- - 0| 2 q w s a z x c - 1| 3 4 r e d f v b - 2| 5 6 y t g h n _NONE_ - 3| 1 Esc Tab Control LShift LAlt LMeta Space - 4| 7 8 u i k j m _NONE_ - 5| \ ` Delete Return Fn RShift RAlt RMeta - 6| 9 0 o p ; l , _NONE_ - 7| - + ] [ ' / . _NONE_ - - - JP(16x8): - COL 0 1 2 3 4 5 6 7 - ROW --------------------------------------------------------------- - 0| ESC TAB LFn LShift LCtrl - 1| 4 E MuHKN C D - 2| 3 W LAlt X S - 3| 1 HHK - 4| - 5| 5 R V F - 6| 2 Q LGui Z A - 7| 6 T Space B G - 8| 9 I Kana , K - 9| 8 U Henkan M J - A| 7 Y N H - B| 0 O RAlt . L - C| BS Right RShift Enter - D| \ [ Down Up ] - E| - P RFn / ; - F| ~ @ Left Ro : - - -Matrix diagram: - - Pro/Pro2: - +-------------------------+-+-+-+-+-+-+-+ Vcc - |bias control? - - - - - - - - --- - | 3.9K*8 R R R R R R R R | - +--------^+ +--------+ - - - - - - - - | - | 2| | HC4051 <0-------|-|-|-|-|-|-|-|--|R|-+ - | |capa. | <1-------|-|-|-|-|-|-|-|--|R|-+ - | TP1684 |sense | <2-------|-|-|-|-|-|-|-|--|R|-+ - | 11<------| <3-------|-|-|-|-|-|-|-|--|R|-+ - | | | <4-------|-|-|-|-|-|-|-|--|R|-+ - | | | <5-------|-|-|-|-|-|-|-|--|R|-+ - | <-+ | <6-------|-|-|-|-|-|-|-|--|R|-+ - | 1 4 | | | <7-------|-|-|-|-|-|-|-|--|R|-+ - +---V---^-+ | +-^-^-^--+ 0 1 2 3 4 5 6 7 33K*8 - KEY HYS | A B C +-----------------+ - | | +-^----+ | | | | LS145 | - Vcc | | |BU9831| | | | +-^--^--^--^------+ - --- | | +------+ | | | A B C D +-------+ - | | | | | | | | | | | | - 1-3 4 5 6 7 8 9 10 11 12 13-15 Pro | - 1-2 3 4 5 6 7 8 9 10 11 12-13 Pro2| - +--------------------------------------------------+ | - | connector | --- - +--------------------------------------------------+ GND - - - JP: - +-----------------------------+-+-+-+-+ Vcc - |bias control? - - - - - --- - | 3.9K*5 R R R R R | - +--------^+ +--------+ - - - - - | - | | | HC4051 <0-----------|-|-|-|-|----|R|-+ - | |capa. | Z2 <1-----------|-|-|-|-|----|R|-+ - | TP1684 |sense | <2-----------|-|-|-|-|----|R|-+ - | <---+--| <3-----------|-|-|-|-|----|R|-+ - | | | | <4-----------|-|-|-|-|----|R|-+ - | | ~En| <5-----------|-|-|-|-|----|R|-+ - | | +----> <6-----------|-|-|-|-|----|R|-+ - | | | | | A B C <7-----------|-|-|-|-|----|R|-+ - +---V---^-+ | | +-^-^-^--+ | | | | | | - KEY HYS | | | | | | | | | | | - | | | | +--------+ | | | | | | - | | | | | HC4051 <8-----------|-|-|-|-|----|R|-+ - | | | | | Z3 <9-----------|-|-|-|-|----|R|-+ - | | | +--| Prescaler-------> System Clock - | - +---------------------> USB PLL - -Design Decision: Install 16MHz crystal on board with using clock rescaler. diff --git a/keyboard/hhkb/doc/V-USB.md b/keyboard/hhkb/doc/V-USB.md deleted file mode 100644 index 7ae86f452f0..00000000000 --- a/keyboard/hhkb/doc/V-USB.md +++ /dev/null @@ -1,39 +0,0 @@ -V-USB controller for HHKB -========================= -Not supported actively any more. - -## Build -Use `Makefile.vusb` for [V-USB] controller. - $ make -f Makefile.vusb - -##Hardware -###3. V-USB connection - +---+ +---------------+ - USB GND | | ATmega328p | - ~~~ C3 | | - 5V <-------+--------+---|Vcc,AVCC | HHKB pro pro2 - R1 | | ~~~~~~~~ ~~~~ - D- <----+--+-----R2-----|INT1 PB2-4|------->ROW (6-8) (5-7) - D+ <----|---+----R3-----|INT0 PC0-2|------->COL (9-11) (8-10) - Z1 Z2 | PC3|------->ENABLE (12) (11) - GND<----+---+-----------|GND PB0|<-------KEY (4) (3) - | PB1|------->PREV (5) (4) - | | - GND+-C2--+--|XTAL1 RXD|------->Debug Console - X1 | TXD|<-------Debug Console - GND+-C3--+--|XTAL2 RST|---SW--+GND - +---------------+ - R1: 1.5K Ohm - R2,R3: 68 Ohm - Z1,Z2: Zener 3.6V - C1,C2: 22pF - C3: 0.1uF - X1: Crystal 12MHz - SW: Push Switch(for bootloader) - -- NOTE: See [V-USB] documentation for more detail of hardware and the USB stack. -- NOTE: [USBaspLoader] is very useful for firmware update. - - -[V-USB]: http://www.obdev.at/products/vusb/index.html -[USBaspLoader]: http://www.obdev.at/products/vusb/usbasploader.html diff --git a/keyboard/hhkb_qmk/hhkb_qmk.c b/keyboard/hhkb/hhkb.c similarity index 95% rename from keyboard/hhkb_qmk/hhkb_qmk.c rename to keyboard/hhkb/hhkb.c index 36dc3f29dbe..6897026c6c2 100644 --- a/keyboard/hhkb_qmk/hhkb_qmk.c +++ b/keyboard/hhkb/hhkb.c @@ -1,4 +1,4 @@ -#include "hhkb_qmk.h" +#include "hhkb.h" __attribute__ ((weak)) void matrix_init_user(void) { diff --git a/keyboard/hhkb_qmk/hhkb_qmk.h b/keyboard/hhkb/hhkb.h similarity index 97% rename from keyboard/hhkb_qmk/hhkb_qmk.h rename to keyboard/hhkb/hhkb.h index 1bac33c2de2..5e93b1dd1bf 100644 --- a/keyboard/hhkb_qmk/hhkb_qmk.h +++ b/keyboard/hhkb/hhkb.h @@ -1,5 +1,5 @@ -#ifndef HHKB_QMK_H -#define HHKB_QMK_H +#ifndef HHKB_H +#define HHKB_H #include "matrix.h" #include "keymap_common.h" diff --git a/keyboard/hhkb/keymap_common.c b/keyboard/hhkb/keymap_common.c deleted file mode 100644 index e938fb62708..00000000000 --- a/keyboard/hhkb/keymap_common.c +++ /dev/null @@ -1,33 +0,0 @@ -/* -Copyright 2012,2013 Jun Wako - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ -#include -#include "action.h" -#include -#include "keymap_common.h" - - -/* translates key to keycode */ -uint8_t keymap_key_to_keycode(uint8_t layer, keypos_t key) -{ - return pgm_read_byte(&keymaps[(layer)][(key.row)][(key.col)]); -} - -/* translates Fn keycode to action */ -action_t keymap_fn_to_action(uint8_t keycode) -{ - return (action_t){ .code = pgm_read_word(&fn_actions[FN_INDEX(keycode)]) }; -} diff --git a/keyboard/hhkb/keymap_common.h b/keyboard/hhkb/keymap_common.h deleted file mode 100644 index 3622665f3ad..00000000000 --- a/keyboard/hhkb/keymap_common.h +++ /dev/null @@ -1,84 +0,0 @@ -/* -Copyright 2012,2013 Jun Wako - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ -#ifndef KEYMAP_COMMON_H -#define KEYMAP_COMMON_H - -#include -#include -#include "keycode.h" -#include "action.h" -#include "action_code.h" -#include "action_layer.h" -#include "action_macro.h" -#include "action_util.h" -#include "report.h" -#include "host.h" -#include "print.h" -#include "debug.h" -#include "keymap.h" - - -extern const uint8_t keymaps[][MATRIX_ROWS][MATRIX_COLS]; -extern const uint16_t fn_actions[]; - - -#define KEYMAP( \ - K31, K30, K00, K10, K11, K20, K21, K40, K41, K60, K61, K70, K71, K50, K51, \ - K32, K01, K02, K13, K12, K23, K22, K42, K43, K62, K63, K73, K72, K52, \ - K33, K04, K03, K14, K15, K24, K25, K45, K44, K65, K64, K74, K53, \ - K34, K05, K06, K07, K16, K17, K26, K46, K66, K76, K75, K55, K54, \ - K35, K36, K37, K57, K56 \ -) \ -{ \ - { KC_##K00, KC_##K01, KC_##K02, KC_##K03, KC_##K04, KC_##K05, KC_##K06, KC_##K07 }, \ - { KC_##K10, KC_##K11, KC_##K12, KC_##K13, KC_##K14, KC_##K15, KC_##K16, KC_##K17 }, \ - { KC_##K20, KC_##K21, KC_##K22, KC_##K23, KC_##K24, KC_##K25, KC_##K26, KC_NO }, \ - { KC_##K30, KC_##K31, KC_##K32, KC_##K33, KC_##K34, KC_##K35, KC_##K36, KC_##K37 }, \ - { KC_##K40, KC_##K41, KC_##K42, KC_##K43, KC_##K44, KC_##K45, KC_##K46, KC_NO }, \ - { KC_##K50, KC_##K51, KC_##K52, KC_##K53, KC_##K54, KC_##K55, KC_##K56, KC_##K57 }, \ - { KC_##K60, KC_##K61, KC_##K62, KC_##K63, KC_##K64, KC_##K65, KC_##K66, KC_NO }, \ - { KC_##K70, KC_##K71, KC_##K72, KC_##K73, KC_##K74, KC_##K75, KC_##K76, KC_NO } \ -} - - -#define KEYMAP_JP( \ - K02, K32, K62, K22, K12, K52, K72, KA2, K92, K82, KB2, KE2, KF2, KD2, KC2, \ - K03, K63, K23, K13, K53, K73, KA3, K93, K83, KB3, KE3, KF3, KD3, \ - K06, K66, K26, K16, K56, K76, KA6, K96, K86, KB6, KE6, KF6, KD6, KC6, \ - K05, K65, K25, K15, K55, K75, KA5, K95, K85, KB5, KE5, KF5, KD5, KC5, \ - K04, K34, K64, K24, K14, K74, K94, K84, KB4, KE4, KF4, KD4, KC4 \ -) \ -{ \ - { KC_NO, KC_NO, KC_##K02, KC_##K03, KC_##K04, KC_##K05, KC_##K06, KC_NO }, \ - { KC_NO, KC_NO, KC_##K12, KC_##K13, KC_##K14, KC_##K15, KC_##K16, KC_NO }, \ - { KC_NO, KC_NO, KC_##K22, KC_##K23, KC_##K24, KC_##K25, KC_##K26, KC_NO }, \ - { KC_NO, KC_NO, KC_##K32, KC_NO, KC_##K34, KC_NO, KC_NO, KC_NO }, \ - { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, \ - { KC_NO, KC_NO, KC_##K52, KC_##K53, KC_NO, KC_##K55, KC_##K56, KC_NO }, \ - { KC_NO, KC_NO, KC_##K62, KC_##K63, KC_##K64, KC_##K65, KC_##K66, KC_NO }, \ - { KC_NO, KC_NO, KC_##K72, KC_##K73, KC_##K74, KC_##K75, KC_##K76, KC_NO }, \ - { KC_NO, KC_NO, KC_##K82, KC_##K83, KC_##K84, KC_##K85, KC_##K86, KC_NO }, \ - { KC_NO, KC_NO, KC_##K92, KC_##K93, KC_##K94, KC_##K95, KC_##K96, KC_NO }, \ - { KC_NO, KC_NO, KC_##KA2, KC_##KA3, KC_NO, KC_##KA5, KC_##KA6, KC_NO }, \ - { KC_NO, KC_NO, KC_##KB2, KC_##KB3, KC_##KB4, KC_##KB5, KC_##KB6, KC_NO }, \ - { KC_NO, KC_NO, KC_##KC2, KC_NO, KC_##KC4, KC_##KC5, KC_##KC6, KC_NO }, \ - { KC_NO, KC_NO, KC_##KD2, KC_##KD3, KC_##KD4, KC_##KD5, KC_##KD6, KC_NO }, \ - { KC_NO, KC_NO, KC_##KE2, KC_##KE3, KC_##KE4, KC_##KE5, KC_##KE6, KC_NO }, \ - { KC_NO, KC_NO, KC_##KF2, KC_##KF3, KC_##KF4, KC_##KF5, KC_##KF6, KC_NO } \ -} - -#endif diff --git a/keyboard/hhkb/keymaps/default/compiled.hex b/keyboard/hhkb/keymaps/default/compiled.hex new file mode 100644 index 00000000000..b3af6952704 Binary files /dev/null and b/keyboard/hhkb/keymaps/default/compiled.hex differ diff --git a/keyboard/hhkb_qmk/keymaps/default.c b/keyboard/hhkb/keymaps/default/keymap.c similarity index 99% rename from keyboard/hhkb_qmk/keymaps/default.c rename to keyboard/hhkb/keymaps/default/keymap.c index bcd8ead377f..bd5dd8372d5 100644 --- a/keyboard/hhkb_qmk/keymaps/default.c +++ b/keyboard/hhkb/keymaps/default/keymap.c @@ -1,7 +1,7 @@ /* -*- eval: (turn-on-orgtbl); -*- * default HHKB Layout */ -#include "hhkb_qmk.h" +#include "hhkb.h" #define BASE 0 #define HHKB 1 diff --git a/keyboard/hhkb/keymaps/hasu.c b/keyboard/hhkb/keymaps/hasu.c deleted file mode 100644 index a5602ded315..00000000000 --- a/keyboard/hhkb/keymaps/hasu.c +++ /dev/null @@ -1,282 +0,0 @@ -/* - * Hasu: my personal keymap - */ -#include "keymap_common.h" - - -#ifdef KEYMAP_SECTION_ENABLE -const uint8_t keymaps[][MATRIX_ROWS][MATRIX_COLS] __attribute__ ((section (".keymap.keymaps"))) = { -#else -const uint8_t keymaps[][MATRIX_ROWS][MATRIX_COLS] PROGMEM = { -#endif - /* Layer 0: Default Layer - * ,-----------------------------------------------------------. - * |Esc| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =| \| `| - * |-----------------------------------------------------------| - * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]|Backs| - * |-----------------------------------------------------------| - * |Contro| A| S| D| F| G| H| J| K| L|Fn3| '|Fn6 | - * |-----------------------------------------------------------| - * |Fn7 | Z| X| C| V| B| N| M| ,| .|Fn2|Shift |Fn1| - * `-----------------------------------------------------------' - * |Gui|Alt | Fn4 |Fn5 |Gui| - * `-------------------------------------------' - */ - [0] = \ - KEYMAP(ESC, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, BSLS,GRV, \ - TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC,RBRC,BSPC, \ - LCTL,A, S, D, F, G, H, J, K, L, FN3, QUOT,FN6, \ - FN7, Z, X, C, V, B, N, M, COMM,DOT, FN2, RSFT,FN1, \ - LGUI,LALT, FN4, FN5, RGUI), - - /* Layer 1: HHKB mode[HHKB Fn] - * ,-----------------------------------------------------------. - * |Esc| F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12|Ins|Del| - * |-----------------------------------------------------------| - * |Caps | | | | | | | |Psc|Slk|Pus|Up | |Backs| - * |-----------------------------------------------------------| - * |Contro|VoD|VoU|Mut| | | *| /|Hom|PgU|Lef|Rig|Enter | - * |-----------------------------------------------------------| - * |Shift | | | | | | +| -|End|PgD|Dow|Shift | | - * `-----------------------------------------------------------' - * |Gui|Alt | Space |Alt |Gui| - * `-------------------------------------------' - */ - [1] = \ - KEYMAP(GRV, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, INS, DEL, \ - CAPS,NO, NO, NO, NO, NO, NO, NO, PSCR,SLCK,PAUS, UP, NO, BSPC, \ - LCTL,VOLD,VOLU,MUTE,NO, NO, PAST,PSLS,HOME,PGUP,LEFT,RGHT,ENT, \ - LSFT,NO, NO, NO, NO, NO, PPLS,PMNS,END, PGDN,DOWN,RSFT,TRNS, \ - LGUI,LALT, TRNS, RALT,RGUI), - - /* Layer 2: Vi mode[Slash] - * ,-----------------------------------------------------------. - * |Esc| F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12|Ins|Del| - * |-----------------------------------------------------------| - * |Tab |Hom|PgD|Up |PgU|End|Hom|PgD|PgUlEnd| | | |Backs| - * |-----------------------------------------------------------| - * |Contro| |Lef|Dow|Rig| |Lef|Dow|Up |Rig| | |Return | - * |-----------------------------------------------------------| - * |Shift | | | | | |Hom|PgD|PgUlEnd|Fn0|Shift | | - * `-----------------------------------------------------------' - * |Gui|Alt | Space |Alt |Gui| - * `-------------------------------------------' - */ - [2] = \ - KEYMAP(GRV, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, INS, DEL, \ - TAB, HOME,PGDN,UP, PGUP,END, HOME,PGDN,PGUP,END, NO, NO, NO, BSPC, \ - LCTL,NO, LEFT,DOWN,RGHT,NO, LEFT,DOWN,UP, RGHT,NO, NO, ENT, \ - LSFT,NO, NO, NO, NO, NO, HOME,PGDN,PGUP,END, FN2, RSFT,TRNS, \ - LGUI,LALT, SPC, RALT,RGUI), - - /* Layer 3: Mouse mode(IJKL)[Semicolon] - * ,-----------------------------------------------------------. - * |Esc| F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12|Ins|Del| - * |-----------------------------------------------------------| - * |Tab | | | | | |MwL|MwD|McU|MwU|MwR|Wbk|Wfr|Alt-T| - * |-----------------------------------------------------------| - * |Contro| | | | | |Mb2|McL|McD|McR|Fn | |Return | - * |-----------------------------------------------------------| - * |Shift | | | | |Mb3|Mb2|Mb1|Mb4|Mb5| |Shift | | - * `-----------------------------------------------------------' - * |Gui |Alt | Mb1 |Fn |Fn | - * `--------------------------------------------' - * Mc: Mouse Cursor / Mb: Mouse Button / Mw: Mouse Wheel - */ - [3] = \ - KEYMAP(GRV, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, INS, DEL, \ - FN8, NO, NO, NO, NO, NO, WH_L,WH_D,MS_U,WH_U,WH_R,FN9, FN10,FN8, \ - LCTL,ACL0,ACL1,ACL2,ACL2,NO, NO, MS_L,MS_D,MS_R,FN3, NO, ENT, \ - LSFT,NO, NO, NO, NO, BTN3,BTN2,BTN1,FN9, FN10,NO, RSFT,TRNS, \ - LGUI,LALT, BTN1, TRNS,TRNS), - - /* Layer 4: Mouse mode(IJKL)[Space] - * ,-----------------------------------------------------------. - * |Esc| F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12|Ins|Del| - * |-----------------------------------------------------------| - * |Tab | | | | | |MwL|MwD|McU|MwU|MwR|Wbk|Wfr|Alt-T| - * |-----------------------------------------------------------| - * |Contro| | | | | |Mb2|McL|McD|McR|Mb1| |Return | - * |-----------------------------------------------------------| - * |Shift | | | | |Mb3|Mb2|Mb1|Mb4|Mb5| |Shift | | - * `-----------------------------------------------------------' - * |Gui |Alt | Mb1 |Fn |Fn | - * `--------------------------------------------' - * Mc: Mouse Cursor / Mb: Mouse Button / Mw: Mouse Wheel - */ - [4] = \ - KEYMAP(GRV, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, INS, DEL, \ - FN8, NO, NO, NO, NO, NO, WH_L,WH_D,MS_U,WH_U,WH_R,BTN4,BTN5,FN8, \ - LCTL,VOLD,VOLU,MUTE,NO, NO, NO, MS_L,MS_D,MS_R,BTN1,NO, ENT, \ - LSFT,NO, NO, NO, NO, BTN3,BTN2,BTN1,FN9, FN10,NO, RSFT,TRNS, \ - LGUI,LALT, TRNS, TRNS,TRNS), - -#if 0 - /* Layer 3: Mouse mode(HJKL)[Semicolon] - * ,-----------------------------------------------------------. - * |Esc| F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12|Ins|Del| - * |-----------------------------------------------------------| - * |Tab | | | | | |MwL|MwD|MwU|MwR| | | |Backs| - * |-----------------------------------------------------------| - * |Contro| | | | | |McL|McD|McU|McR|Fn0| |Return | - * |-----------------------------------------------------------| - * |Shift | | | | |Mb3|Mb2|Mb1|Mb4|Mb5| |Shift | | - * `-----------------------------------------------------------' - * |Gui |Alt | Mb1 |Alt |Fn0| - * `--------------------------------------------' - * Mc: Mouse Cursor / Mb: Mouse Button / Mw: Mouse Wheel - */ - KEYMAP(GRV, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, INS, DEL, \ - TAB, NO, NO, NO, NO, NO, NO, WH_D,WH_U,RGHT,NO, NO, NO, BSPC, \ - LCTL,NO, ACL0,ACL1,ACL2,NO, MS_L,MS_D,MS_U,MS_R,TRNS,QUOT,ENT, \ - LSFT,NO, NO, NO, NO, BTN3,BTN2,BTN1,FN9, FN10,SLSH,RSFT,NO, \ - LGUI,LALT, BTN1, RALT,TRNS), - - /* Layer4: Mouse mode(HJKL)[Space] - * ,-----------------------------------------------------------. - * |Esc| F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12|Ins|Del| - * |-----------------------------------------------------------| - * |Tab | | | | | |MwL|MwD|MwU|MwR| |Wbk|Wfr|Alt-T| - * |-----------------------------------------------------------| - * |Contro| | | | | |McL|McD|McU|McR|Fn0| |Return | - * |-----------------------------------------------------------| - * |Shift | | | | |Mb3|Mb2|Mb1|Mb4|Mb5| |Shift | | - * `-----------------------------------------------------------' - * |Gui |Alt | Fn0 |Alt |Fn0| - * `--------------------------------------------' - * Mc: Mouse Cursor / Mb: Mouse Button / Mw: Mouse Wheel - */ - KEYMAP(GRV, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, INS, DEL, \ - FN8, NO, NO, NO, NO, NO, NO, WH_D,WH_U,RGHT,NO, FN9, FN10,FN8, \ - LCTL,NO, ACL0,ACL1,ACL2,NO, MS_L,MS_D,MS_U,MS_R,BTN1,NO, ENT, \ - LSFT,NO, NO, NO, NO, BTN3,BTN2,BTN1,FN9, FN10,NO, RSFT,NO, \ - LGUI,LALT, TRNS, RALT,RGUI), -#endif -#if 0 - /* Layer x: Matias half-qwerty keyboard style[Space] - * ,-----------------------------------------------------------. - * | -| 0| 9| 8| 7| 6| 5| 4| 3| 2| 1| | | |Esc| - * |-----------------------------------------------------------| - * |Backs| P| O| I| U| Y| T| R| E| W| Q| | |Tab | - * |-----------------------------------------------------------| - * |Contro| ;| L| K| J| H| G| F| D| S| A|Con|Control | - * |-----------------------------------------------------------| - * |Shift | /| .| ,| M| N| B| V| C| X| Z|Shift | | - * `-----------------------------------------------------------' - * |Gui |Alt | Fn0 |Alt |Gui| - * `--------------------------------------------' - */ - KEYMAP(MINS,0, 9, 8, 7, 6, 5, 4, 3, 2, 1, NO, NO, NO, ESC, \ - BSPC,P, O, I, U, Y, T, R, E, W, Q, NO, NO, TAB, \ - LCTL,SCLN,L, K, J, H, G, F, D, S, A, RCTL,RCTL, \ - LSFT,SLSH,DOT, COMM,M, N, B, V, C, X, Z, RSFT,NO, \ - LGUI,LALT, TRNS, RALT,RGUI), -#endif -}; - - - -/* id for user defined functions */ -enum function_id { - LSHIFT_LPAREN, -}; - -enum macro_id { - HELLO, - VOLUP, - ALT_TAB, -}; - - -/* - * Fn action definition - */ -#ifdef KEYMAP_SECTION_ENABLE -const uint16_t fn_actions[] __attribute__ ((section (".keymap.fn_actions"))) = { -#else -const uint16_t fn_actions[] PROGMEM = { -#endif - [0] = ACTION_DEFAULT_LAYER_SET(0), // Default layer(not used) - [1] = ACTION_LAYER_TAP_TOGGLE(1), // HHKB layer(toggle with 5 taps) - [2] = ACTION_LAYER_TAP_KEY(2, KC_SLASH), // Cursor layer with Slash* - [3] = ACTION_LAYER_TAP_KEY(3, KC_SCLN), // Mousekey layer with Semicolon* - [4] = ACTION_LAYER_TAP_KEY(4, KC_SPC), // Mousekey layer with Space - [5] = ACTION_LAYER_MOMENTARY(4), // Mousekey layer(IJKL) - [6] = ACTION_MODS_TAP_KEY(MOD_RCTL, KC_ENT), // RControl with tap Enter - [7] = ACTION_MODS_ONESHOT(MOD_LSFT), // Oneshot Shift - [8] = ACTION_MACRO(ALT_TAB), // Application switching - [9] = ACTION_MODS_KEY(MOD_LALT, KC_LEFT), - [10] = ACTION_MODS_KEY(MOD_LALT, KC_RIGHT), - -// [x] = ACTION_LMOD_TAP_KEY(KC_LCTL, KC_BSPC), // LControl with tap Backspace -// [x] = ACTION_LMOD_TAP_KEY(KC_LCTL, KC_ESC), // LControl with tap Esc -// [x] = ACTION_FUNCTION_TAP(LSHIFT_LPAREN), // Function: LShift with tap '(' -// [x] = ACTION_MACRO(HELLO), // Macro: say hello -// [x] = ACTION_MACRO(VOLUP), // Macro: media key -}; - - -/* - * Macro definition - */ -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - switch (id) { - case HELLO: - return (record->event.pressed ? - MACRO( I(0), T(H), T(E), T(L), T(L), W(255), T(O), END ) : - MACRO_NONE ); - case VOLUP: - return (record->event.pressed ? - MACRO( D(VOLU), U(VOLU), END ) : - MACRO_NONE ); - case ALT_TAB: - return (record->event.pressed ? - MACRO( D(LALT), D(TAB), END ) : - MACRO( U(TAB), END )); - } - return MACRO_NONE; -} - - - -/* - * user defined action function - */ -void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - if (record->event.pressed) dprint("P"); else dprint("R"); - dprintf("%d", record->tap.count); - if (record->tap.interrupted) dprint("i"); - dprint("\n"); - - switch (id) { - case LSHIFT_LPAREN: - // Shift parentheses example: LShft + tap '(' - // http://stevelosh.com/blog/2012/10/a-modern-space-cadet/#shift-parentheses - // http://geekhack.org/index.php?topic=41989.msg1304899#msg1304899 - if (record->event.pressed) { - if (record->tap.count > 0 && !record->tap.interrupted) { - if (record->tap.interrupted) { - dprint("tap interrupted\n"); - register_mods(MOD_BIT(KC_LSHIFT)); - } - } else { - register_mods(MOD_BIT(KC_LSHIFT)); - } - } else { - if (record->tap.count > 0 && !(record->tap.interrupted)) { - add_weak_mods(MOD_BIT(KC_LSHIFT)); - send_keyboard_report(); - register_code(KC_9); - unregister_code(KC_9); - del_weak_mods(MOD_BIT(KC_LSHIFT)); - send_keyboard_report(); - record->tap.count = 0; // ad hoc: cancel tap - } else { - unregister_mods(MOD_BIT(KC_LSHIFT)); - } - } - break; - } -} diff --git a/keyboard/hhkb/keymaps/hhkb.c b/keyboard/hhkb/keymaps/hhkb.c deleted file mode 100644 index 86ad0f5eee0..00000000000 --- a/keyboard/hhkb/keymaps/hhkb.c +++ /dev/null @@ -1,95 +0,0 @@ -/* - * HHKB Layout - */ -#include "keymap_common.h" - - -#ifdef KEYMAP_SECTION_ENABLE -const uint8_t keymaps[][MATRIX_ROWS][MATRIX_COLS] __attribute__ ((section (".keymap.keymaps"))) = { -#else -const uint8_t keymaps[][MATRIX_ROWS][MATRIX_COLS] PROGMEM = { -#endif - /* Layer 0: Default Layer - * ,-----------------------------------------------------------. - * |Esc| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =| \| `| - * |-----------------------------------------------------------| - * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]|Backs| - * |-----------------------------------------------------------| - * |Contro| A| S| D| F| G| H| J| K| L| ;| '|Enter | - * |-----------------------------------------------------------| - * |Shift | Z| X| C| V| B| N| M| ,| .| /|Shift |Fn0| - * `-----------------------------------------------------------' - * |Alt|Gui | Space |Gui |Alt| - * `-------------------------------------------' - */ - KEYMAP(ESC, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, BSLS,GRV, \ - TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC,RBRC,BSPC, \ - LCTL,A, S, D, F, G, H, J, K, L, SCLN,QUOT,ENT, \ - LSFT,Z, X, C, V, B, N, M, COMM,DOT, SLSH,RSFT,FN0, \ - LALT,LGUI, SPC, RGUI,RALT), - - /* Layer 1: HHKB mode (HHKB Fn) - * ,-----------------------------------------------------------. - * |Pwr| F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12|Ins|Del| - * |-----------------------------------------------------------| - * |Caps | | | | | | | |Psc|Slk|Pus|Up | |Backs| - * |-----------------------------------------------------------| - * | |VoD|VoU|Mut| | | *| /|Hom|PgU|Lef|Rig|Enter | - * |-----------------------------------------------------------| - * | | | | | | | +| -|End|PgD|Dow| | | - * `-----------------------------------------------------------' - * | | | | | | - * `-------------------------------------------' - */ - KEYMAP(PWR, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, INS, DEL, \ - CAPS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,PSCR,SLCK,PAUS, UP, TRNS, BSPC, \ - TRNS,VOLD,VOLU,MUTE,TRNS,TRNS,PAST,PSLS,HOME,PGUP,LEFT,RGHT,PENT, \ - TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,PPLS,PMNS,END, PGDN,DOWN,TRNS,TRNS, \ - TRNS,TRNS, TRNS, TRNS,TRNS), -}; - - - -/* - * Fn action definition - */ -#ifdef KEYMAP_SECTION_ENABLE -const uint16_t fn_actions[] __attribute__ ((section (".keymap.fn_actions"))) = { - [0] = ACTION_LAYER_MOMENTARY(1), - [1] = ACTION_LAYER_MOMENTARY(2), - [2] = ACTION_LAYER_MOMENTARY(3), - [3] = ACTION_LAYER_MOMENTARY(4), - [4] = ACTION_LAYER_MOMENTARY(5), - [5] = ACTION_LAYER_MOMENTARY(6), - [6] = ACTION_LAYER_MOMENTARY(7), - [7] = ACTION_LAYER_TOGGLE(1), - [8] = ACTION_LAYER_TOGGLE(2), - [9] = ACTION_LAYER_TOGGLE(3), - [10] = ACTION_LAYER_TAP_TOGGLE(1), - [11] = ACTION_LAYER_TAP_TOGGLE(2), - [12] = ACTION_LAYER_TAP_TOGGLE(3), - [13] = ACTION_LAYER_TAP_KEY(1, KC_A), - [14] = ACTION_LAYER_TAP_KEY(2, KC_F), - [15] = ACTION_LAYER_TAP_KEY(3, KC_J), - [16] = ACTION_LAYER_TAP_KEY(4, KC_SPACE), - [17] = ACTION_LAYER_TAP_KEY(5, KC_SCOLON), - [18] = ACTION_LAYER_TAP_KEY(6, KC_QUOTE), - [19] = ACTION_LAYER_TAP_KEY(7, KC_SLASH), - [20] = ACTION_MODS_TAP_KEY(MOD_LSFT, KC_SPACE), - [21] = ACTION_MODS_TAP_KEY(MOD_LCTL, KC_SPACE), - [22] = ACTION_MODS_TAP_KEY(MOD_RCTL, KC_QUOTE), - [23] = ACTION_MODS_TAP_KEY(MOD_RCTL, KC_ENTER), - [24] = ACTION_MODS_TAP_KEY(MOD_LCTL, KC_ESC), - [25] = ACTION_MODS_TAP_KEY(MOD_LCTL, KC_BSPACE), - [26] = ACTION_MODS_ONESHOT(MOD_LCTL), - [27] = ACTION_MODS_TAP_KEY(MOD_LSFT, KC_ESC), - [28] = ACTION_MODS_TAP_KEY(MOD_LSFT, KC_BSPACE), - [29] = ACTION_MODS_ONESHOT(MOD_LSFT), - [30] = ACTION_MODS_TAP_KEY(MOD_RSFT, KC_ESC), - [31] = ACTION_MODS_TAP_KEY(MOD_RSFT, KC_BSPACE), -}; -#else -const uint16_t fn_actions[] PROGMEM = { - [0] = ACTION_LAYER_MOMENTARY(1), -}; -#endif diff --git a/keyboard/hhkb/keymaps/jp.c b/keyboard/hhkb/keymaps/jp.c deleted file mode 100644 index 48d0ee70ba1..00000000000 --- a/keyboard/hhkb/keymaps/jp.c +++ /dev/null @@ -1,50 +0,0 @@ -/* - * HHKB JP Layout - */ -#include "keymap_common.h" - - -#ifdef KEYMAP_SECTION_ENABLE -const uint8_t keymaps[][MATRIX_ROWS][MATRIX_COLS] __attribute__ ((section (".keymap.keymaps"))) = { -#else -const uint8_t keymaps[][MATRIX_ROWS][MATRIX_COLS] PROGMEM = { -#endif - /* Layer 0: Default Layer */ - KEYMAP_JP(ESC, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, JYEN,BSPC, \ - TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC,RBRC, \ - LCTL,A, S, D, F, G, H, J, K, L, SCLN,QUOT,BSLS,ENT, \ - LSFT,Z, X, C, V, B, N, M, COMM,DOT, SLSH,RO, UP, RSFT, \ - FN0, ZKHK,LGUI,LALT,MHEN, SPC, HENK,KANA,RALT,FN0, LEFT,DOWN,RGHT), - - /* Layer 1: HHKB mode (HHKB Fn) - * ,-----------------------------------------------------------. - * |Pwr| F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12|Ins|Del| - * |-----------------------------------------------------------| - * |Caps | | | | | | | |Psc|Slk|Pus|Up | | | - * |------------------------------------------------------` | - * | |VoD|VoU|Mut| | | *| /|Hom|PgU|Lef|Rig| | | - * |-----------------------------------------------------------| - * | | | | | | | +| -|End|PgD|Dow| | | | - * |-----------------------------------------------------------| - * | || | | | | | | | | || | | | - * `-----------------------------------------------------------' - */ - KEYMAP_JP(PWR, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, INS, DEL, \ - CAPS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,PSCR,SLCK,PAUS, UP, TRNS, \ - TRNS,VOLD,VOLU,MUTE,TRNS,TRNS,PAST,PSLS,HOME,PGUP,LEFT,RGHT,TRNS,PENT, \ - TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,PPLS,PMNS,END, PGDN,DOWN,TRNS,TRNS,TRNS, \ - TRNS,TRNS,TRNS,TRNS,TRNS, TRNS, TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS), -}; - - - -/* - * Fn action definition - */ -#ifdef KEYMAP_SECTION_ENABLE -const uint16_t fn_actions[] __attribute__ ((section (".keymap.fn_actions"))) = { -#else -const uint16_t fn_actions[] PROGMEM = { -#endif - [0] = ACTION_LAYER_MOMENTARY(1), -}; diff --git a/keyboard/hhkb/keymaps/lxol/compiled.hex b/keyboard/hhkb/keymaps/lxol/compiled.hex new file mode 100644 index 00000000000..63d3691c4d6 Binary files /dev/null and b/keyboard/hhkb/keymaps/lxol/compiled.hex differ diff --git a/keyboard/hhkb_qmk/keymaps/lxol.c b/keyboard/hhkb/keymaps/lxol/keymap.c similarity index 99% rename from keyboard/hhkb_qmk/keymaps/lxol.c rename to keyboard/hhkb/keymaps/lxol/keymap.c index 3256fda516b..ccf1e07042f 100644 --- a/keyboard/hhkb_qmk/keymaps/lxol.c +++ b/keyboard/hhkb/keymaps/lxol/keymap.c @@ -1,7 +1,7 @@ /* -*- eval: (turn-on-orgtbl); -*- * lxol HHKB Layout */ -#include "hhkb_qmk.h" +#include "hhkb.h" #define BASE 0 #define WIN 1 diff --git a/keyboard/hhkb/keymaps/spacefn.c b/keyboard/hhkb/keymaps/spacefn.c deleted file mode 100644 index deff920ae28..00000000000 --- a/keyboard/hhkb/keymaps/spacefn.c +++ /dev/null @@ -1,116 +0,0 @@ -/* - * SpaceFN - * http://geekhack.org/index.php?topic=51069.0 - */ -#include "keymap_common.h" - - -const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - /* Layer 0: Default Layer - * ,-----------------------------------------------------------. - * |Esc| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =| `|BSp| - * |-----------------------------------------------------------| - * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \| - * |-----------------------------------------------------------| - * |Contro| A| S| D| F| G| H| J| K| L| ;| '|Enter | - * |-----------------------------------------------------------| - * |Shift | Z| X| C| V| B| N| M| ,| .| /|Shift |Fn0| - * `-----------------------------------------------------------' - * |Gui|Alt | SpaceFN |Alt |Gui| - * `-------------------------------------------' - */ - KEYMAP(ESC, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, GRV, BSPC, \ - TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC,RBRC,BSLS, \ - LCTL,A, S, D, F, G, H, J, K, L, SCLN,QUOT,ENT, \ - LSFT,Z, X, C, V, B, N, M, COMM,DOT, SLSH,RSFT,FN0, \ - LGUI,LALT, FN1, RALT,RGUI), - - /* Layer 1: HHKB mode (HHKB Fn) - * ,-----------------------------------------------------------. - * |Pwr| F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12|Ins|Del| - * |-----------------------------------------------------------| - * |Caps | | | | | | | |Psc|Slk|Pus|Up | |Backs| - * |-----------------------------------------------------------| - * | |VoD|VoU|Mut| | | *| /|Hom|PgU|Lef|Rig|Enter | - * |-----------------------------------------------------------| - * | | | | | | | +| -|End|PgD|Dow| | | - * `-----------------------------------------------------------' - * | | | | | | - * `-------------------------------------------' - */ - KEYMAP(PWR, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, INS, DEL, \ - CAPS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,PSCR,SLCK,PAUS, UP, TRNS, BSPC, \ - TRNS,VOLD,VOLU,MUTE,TRNS,TRNS,PAST,PSLS,HOME,PGUP,LEFT,RGHT,PENT, \ - TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,PPLS,PMNS,END, PGDN,DOWN,TRNS,TRNS, \ - TRNS,TRNS, SPC, TRNS,TRNS), - - /* Layer 2: SpaceFN - * ,-----------------------------------------------------------. - * |` | F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12| |Del| - * |-----------------------------------------------------------| - * | | | |Esc| | | |Hom|Up |End|Psc|Slk|Pau|Ins | - * |-----------------------------------------------------------| - * | | | | | | |PgU|Lef|Dow|Rig| | | | - * |-----------------------------------------------------------| - * | | | | | |Spc|PgD|` |~ | | | | | - * `-----------------------------------------------------------' - * | | | | | | - * `-------------------------------------------' - */ - KEYMAP(GRV, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, TRNS,DEL, \ - TRNS,TRNS,TRNS,ESC, TRNS,TRNS,TRNS,HOME,FN3, END, PSCR,SLCK,PAUS,INS, \ - TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,PGUP,LEFT,DOWN,RGHT,TRNS,TRNS,TRNS, \ - TRNS,TRNS,TRNS,TRNS,TRNS,SPC, PGDN,GRV, FN2, TRNS,TRNS,TRNS,NO, \ - TRNS,TRNS, TRNS, TRNS,TRNS), -}; - - -/* - * user defined action function - */ -enum function_id { - CTRL_SPACE_I, // Ctrl + Up(SpaceFN) -> PgUp -}; - -void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) -{ -# define MODS_CTRL_MASK (MOD_BIT(KC_LCTRL)|MOD_BIT(KC_RCTRL)) - static uint8_t ctrl_space_i_prev_ctrl; - - switch (id) { - // Ctrl + Up(SpaceFN) -> PgUp - case CTRL_SPACE_I: - ctrl_space_i_prev_ctrl = get_mods()&MODS_CTRL_MASK; - if (record->event.pressed) { - if (ctrl_space_i_prev_ctrl) { - del_mods(ctrl_space_i_prev_ctrl); // remove Ctrl - add_key(KC_PGUP); - send_keyboard_report(); // send PgUp without Ctrl - add_mods(ctrl_space_i_prev_ctrl); // return Ctrl but not sent - } else { - add_key(KC_UP); - send_keyboard_report(); - } - } else { - if (ctrl_space_i_prev_ctrl) { - del_key(KC_PGUP); - send_keyboard_report(); - } else { - del_key(KC_UP); - send_keyboard_report(); - } - } - break; - } -} - - -/* - * Fn action definition - */ -const uint16_t PROGMEM fn_actions[] = { - [0] = ACTION_LAYER_MOMENTARY(1), - [1] = ACTION_LAYER_TAP_KEY(2, KC_SPACE), - [2] = ACTION_MODS_KEY(MOD_LSFT, KC_GRV), // tilde - [3] = ACTION_FUNCTION(CTRL_SPACE_I), // Ctrl + Up(SpaceFN) -> PgUp -}; diff --git a/keyboard/hhkb/led.c b/keyboard/hhkb/led.c deleted file mode 100644 index 8a08fe27fcf..00000000000 --- a/keyboard/hhkb/led.c +++ /dev/null @@ -1,33 +0,0 @@ -/* -Copyright 2011 Jun Wako - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#include -#include "stdint.h" -#include "led.h" - - -/* HHKB has no LEDs */ -void led_set(uint8_t usb_led) -{ - if (usb_led & (1<= 0; --r) { + count += bitpop16(matrix_get_row(r)); + } + return count; +} + void matrix_power_up(void) { KEY_POWER_ON(); } diff --git a/keyboard/hhkb/not_supported/Makefile.iwrap b/keyboard/hhkb/not_supported/Makefile.iwrap deleted file mode 100644 index 1614c21d75b..00000000000 --- a/keyboard/hhkb/not_supported/Makefile.iwrap +++ /dev/null @@ -1,103 +0,0 @@ -# -# Makefile for iWRAP -# - - -# Target file name (without extension). -TARGET = hhkb_iwrap - -# Directory common source filess exist -TMK_DIR = ../../tmk_core - -# Directory keyboard dependent files exist -TARGET_DIR = . - -# keyboard dependent files -SRC = \ - keymap.c \ - matrix.c \ - led.c - -CONFIG_H = config_iwrap.h - - -# V-USB debug level: To use ps2_usart.c level must be 0 -# ps2_usart.c requires USART to receive PS/2 signal. -OPT_DEFS = -DDEBUG_LEVEL=0 - - -# MCU name, you MUST set this to match the board you are using -# type "make clean" after changing this, so all files will be rebuilt -MCU = atmega328p - - -# Processor frequency. -# Normally the first thing your program should do is set the clock prescaler, -# so your program will run at the correct speed. You should also set this -# variable to same clock speed. The _delay_ms() macro uses this, and many -# examples use this variable to calculate timings. Do not add a "UL" here. -F_CPU = 12000000 - - -# Boot Section Size in *bytes* -# Teensy halfKay 512 -# Teensy++ halfKay 1024 -# Atmel DFU loader 4096 -# LUFA bootloader 4096 -# USBaspLoader 2048 -OPT_DEFS += -DBOOTLOADER_SIZE=2048 - - -# Build Options -# comment out to disable the options. -# -BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration -MOUSEKEY_ENABLE = yes # Mouse keys -EXTRAKEY_ENABLE = yes # Audio control and System control -CONSOLE_ENABLE = yes # Console for debug -COMMAND_ENABLE = yes # Commands for debug and configuration -#NKRO_ENABLE = yes # USB Nkey Rollover - - - -#---------------- Programming Options -------------------------- -AVRDUDE = avrdude -# Type: avrdude -c ? to get a full listing. -AVRDUDE_PROGRAMMER = usbasp -AVRDUDE_PORT = -AVRDUDE_WRITE_FLASH = -U flash:w:$(TARGET).hex -#AVRDUDE_WRITE_EEPROM = -U eeprom:w:$(TARGET).eep - -# Uncomment the following if you want avrdude's erase cycle counter. -# Note that this counter needs to be initialized first using -Yn, -# see avrdude manual. -#AVRDUDE_ERASE_COUNTER = -y - -# Uncomment the following if you do /not/ wish a verification to be -# performed after programming the device. -#AVRDUDE_NO_VERIFY = -V - -# Increase verbosity level. Please use this when submitting bug -# reports about avrdude. See -# to submit bug reports. -#AVRDUDE_VERBOSE = -v -v - -#AVRDUDE_FLAGS = -p $(MCU) -P $(AVRDUDE_PORT) -c $(AVRDUDE_PROGRAMMER) -AVRDUDE_FLAGS = -p $(MCU) -c $(AVRDUDE_PROGRAMMER) -AVRDUDE_FLAGS += $(AVRDUDE_NO_VERIFY) -AVRDUDE_FLAGS += $(AVRDUDE_VERBOSE) -AVRDUDE_FLAGS += $(AVRDUDE_ERASE_COUNTER) - -PROGRAM_CMD = $(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM) - - - -# Search Path -VPATH += $(TARGET_DIR) -VPATH += $(TMK_DIR) - -include $(TMK_DIR)/protocol/iwrap.mk -# TODO: to be selectable: V-USB, LUFA or PJRC -#include $(TMK_DIR)/protocol/vusb.mk -include $(TMK_DIR)/common.mk -include $(TMK_DIR)/rules.mk diff --git a/keyboard/hhkb/not_supported/Makefile.vusb b/keyboard/hhkb/not_supported/Makefile.vusb deleted file mode 100644 index 1f8d84684b0..00000000000 --- a/keyboard/hhkb/not_supported/Makefile.vusb +++ /dev/null @@ -1,97 +0,0 @@ -# -# Makefile for V-USB -# - - -# Target file name (without extension). -TARGET = hhkb_vusb - -# Directory common source filess exist -TMK_DIR = ../../tmk_core - -# Directory keyboard dependent files exist -TARGET_DIR = . - -# keyboard dependent files -SRC = \ - keymap.c \ - matrix.c \ - led.c - -CONFIG_H = config_vusb.h - - -# V-USB debug level: To use ps2_usart.c level must be 0 -# ps2_usart.c requires USART to receive PS/2 signal. -OPT_DEFS = -DDEBUG_LEVEL=0 - - -# MCU name, you MUST set this to match the board you are using -# type "make clean" after changing this, so all files will be rebuilt -MCU = atmega328p -# avrdude doesn't know atmega168p -AVRDUDE_MCU = $(MCU) - - -# Processor frequency. -# Normally the first thing your program should do is set the clock prescaler, -# so your program will run at the correct speed. You should also set this -# variable to same clock speed. The _delay_ms() macro uses this, and many -# examples use this variable to calculate timings. Do not add a "UL" here. -F_CPU = 12000000 - - -# Build Options -# comment out to disable the options. -# -BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration -MOUSEKEY_ENABLE = yes # Mouse keys -EXTRAKEY_ENABLE = yes # Audio control and System control -CONSOLE_ENABLE = yes # Console for debug -COMMAND_ENABLE = yes # Commands for debug and configuration -#NKRO_ENABLE = yes # USB Nkey Rollover - - - -#---------------- Programming Options -------------------------- -AVRDUDE = avrdude -# Type: avrdude -c ? to get a full listing. -AVRDUDE_PROGRAMMER = usbasp -AVRDUDE_PORT = -AVRDUDE_WRITE_FLASH = -U flash:w:$(TARGET).hex -#AVRDUDE_WRITE_EEPROM = -U eeprom:w:$(TARGET).eep - -# Uncomment the following if you want avrdude's erase cycle counter. -# Note that this counter needs to be initialized first using -Yn, -# see avrdude manual. -#AVRDUDE_ERASE_COUNTER = -y - -# Uncomment the following if you do /not/ wish a verification to be -# performed after programming the device. -#AVRDUDE_NO_VERIFY = -V - -# Increase verbosity level. Please use this when submitting bug -# reports about avrdude. See -# to submit bug reports. -#AVRDUDE_VERBOSE = -v -v - -#AVRDUDE_FLAGS = -p $(AVRDUDE_MCU) -P $(AVRDUDE_PORT) -c $(AVRDUDE_PROGRAMMER) -AVRDUDE_FLAGS = -p $(AVRDUDE_MCU) -c $(AVRDUDE_PROGRAMMER) -AVRDUDE_FLAGS += $(AVRDUDE_NO_VERIFY) -AVRDUDE_FLAGS += $(AVRDUDE_VERBOSE) -AVRDUDE_FLAGS += $(AVRDUDE_ERASE_COUNTER) - -PROGRAM_CMD = $(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM) - - - -# Search Path -VPATH += $(TARGET_DIR) -VPATH += $(TMK_DIR) - -include $(TMK_DIR)/protocol/vusb.mk -include $(TMK_DIR)/common.mk -include $(TMK_DIR)/rules.mk - -debug-on: EXTRAFLAGS += -DDEBUG -debug-on: all diff --git a/keyboard/hhkb/not_supported/config_iwrap.h b/keyboard/hhkb/not_supported/config_iwrap.h deleted file mode 100644 index 747c755132a..00000000000 --- a/keyboard/hhkb/not_supported/config_iwrap.h +++ /dev/null @@ -1,54 +0,0 @@ -/* -Copyright 2011 Jun Wako - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#ifndef CONFIG_H -#define CONFIG_H - -#define VENDOR_ID 0xFEED -#define PRODUCT_ID 0xBEEA -// TODO: share these strings with usbconfig.h -// Edit usbconfig.h to change these. -#define MANUFACTURER t.m.k. -#define PRODUCT HHKB mod -#define DESCRIPTION t.m.k. keyboard firmware for HHKB mod - - -/* matrix size */ -#define MATRIX_ROWS 8 -#define MATRIX_COLS 8 - -/* key combination for command */ -#define IS_COMMAND() (keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) - -/* pins for Software UART */ -#define SUART_IN_PIN PINC -#define SUART_IN_BIT 5 -#define SUART_OUT_PORT PORTC -#define SUART_OUT_BIT 4 - - -#define DEBUG_LED 1 -#define DEBUG_LED_CONFIG (DDRD |= (1<<4)) -#define DEBUG_LED_OFF (PORTD |= (1<<4)) -#define DEBUG_LED_ON (PORTD &= ~(1<<4)) - -/* period of tapping(ms) */ -#define TAPPING_TERM 300 -/* tap count needed for toggling a feature */ -#define TAPPING_TOGGLE 5 - -#endif diff --git a/keyboard/hhkb/not_supported/config_vusb.h b/keyboard/hhkb/not_supported/config_vusb.h deleted file mode 100644 index 44f7acd6cdc..00000000000 --- a/keyboard/hhkb/not_supported/config_vusb.h +++ /dev/null @@ -1,38 +0,0 @@ -/* -Copyright 2011 Jun Wako - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#ifndef CONFIG_H -#define CONFIG_H - -#define VENDOR_ID 0xFEED -#define PRODUCT_ID 0xC0FE -// TODO: share these strings with usbconfig.h -// Edit usbconfig.h to change these. -#define MANUFACTURER t.m.k. -#define PRODUCT HHKB mod -#define DESCRIPTION t.m.k. keyboard firmware for HHKB mod - - -/* matrix size */ -#define MATRIX_ROWS 8 -#define MATRIX_COLS 8 - - -/* key combination for command */ -#define IS_COMMAND() (keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) - -#endif diff --git a/keyboard/hhkb/not_supported/iwrap.txt b/keyboard/hhkb/not_supported/iwrap.txt deleted file mode 100644 index 20a2420a0b2..00000000000 --- a/keyboard/hhkb/not_supported/iwrap.txt +++ /dev/null @@ -1,32 +0,0 @@ - -iWRAP ------ - +---------------+ WT12 - 5V | ATmega168 | 5V/3.3V~~~~ - +-----+---|Vcc,AVCC PC4|---/--->iWRAP(RxD) -USB | C3 | PC5|<--/----iWRAP(TxD) -~~~ | + | | -5V <--BATT + GND | | HHKB - R1 | | ~~~~ -D- <----+-----+--R2-----|INT1 PB2-4|------->ROW(6-8) -D+ <----|---+----R3-----|INT0 PC0-2|------->COL(9-11) - Z1 Z2 | PC3|------->ENABLE(12) -GND<----+---+-----------|GND PB0|<-------KEY(4) - | PB1|------->PREV(5) - | | - GND+-C2--+--|XTAL1 RXD|------->Debug Console - X1 | TXD|<-------Debug Console - GND+-C3--+--|XTAL2 RST|---SW--+GND - +---------------+ - -R1: 1.5K Ohm -R2,R3: 68 Ohm -Z1,Z2: Zener 3.6V -C1,C2: 22pF -C3: 0.1uF -X1: Crystal 12MHz -SW: Push Switch(Optional) -BATT: Li-Po Battery, Battery Charger and Voltage Regulator(5V and 3.3V). - - - diff --git a/keyboard/hhkb/not_supported/usbconfig.h b/keyboard/hhkb/not_supported/usbconfig.h deleted file mode 100644 index c3aad34bef4..00000000000 --- a/keyboard/hhkb/not_supported/usbconfig.h +++ /dev/null @@ -1,388 +0,0 @@ -/* Name: usbconfig.h - * Project: V-USB, virtual USB port for Atmel's(r) AVR(r) microcontrollers - * Author: Christian Starkjohann - * Creation Date: 2005-04-01 - * Tabsize: 4 - * Copyright: (c) 2005 by OBJECTIVE DEVELOPMENT Software GmbH - * License: GNU GPL v2 (see License.txt), GNU GPL v3 or proprietary (CommercialLicense.txt) - * This Revision: $Id: usbconfig-prototype.h 785 2010-05-30 17:57:07Z cs $ - */ - -#ifndef __usbconfig_h_included__ -#define __usbconfig_h_included__ - -#include "config_vusb.h" - -/* -General Description: -This file is an example configuration (with inline documentation) for the USB -driver. It configures V-USB for USB D+ connected to Port D bit 2 (which is -also hardware interrupt 0 on many devices) and USB D- to Port D bit 4. You may -wire the lines to any other port, as long as D+ is also wired to INT0 (or any -other hardware interrupt, as long as it is the highest level interrupt, see -section at the end of this file). -*/ - -/* ---------------------------- Hardware Config ---------------------------- */ - -#define USB_CFG_IOPORTNAME D -/* This is the port where the USB bus is connected. When you configure it to - * "B", the registers PORTB, PINB and DDRB will be used. - */ -#define USB_CFG_DMINUS_BIT 3 -/* This is the bit number in USB_CFG_IOPORT where the USB D- line is connected. - * This may be any bit in the port. - */ -#define USB_CFG_DPLUS_BIT 2 -/* This is the bit number in USB_CFG_IOPORT where the USB D+ line is connected. - * This may be any bit in the port. Please note that D+ must also be connected - * to interrupt pin INT0! [You can also use other interrupts, see section - * "Optional MCU Description" below, or you can connect D- to the interrupt, as - * it is required if you use the USB_COUNT_SOF feature. If you use D- for the - * interrupt, the USB interrupt will also be triggered at Start-Of-Frame - * markers every millisecond.] - */ -#define USB_CFG_CLOCK_KHZ (F_CPU/1000) -/* Clock rate of the AVR in kHz. Legal values are 12000, 12800, 15000, 16000, - * 16500, 18000 and 20000. The 12.8 MHz and 16.5 MHz versions of the code - * require no crystal, they tolerate +/- 1% deviation from the nominal - * frequency. All other rates require a precision of 2000 ppm and thus a - * crystal! - * Since F_CPU should be defined to your actual clock rate anyway, you should - * not need to modify this setting. - */ -#define USB_CFG_CHECK_CRC 0 -/* Define this to 1 if you want that the driver checks integrity of incoming - * data packets (CRC checks). CRC checks cost quite a bit of code size and are - * currently only available for 18 MHz crystal clock. You must choose - * USB_CFG_CLOCK_KHZ = 18000 if you enable this option. - */ - -/* ----------------------- Optional Hardware Config ------------------------ */ - -/* #define USB_CFG_PULLUP_IOPORTNAME D */ -/* If you connect the 1.5k pullup resistor from D- to a port pin instead of - * V+, you can connect and disconnect the device from firmware by calling - * the macros usbDeviceConnect() and usbDeviceDisconnect() (see usbdrv.h). - * This constant defines the port on which the pullup resistor is connected. - */ -/* #define USB_CFG_PULLUP_BIT 4 */ -/* This constant defines the bit number in USB_CFG_PULLUP_IOPORT (defined - * above) where the 1.5k pullup resistor is connected. See description - * above for details. - */ - -/* --------------------------- Functional Range ---------------------------- */ - -#define USB_CFG_HAVE_INTRIN_ENDPOINT 1 -/* Define this to 1 if you want to compile a version with two endpoints: The - * default control endpoint 0 and an interrupt-in endpoint (any other endpoint - * number). - */ -#define USB_CFG_HAVE_INTRIN_ENDPOINT3 1 -/* Define this to 1 if you want to compile a version with three endpoints: The - * default control endpoint 0, an interrupt-in endpoint 3 (or the number - * configured below) and a catch-all default interrupt-in endpoint as above. - * You must also define USB_CFG_HAVE_INTRIN_ENDPOINT to 1 for this feature. - */ -#define USB_CFG_EP3_NUMBER 3 -/* If the so-called endpoint 3 is used, it can now be configured to any other - * endpoint number (except 0) with this macro. Default if undefined is 3. - */ -/* #define USB_INITIAL_DATATOKEN USBPID_DATA1 */ -/* The above macro defines the startup condition for data toggling on the - * interrupt/bulk endpoints 1 and 3. Defaults to USBPID_DATA1. - * Since the token is toggled BEFORE sending any data, the first packet is - * sent with the oposite value of this configuration! - */ -#define USB_CFG_IMPLEMENT_HALT 0 -/* Define this to 1 if you also want to implement the ENDPOINT_HALT feature - * for endpoint 1 (interrupt endpoint). Although you may not need this feature, - * it is required by the standard. We have made it a config option because it - * bloats the code considerably. - */ -#define USB_CFG_SUPPRESS_INTR_CODE 0 -/* Define this to 1 if you want to declare interrupt-in endpoints, but don't - * want to send any data over them. If this macro is defined to 1, functions - * usbSetInterrupt() and usbSetInterrupt3() are omitted. This is useful if - * you need the interrupt-in endpoints in order to comply to an interface - * (e.g. HID), but never want to send any data. This option saves a couple - * of bytes in flash memory and the transmit buffers in RAM. - */ -#define USB_CFG_INTR_POLL_INTERVAL 10 -/* If you compile a version with endpoint 1 (interrupt-in), this is the poll - * interval. The value is in milliseconds and must not be less than 10 ms for - * low speed devices. - */ -#define USB_CFG_IS_SELF_POWERED 0 -/* Define this to 1 if the device has its own power supply. Set it to 0 if the - * device is powered from the USB bus. - */ -#define USB_CFG_MAX_BUS_POWER 100 -/* Set this variable to the maximum USB bus power consumption of your device. - * The value is in milliamperes. [It will be divided by two since USB - * communicates power requirements in units of 2 mA.] - */ -#define USB_CFG_IMPLEMENT_FN_WRITE 1 -/* Set this to 1 if you want usbFunctionWrite() to be called for control-out - * transfers. Set it to 0 if you don't need it and want to save a couple of - * bytes. - */ -#define USB_CFG_IMPLEMENT_FN_READ 0 -/* Set this to 1 if you need to send control replies which are generated - * "on the fly" when usbFunctionRead() is called. If you only want to send - * data from a static buffer, set it to 0 and return the data from - * usbFunctionSetup(). This saves a couple of bytes. - */ -#define USB_CFG_IMPLEMENT_FN_WRITEOUT 0 -/* Define this to 1 if you want to use interrupt-out (or bulk out) endpoints. - * You must implement the function usbFunctionWriteOut() which receives all - * interrupt/bulk data sent to any endpoint other than 0. The endpoint number - * can be found in 'usbRxToken'. - */ -#define USB_CFG_HAVE_FLOWCONTROL 0 -/* Define this to 1 if you want flowcontrol over USB data. See the definition - * of the macros usbDisableAllRequests() and usbEnableAllRequests() in - * usbdrv.h. - */ -#define USB_CFG_DRIVER_FLASH_PAGE 0 -/* If the device has more than 64 kBytes of flash, define this to the 64 k page - * where the driver's constants (descriptors) are located. Or in other words: - * Define this to 1 for boot loaders on the ATMega128. - */ -#define USB_CFG_LONG_TRANSFERS 0 -/* Define this to 1 if you want to send/receive blocks of more than 254 bytes - * in a single control-in or control-out transfer. Note that the capability - * for long transfers increases the driver size. - */ -/* #define USB_RX_USER_HOOK(data, len) if(usbRxToken == (uchar)USBPID_SETUP) blinkLED(); */ -/* This macro is a hook if you want to do unconventional things. If it is - * defined, it's inserted at the beginning of received message processing. - * If you eat the received message and don't want default processing to - * proceed, do a return after doing your things. One possible application - * (besides debugging) is to flash a status LED on each packet. - */ -/* #define USB_RESET_HOOK(resetStarts) if(!resetStarts){hadUsbReset();} */ -/* This macro is a hook if you need to know when an USB RESET occurs. It has - * one parameter which distinguishes between the start of RESET state and its - * end. - */ -/* #define USB_SET_ADDRESS_HOOK() hadAddressAssigned(); */ -/* This macro (if defined) is executed when a USB SET_ADDRESS request was - * received. - */ -#define USB_COUNT_SOF 1 -/* define this macro to 1 if you need the global variable "usbSofCount" which - * counts SOF packets. This feature requires that the hardware interrupt is - * connected to D- instead of D+. - */ -/* #ifdef __ASSEMBLER__ - * macro myAssemblerMacro - * in YL, TCNT0 - * sts timer0Snapshot, YL - * endm - * #endif - * #define USB_SOF_HOOK myAssemblerMacro - * This macro (if defined) is executed in the assembler module when a - * Start Of Frame condition is detected. It is recommended to define it to - * the name of an assembler macro which is defined here as well so that more - * than one assembler instruction can be used. The macro may use the register - * YL and modify SREG. If it lasts longer than a couple of cycles, USB messages - * immediately after an SOF pulse may be lost and must be retried by the host. - * What can you do with this hook? Since the SOF signal occurs exactly every - * 1 ms (unless the host is in sleep mode), you can use it to tune OSCCAL in - * designs running on the internal RC oscillator. - * Please note that Start Of Frame detection works only if D- is wired to the - * interrupt, not D+. THIS IS DIFFERENT THAN MOST EXAMPLES! - */ -#define USB_CFG_CHECK_DATA_TOGGLING 0 -/* define this macro to 1 if you want to filter out duplicate data packets - * sent by the host. Duplicates occur only as a consequence of communication - * errors, when the host does not receive an ACK. Please note that you need to - * implement the filtering yourself in usbFunctionWriteOut() and - * usbFunctionWrite(). Use the global usbCurrentDataToken and a static variable - * for each control- and out-endpoint to check for duplicate packets. - */ -#define USB_CFG_HAVE_MEASURE_FRAME_LENGTH 0 -/* define this macro to 1 if you want the function usbMeasureFrameLength() - * compiled in. This function can be used to calibrate the AVR's RC oscillator. - */ -#define USB_USE_FAST_CRC 0 -/* The assembler module has two implementations for the CRC algorithm. One is - * faster, the other is smaller. This CRC routine is only used for transmitted - * messages where timing is not critical. The faster routine needs 31 cycles - * per byte while the smaller one needs 61 to 69 cycles. The faster routine - * may be worth the 32 bytes bigger code size if you transmit lots of data and - * run the AVR close to its limit. - */ - -/* -------------------------- Device Description --------------------------- */ - -#define USB_CFG_VENDOR_ID (VENDOR_ID & 0xFF), ((VENDOR_ID >> 8) & 0xFF) -/* USB vendor ID for the device, low byte first. If you have registered your - * own Vendor ID, define it here. Otherwise you may use one of obdev's free - * shared VID/PID pairs. Be sure to read USB-IDs-for-free.txt for rules! - * *** IMPORTANT NOTE *** - * This template uses obdev's shared VID/PID pair for Vendor Class devices - * with libusb: 0x16c0/0x5dc. Use this VID/PID pair ONLY if you understand - * the implications! - */ -#define USB_CFG_DEVICE_ID (PRODUCT_ID & 0xFF), ((PRODUCT_ID >> 8) & 0xFF) -/* This is the ID of the product, low byte first. It is interpreted in the - * scope of the vendor ID. If you have registered your own VID with usb.org - * or if you have licensed a PID from somebody else, define it here. Otherwise - * you may use one of obdev's free shared VID/PID pairs. See the file - * USB-IDs-for-free.txt for details! - * *** IMPORTANT NOTE *** - * This template uses obdev's shared VID/PID pair for Vendor Class devices - * with libusb: 0x16c0/0x5dc. Use this VID/PID pair ONLY if you understand - * the implications! - */ -#define USB_CFG_DEVICE_VERSION 0x00, 0x01 -/* Version number of the device: Minor number first, then major number. - */ -#define USB_CFG_VENDOR_NAME 't', '.', 'm', '.', 'k', '.' -#define USB_CFG_VENDOR_NAME_LEN 6 -/* These two values define the vendor name returned by the USB device. The name - * must be given as a list of characters under single quotes. The characters - * are interpreted as Unicode (UTF-16) entities. - * If you don't want a vendor name string, undefine these macros. - * ALWAYS define a vendor name containing your Internet domain name if you use - * obdev's free shared VID/PID pair. See the file USB-IDs-for-free.txt for - * details. - */ -#define USB_CFG_DEVICE_NAME 'H', 'H', 'K', 'B', ' ', 'm', 'o', 'd' -#define USB_CFG_DEVICE_NAME_LEN 8 -/* Same as above for the device name. If you don't want a device name, undefine - * the macros. See the file USB-IDs-for-free.txt before you assign a name if - * you use a shared VID/PID. - */ -/*#define USB_CFG_SERIAL_NUMBER 'N', 'o', 'n', 'e' */ -/*#define USB_CFG_SERIAL_NUMBER_LEN 0 */ -/* Same as above for the serial number. If you don't want a serial number, - * undefine the macros. - * It may be useful to provide the serial number through other means than at - * compile time. See the section about descriptor properties below for how - * to fine tune control over USB descriptors such as the string descriptor - * for the serial number. - */ -#define USB_CFG_DEVICE_CLASS 0 -#define USB_CFG_DEVICE_SUBCLASS 0 -/* See USB specification if you want to conform to an existing device class. - * Class 0xff is "vendor specific". - */ -#define USB_CFG_INTERFACE_CLASS 3 /* HID */ -#define USB_CFG_INTERFACE_SUBCLASS 1 /* Boot */ -#define USB_CFG_INTERFACE_PROTOCOL 1 /* Keyboard */ -/* See USB specification if you want to conform to an existing device class or - * protocol. The following classes must be set at interface level: - * HID class is 3, no subclass and protocol required (but may be useful!) - * CDC class is 2, use subclass 2 and protocol 1 for ACM - */ -#define USB_CFG_HID_REPORT_DESCRIPTOR_LENGTH 0 -/* Define this to the length of the HID report descriptor, if you implement - * an HID device. Otherwise don't define it or define it to 0. - * If you use this define, you must add a PROGMEM character array named - * "usbHidReportDescriptor" to your code which contains the report descriptor. - * Don't forget to keep the array and this define in sync! - */ - -/* #define USB_PUBLIC static */ -/* Use the define above if you #include usbdrv.c instead of linking against it. - * This technique saves a couple of bytes in flash memory. - */ - -/* ------------------- Fine Control over USB Descriptors ------------------- */ -/* If you don't want to use the driver's default USB descriptors, you can - * provide our own. These can be provided as (1) fixed length static data in - * flash memory, (2) fixed length static data in RAM or (3) dynamically at - * runtime in the function usbFunctionDescriptor(). See usbdrv.h for more - * information about this function. - * Descriptor handling is configured through the descriptor's properties. If - * no properties are defined or if they are 0, the default descriptor is used. - * Possible properties are: - * + USB_PROP_IS_DYNAMIC: The data for the descriptor should be fetched - * at runtime via usbFunctionDescriptor(). If the usbMsgPtr mechanism is - * used, the data is in FLASH by default. Add property USB_PROP_IS_RAM if - * you want RAM pointers. - * + USB_PROP_IS_RAM: The data returned by usbFunctionDescriptor() or found - * in static memory is in RAM, not in flash memory. - * + USB_PROP_LENGTH(len): If the data is in static memory (RAM or flash), - * the driver must know the descriptor's length. The descriptor itself is - * found at the address of a well known identifier (see below). - * List of static descriptor names (must be declared PROGMEM if in flash): - * char usbDescriptorDevice[]; - * char usbDescriptorConfiguration[]; - * char usbDescriptorHidReport[]; - * char usbDescriptorString0[]; - * int usbDescriptorStringVendor[]; - * int usbDescriptorStringDevice[]; - * int usbDescriptorStringSerialNumber[]; - * Other descriptors can't be provided statically, they must be provided - * dynamically at runtime. - * - * Descriptor properties are or-ed or added together, e.g.: - * #define USB_CFG_DESCR_PROPS_DEVICE (USB_PROP_IS_RAM | USB_PROP_LENGTH(18)) - * - * The following descriptors are defined: - * USB_CFG_DESCR_PROPS_DEVICE - * USB_CFG_DESCR_PROPS_CONFIGURATION - * USB_CFG_DESCR_PROPS_STRINGS - * USB_CFG_DESCR_PROPS_STRING_0 - * USB_CFG_DESCR_PROPS_STRING_VENDOR - * USB_CFG_DESCR_PROPS_STRING_PRODUCT - * USB_CFG_DESCR_PROPS_STRING_SERIAL_NUMBER - * USB_CFG_DESCR_PROPS_HID - * USB_CFG_DESCR_PROPS_HID_REPORT - * USB_CFG_DESCR_PROPS_UNKNOWN (for all descriptors not handled by the driver) - * - * Note about string descriptors: String descriptors are not just strings, they - * are Unicode strings prefixed with a 2 byte header. Example: - * int serialNumberDescriptor[] = { - * USB_STRING_DESCRIPTOR_HEADER(6), - * 'S', 'e', 'r', 'i', 'a', 'l' - * }; - */ - -#define USB_CFG_DESCR_PROPS_DEVICE 0 -#define USB_CFG_DESCR_PROPS_CONFIGURATION USB_PROP_IS_DYNAMIC -//#define USB_CFG_DESCR_PROPS_CONFIGURATION 0 -#define USB_CFG_DESCR_PROPS_STRINGS 0 -#define USB_CFG_DESCR_PROPS_STRING_0 0 -#define USB_CFG_DESCR_PROPS_STRING_VENDOR 0 -#define USB_CFG_DESCR_PROPS_STRING_PRODUCT 0 -#define USB_CFG_DESCR_PROPS_STRING_SERIAL_NUMBER 0 -#define USB_CFG_DESCR_PROPS_HID USB_PROP_IS_DYNAMIC -//#define USB_CFG_DESCR_PROPS_HID 0 -#define USB_CFG_DESCR_PROPS_HID_REPORT USB_PROP_IS_DYNAMIC -//#define USB_CFG_DESCR_PROPS_HID_REPORT 0 -#define USB_CFG_DESCR_PROPS_UNKNOWN 0 - -/* ----------------------- Optional MCU Description ------------------------ */ - -/* The following configurations have working defaults in usbdrv.h. You - * usually don't need to set them explicitly. Only if you want to run - * the driver on a device which is not yet supported or with a compiler - * which is not fully supported (such as IAR C) or if you use a differnt - * interrupt than INT0, you may have to define some of these. - */ -/* #define USB_INTR_CFG MCUCR */ -/* #define USB_INTR_CFG_SET ((1 << ISC00) | (1 << ISC01)) */ -/* #define USB_INTR_CFG_CLR 0 */ -/* #define USB_INTR_ENABLE GIMSK */ -/* #define USB_INTR_ENABLE_BIT INT0 */ -/* #define USB_INTR_PENDING GIFR */ -/* #define USB_INTR_PENDING_BIT INTF0 */ -/* #define USB_INTR_VECTOR INT0_vect */ - -/* Set INT1 for D- falling edge to count SOF */ -/* #define USB_INTR_CFG EICRA */ -#define USB_INTR_CFG_SET ((1 << ISC11) | (0 << ISC10)) -/* #define USB_INTR_CFG_CLR 0 */ -/* #define USB_INTR_ENABLE EIMSK */ -#define USB_INTR_ENABLE_BIT INT1 -/* #define USB_INTR_PENDING EIFR */ -#define USB_INTR_PENDING_BIT INTF1 -#define USB_INTR_VECTOR INT1_vect - -#endif /* __usbconfig_h_included__ */ diff --git a/keyboard/hhkb/rn42.mk b/keyboard/hhkb/rn42.mk deleted file mode 100644 index fd6f7db1a8e..00000000000 --- a/keyboard/hhkb/rn42.mk +++ /dev/null @@ -1,12 +0,0 @@ -RN42_DIR = rn42 - -SRC += serial_uart.c \ - rn42/suart.S \ - rn42/rn42.c \ - rn42/rn42_task.c \ - rn42/battery.c \ - rn42/main.c - -OPT_DEFS += -DPROTOCOL_RN42 - -VPATH += $(RN42_DIR) diff --git a/keyboard/hhkb/rn42/MEMO.txt b/keyboard/hhkb/rn42/MEMO.txt deleted file mode 100644 index 0363c2f4332..00000000000 --- a/keyboard/hhkb/rn42/MEMO.txt +++ /dev/null @@ -1,255 +0,0 @@ -Memo of deveopment -================== -just memo, NOT WORTH READING - -Bug: -- Factory Reset PIO4 doesn't work - - the reason is unclear - 12/08 NOT LOOK INTO ANY MORE - - WORKAROUND: use serial pins(3.3V, GND, RX and TX) - - SF,1 and R,1 to set factory defalult - - -Todo: -- LED cover and switch knob and new Slide Switch -- RN42 auto configuration - - configure the module as HID device every time powering up - - this'll reduce work load of assembly - -- move rn42 to protocol directory when it becomes reusable stack - -- sendchar() in lufa.c no buffer - - no buffering. character lost can be caused. -- LUFA sendchar should be buffered and serial_uart.c buffur size is too large(256). - -- BT operations - - disconnect - - new connection - - remove connection - -- sendchar() in lufa.c block loop - DONE 11/29 - - block loop when powered with AC adapter - - FrameNumber is not updated when adapter powered - -Improving: -- ADC resolution - AVR120 - AVR32138 - - Enhancing ADC resolution by oversampling - AVR121 http://www.atmel.com/images/doc8003.pdf - - disable digital input buffer DIDR(7.8.6) - -Design: -- suspend.h - DONE 11/26 - - remove argument from suspend_power_down() for backward compatitibility -- remove MCU dependent power saving code from core/keyboard - DONE 11/23 - - it should be located in project matrix.c -- HHKB matrix.c needs matrix_prev? - - is_modified() is obsolete now. really needs? -- ADC: removing AREF capacitor C10 - - seems to be better while usb powered - - still bad while battery powered - http://electronics.stackexchange.com/questions/105849/avcc-and-capacitor-using-adc -- ADC: smaller resistors for voltage dividor - - 1K + 1K: not improved. - 11/27 - - -LUFA: -USB connection check: state of USB deivce -- USB_DeviceState: - USB_Deivce_State_t { Unattached, Powered, Default, Addressed, Configured*, Suspended* } - Unattached: unpluged - Powered: pluged with power adapter - Default: enumerate process bigin - Addressed: addressed - Configured: enumerated - Suspended: suspended - -- USB_IsInitialized: state of LUFA core setup - becomes true in USB_Init() USBController_AVR8.c - becomes false in USB_Disable() USBController_AVR8.c -- USB_VBUS_GetStatus(): state of VBUS(power/connection) -- USB_Disable() detaches, disables all interrupts, controller, PLL, regulater. - -- When connect to power adapter - - event happened: CW or CSW or C or DDC - - USB state: not configured - -- USB evnets - - USB connect: CSWRWRW - - USB connect but fail to enumeration: CWRWRWRWS - - USB disconnect: D - - Power adapter connect: CW, CSW, C - - Power adapter disconnect: D - - -Power saving: -- Pro2 current consumption - - active: 138.2mA(no device on Hub) - - suspended: 30.9mA(WakeUp enabled DIPSW6) - - suspended: 0mA->46.0mA(WakeUp disabled DIPSW6) -- Pro current consumption - - active: 54.0mA - - suspended: 40.5mA(WakeUp enabled DIPSW6) - - suspended: 0.3mA(WakeUp disabled DIPSW6) - -- RN42 3.3V - - disconnected(Idle): 5mA (config mode) - - connected(Active): - SW,0000: 23-26mA - SW,0010: 27-29mA worse than 0000 for unknown reason - SW,0020: 17-19mA mouse NG - SW,0030: 13-16mA laggy mouse NG - SW,0050: 10-13mA laggy mouse NG - -- matrix power saving - - power saving while externally powered and not while unpluged -- confirm suspend mode lufa.c: matrix_power_*, suspend_wakeup_condition -- 8MHz clock -- When not connected in a few minutes get into deep sleep to save battery life -- CTS is needed for waking up from deep sleep? How deep sleep is activated? -- firmware controlled 3.3V DC converter to switch on/off BT module -- sleep MCU and BT module(keyboard is not used) -- deep sleep MCU and BT module(keyboard is not used for long time) -- deep sleep MCU and turn off BT module(keyboard is not used and not connected) -- Battery ADC; switching, high resistance - - switching gnd end of divider with PF4 - - high resistor 100K/1M? - capacitor 10nF - http://www.eevblog.com/forum/beginners/measuring-battery-voltage-without-consuming-current/ -- During USB suspend change clock source to internal RC from external Xtal(6.8) -- FRZCLK: you can freeze clock for power saving. still WAKEUPI and VBUSTI interrupts are available while freezing.(21.7.3) -- Suspend: Clear Suspend Bit, Freeze clock, disable PLL, MCU sleep(21.13) -- Voltage reference(8.1.1) - - to reduce power consumption while power down mode -- unset ADEN before sleep(24.7) - - - - - - - -Lipo ----- -850mA lasts around 9 hours(07/28) - -Sparkfun Polymer Lithium Ion Battery 850mAh: -https://www.sparkfun.com/products/341 -Lipo Cell spec: -https://www.sparkfun.com/datasheets/Batteries/063048%20Li-polymer.pdf -Protection spec: -http://dlnmh9ip6v2uc.cloudfront.net/datasheets/Prototyping/BatteryProtection.pdf - min typical max - over-charge 4.255 4.280 4.305 - over-charge discover? 4.030 4.080 4.130 - over-discharge 2.827 2.900 2.973 - over-discharge discover 3.022 3.100 3.178 - -ADC voltage monitor: voltage divider 10K+10K(0.5) - ADC=V*0.5/2.56*1024 - - V ADC - ------------------ - 4.20 0x347(839) - 3.10 0x26b(619) - - - - -TROUBLE SHOOT -------------- -07/16 After fix of voltage dividor on GPIO6, had a trouble that it could not send a char to BT module, though could receive. - Found R8 had wrong 1K resistor and changed to 10K, after that it can send to the module again. Not sure how it had sent with the wrong 1K before. - -07/18 On Linux, had an USB related trouble; keyboard or console didn't work for some reason. Changing PID cured this problem. Very annoying, took very long time before resolved it. - -12/07 rn42_rts() read 1 every time. R12 broke in open mode(no coductive), idk why, too much heat with soldering? and PF1 pin was not soldered. - It resolved with resoldering PF1 and new resistor on R12. - - - - -Done: -- low battery alert(solid light) 09/04 -- *** Rev.E BT test *** - DONE - - with MCP73832, new Schottky, tantalum caps - DONE 12/07 - * MCP73832 doesn't leak from Vcc pin when unpluged and battery powered - 34mV vs 2.07V(MCP73831) at Vcc pin - MCP73832 doesn't need revese protection diode D5 - * PMEG2010ER is very low VF while reverse current/voltage is high - VF=0.96 vs 1.98(RB160M-30TR)with Fluke 175 - Anode of D11 is 680mV vs 20mV(RB160M-30TR) - 780mV is still low < 1.4V VBUS plugin detection(21.11) - this doesn't cause false VBUS detect - and 780mV on MCP73832 Vcc pin is also no problem. - D5 can be removed. - - ADC divider switching - DONE 12/07 - * Drain and Source of Q4 Pch was reversed wrongly on Rev.E. - - - reverse current from Lipo charger - DONE 12/07 - * MCP73832 has no recverse current from Vcc pin unlike MCP73831 - - -- Rev.F design - DONE - - current measure point - DONE 12/08 - - change value of cap 68->47 - DONE 12/08 - - PPTC land pattern: no solder jumper, use 0Ohm resistor instead - CANCEL 12/08 - - Q4 Pch FET: wrong Drain and Source - DONE 12/08 - - D5 can be removed. - DONE 12/08 - - - -- BT_INDICATOR LED turns on wrongly when touching line or pin. -- pull-up enabled on PF6/GPIO2 08/30 -- Lipo charger configuration: fast charge time: USB charger spec? -- used 2kohm -- use LED of charger to alarm low battery. LED should be powered directly from Lipo? - cancel; powered from VUSB -- Use RTS in serial_uart.c to resolve missing chars from help message of RN-42 - done -- CTS/RTS lines are needed? just connect in loop back if no flow control is needed. - done -- add IO pin to charger status CHRG; LED control(low) and detect charge status(input HiZ) 07.24 -- LINKED: add trace on PIO2 to PF6 07.24 -- Lipo voltage ADC sensing -- Lipo charger MCP73831: needs capacitor 4.7uF *2 -- USB connection check - 07.01 -- BT on/off check: whether RX line is pulled up? - checking RTS 07.01 -- USB/BT switching BT is on -> BT, BT is off -> USB - 07.01 -- Under voltage lock out UVLO for protection of Lipo - Lipo has discharge protection at 3.100V 07.01 -- Power saving: HHKB scan, BT radio control - 9h with 850mAh, this is enough 07.01 -- Power selector doesn't work; Q4 MOSFET leaks from Lipo to USB power line. -- use Schottky instead 07/04 - -- wrongly suspended when powered from adapter without USB connection - DONE - - suspend event may occur when plug into adapter - - and never wake until conected to real USB line - - without debug print via USB no problem; CSW(wake just after suspend as real USB line) - - seems like USB print causes this problem after suspended - -- lose USB connection during power-down mode - DONE - - USB initialize code in main() causes this - WRONG - - Do not power-down during USB connection is active - DONE 11/11 - (USB_DeviceState == USB_DEVICE_Configured) is used to check USB connection - matrix_power_down() matrix.c - 11/23 - -- with Nexus5 keyboard and mouse are very laggy. - Not confirmed. 01/15 - -- switch BT host connections - CANCEL 01/15 - - switch next connection - cannot switch connection with version 6.15 at least - -- When given power only from wall wart adapter - DONE? not confirmed 01/15 - - it sleeps. it should not sleep - - Configured state without USB connection? - -- timer is slow while power down - DONE 11/26 - - time out interrupt is lost while power down? - - interrupt of watchdog timer compensates timer counter(avr/suspend.c) - -- repeated CHARGING/FULL_CHARGED - No longer problem 01/15 - - In LTC sharp pulses are observed. - - MCP has no pulse but still has a problem. - - needs more wait before read pin state? - NO - -- USB plug-in fails while BT - No longer problem 01/15 - - it ends in suspend state - - maybe, not responsive to host enumeration process due to power-down. - - matrix_power_down() only when state is unattached - 11/26 - - need to observe a while - diff --git a/keyboard/hhkb/rn42/PowerSave.txt b/keyboard/hhkb/rn42/PowerSave.txt deleted file mode 100644 index 4b9c8f415d0..00000000000 --- a/keyboard/hhkb/rn42/PowerSave.txt +++ /dev/null @@ -1,88 +0,0 @@ -Power Saving -============ - - -MCU+HHKB Power Comsumption --------------------------- -Battery drive: - idle 18.9mA - active 35.8mA - -USB powered: - 40.0mA - 52mA 01/17 - -Other keyboards: -HHKB Pro 55mA -HHKB Pro2 140mA -HHKB Pro 42mA(Alt) -HHKB Pro2 52mA(Alt BT controller USB mode) -HHKB Pro2 88mA(Alt BT controller BT mode connected) -HHKB Pro2 68mA(Alt BT controller BT mode config mode) -Poker X 6mA -Infinity 24mA(TMK) - 65mA(kiibohd) - - -HHKB key switch power control ------------------------------ -MOS FET Nch: BSS138 or IRLML6344T, either works and no apparent difference. -Normally on(pull-up) or off(pull-down)? interms of power saving it prefers pull-down? - -Pull-down will be better for power saving, normally off. - - - -Used Timer ----------- - -8MHz clock ----------- -1) 16MHz xtal with system prescaler div2: F_CPU=8MHz, F_USB=16MHz -2) 8MHz xtal with div1: F_CPU=8MHz, F_USB=8MHz -Hardware USART doesn't work at 115200bps with 8MHz(F_CPU). - -workaround: -a) use Sotwre serial for communcation with RN-42 -b) reduce baud of RN-42 to lower rate;(factory default is 115200bps) -10/03 - - - -Slave mode ----------- -Discovery/Inquire -Connect/Page - -SI,0012 -SJ,0012 -InqWindw=0100 -PagWindw=0100 - - -Sniff mode ----------- -0.625ms * -SW,0320 Very sluggish. Type is not lost but very slow to register. -SW,0160 Still sluggish. may transposed? can type but ... - Mouse point move intermittently -SW,0020 feel a bit late like stumble(20ms) -SW,0010 feel no latency(10ms) - - -Deep sleep ----------- -SW,8010 - - -TX power --------- -SY,fff4 - - -IO pins -------- -S%,1000 status led and connection control don't work - GPIO5: status LED - GPIO6: Connection control - GPIO2: linked status diff --git a/keyboard/hhkb/rn42/RN42.txt b/keyboard/hhkb/rn42/RN42.txt deleted file mode 100644 index 64c3fdd4ece..00000000000 --- a/keyboard/hhkb/rn42/RN42.txt +++ /dev/null @@ -1,408 +0,0 @@ -RN-42 Bluetooth Module Support -============================== -Bluetooth controller board works with HHKB Pro2, JP, Type-S and Type-S JP and it supports both USB and Bluetooth as keyboard output protocol. Bluetooth module Roving Networks/Microchip RN-42 is installed on the board. - - -RN-42: -http://www.microchip.com/wwwproducts/Devices.aspx?product=RN42 - - -Capabitlities: -- USB keyboard functions - completely equivarent to USB controller including mouse keys and NKRO. -- Switching between USB and Bluetooth - You can switch the two connections with BT switch or key combination. -- RN-42 config mode - You can change power/connection configuration of the module if needed. -- Low battery alert - Red LED turns on when low voltage. -- RN-42 status indicator - LED indicates status of Bluetooth connection. -- Pairing - The module stores up to 8 connections. -- Auto connect - The module connects the last connected device automatically. -- iOS support - works as keyboard with iPhone5. No tested completely. -- Android support - works as keyboard and mouse with Nexus5. No tested completely. -- Mouse keys over BT - Note that iOS doesn't accept mouse device. - - -Limitations: -- Short battery life - Around 12hr with 1000mAh -- No connection switching - RN-42 auto-connects to the last connected device. - Some of consumer products can switch between devices, for example Logitech K480. - http://www.logitech.com/en-us/product/multi-device-keyboard-k480?crid=26 -- HHKB JP requires case modification for BT switch and LEDs. - without switch power controlled by MCU? Probably using 3.3V regulator enable pin power of RN-42 can be controlled. - -NOTE: -- LIPO BATTERY IS VERY DANGEROUS, TAKE EXTRA CARE OF YOUR SAFETY AND PROPERTY. -- RN-42 version 6.15 is supported. -- No NKRO over Bluetooth -- Check you country's wiress regulation and certification of RN-42. - -Bugs: - -Todos: - - -Lipo Battery ------------- -You can use 3.7V Lithium Ion battery with JST PH 2pin connector and protection circuit. -Battery space inside HHKB is around 54mm x 50mm and its height is 7mm. - -Sparkfun 850mAh -https://www.sparkfun.com/products/341 -Sparkfun 1000mAh -https://www.sparkfun.com/products/339 - -Sparkfun 2000mAh battery won't fit due to its size. - -Learn about Lipo battery: -https://learn.adafruit.com/li-ion-and-lipoly-batteries - - - - - -LED Status ----------- -Configuring 10 times per sec -Startup/configuration timer 2 times per sec -Discoverable/Inquiring/Idle once per sec -Connected solid on - - -RN-42 Magic Command --------------------- -Magic key combination is 'LShift+RShift' by default in case of HHKB. - -Here is help. - - ----- Bluetooth RN-42 Help ----- - i: RN-42 info - b: battery voltage - Del: enter/exit RN-42 config mode - Slck: RN-42 initialize - p: pairing - u: toggle Force USB mode - - RN-42 info: displays information of the module on console. - battery voltage: displays current voltage of battery and uptime. - RN-42 initialize: does factory reset and configures RN-42 - pairing: enters Pairing mode. - toggle Force USB mode: switch between USB and Bluetooth - - -RN-42 Config mode ------------------ -You can tune/operate RN-42 yourself with config(command) mode. - -1. hook up USB cable -2. run `hid_listen` command in console -3. turn on Bluetooth switch -4. press LShift+RShift+Delete(Fn+~) you will see output like followings: - - Entering config mode ... - CMD - v - Ver 6.15 04/26/2013 - (c) Roving Networks - -5. do config with RN-42 commands. See documentations of RN-42. -6. to exit also press LShift+RShift+Delete(Fn+~) - - Exiting config mode ... - --- - END - - -RN-42 Initial Configuration ---------------------------- -RN-42 is configured as SPP device at factory reset, you need to configure it as HID device. This is needed just once first time. - -1. hook up USB cable -2. run `hid_listen` command in console -3. turn on Bluetooth switch -4. press LShift+RShift+ScrLk(Fn+O) you will see output like followings: - - Entering config mode ... - CMD - Ver 6.15 04/26/2013 - (c) Roving Networks - ECHO ON - SF,1 - AOK - S-,TmkBT - AOK - SS,Keyboard/Mouse - AOK - SM,4 - AOK - SW,8000 - AOK - S~,6 - AOK - SH,003C - AOK - SY,FFF4 - AOK - R,1 - Reboot! - Exiting config mode ... - -5. output of command 'X' after cofiguration - - Ver 6.15 04/26/2013 - (c) Roving Networks - ***Settings*** - BTA=00066667BBE9 - BTName=TmkBT-BBE9 - Baudrt(SW4)=115K - Mode =DTR - Authen=1 - PinCod=1234 - Bonded=0 - Rem=NONE SET - ***ADVANCED Settings*** - SrvName= Keyboard/Mouse - SrvClass=0000 - DevClass=1F00 - InqWindw=0100 - PagWindw=0100 - CfgTimer=255 - StatuStr=NULL - HidFlags=3c - DTRtimer=8 - KeySwapr=0 - ***OTHER Settings*** - Profile= HID - CfgChar= $ - SniffEna=8000 - LowPower=0 - TX Power=fff4 - IOPorts= 0 - IOValues=0 - Sleeptmr=0 - DebugMod=0 - RoleSwch=0 - - -Switch to USB mode ------------------- -You can switch between USB and Bluetooth with pressing 'LShift+RShift+u'. - - -Pairing mode ------------- -This disconnects current connect and enter pairing mode. - - - - -For deveropment -=============== - -RN-42 Serial Connection ------------------------ -UART: 115200bps, 8bit, 1-stopbit, non-parity, no flow control -SSP: 115200bps, 8bit, 1-stopbit, non-parity, no flow control(via Bluetooth) - -To enter command mode disconnect the module from host and type '$$$'.(you will see 'CMD') and type '+' to get local echo. To exit type '---'(you will see 'END'). - - -RN-42 Commands --------------- -S-,tmkBT // Device name -SS,keyboard/mouse // service name -SM,4 // Auto Connect DTR mode -SW,8010 // Sniff enable 0x10*0.625ms=10ms; 50ms is laggish and not much power save -S~,6 // HID profile -S~,0 // SPP profile -SH,003C // HID register -SY,0004 // Transmit power -SC,0000 // COD: 000005C0 (see HID spec/Bluegiga doc) -SD,05C0 // bit 12-8 7 6 5-0 - // 00101 1 1 0 - // peripheral pointing keybaord joystick, gamepad, ... -SM,6 // Pairing mode: auto connect -SM,4 // Master mode: Connection can be controled with GPIO6 -SF,1 // Factroy reset -R,1 // reboot -SR,Z // removes all remote addresses for reconnecting. - // can be used to connect another host -SR,I // registers last inquiry address - - -Operation Modes ---------------- -SM,3 Auto Connect Master mode -SM,4 Auto Connect DTR Mode uses GPIO6 to make and break connection(Mode =DTR) - confirm: auto connect works and control connection with GPIO6 -SM,5 Auto Connect ANY Mode (Mode =ANY) - each time GPIO is set, make inquiry and connect to the first found device -SM,6 automatically reconnect(Mode =Pair) - confirm: auto connect works well but difficult to enter command mode. - - -HID flag register ------------------ -SH,0200 -GH - -10 0000 0000(0200) default -00 0011 1000(0038) Combo -|| | | |\_\____ number of paired devices to which the module can reconnect -|| | | \_______ send out reports over UART (0xFF ) -|| \__\_________ descriptor type -|\______________ toggle virtual keyboard on iOS when first connected -\_______________ Force HID mode if GPIO11 is high on power-up - - Descriptor type: - 0000: keybaord - 0001: Game Pad - 0010: Mouse - 0011: Combo - 0100: Joystick - 1xxx: reserved - - -Out report - Indicator ----------------------- -0xFE 0x02 0x01 - - -Apple iOS ---------- -Keyboard can be used with iPhone, but mouse cannot. - - -Android -------- -3.7.1.5 Note: To connect with Android phone the modules must wake up 11ms every 2.5seconds. - - -Power Management ----------------- -Inquiry and Page window Idle or Active (3.1.1) - Downside: delay in discovery or connection time - SI, // set inquiry scan window(discovery) on/off duty? - SJ, // set page scan window(connection) - This reduces averaege power >20mA to 5mA(3mA in Sniff mode) - -Sniff mode Transmit - Sniff mode is disabled by default and radio is active continuously when connected.(25-30mA) - In Sniff mode the radio wakes up intermittently and sleeps in very low power mode.(2mA) - SW, // set interval timer(*0.625ms) 0000-7FFF - -Deep sleep Idle (3.1.2) - In this mode the module shuts down completly and only draws about 300uA. To enable this set the most signifant bit(0x8000) of Sniff interaval timer. - SW,8320 // deep sleep enable(interval=0x320*0.625=500ms) - In normal sleep the firmware is still running in idle mode, and wakes up about 20 times per second to check ports, update LEDs, etc. During deep sleep, the firmware actually stops runnig some tasks and the LEDs only update about once per second. - To wake from deep sleep there are three ways: (in worst case wake up takes 5ms) - *send a charactor to the UART(first charactor will be lost) - *toggle CTS low to high and wait 5ms - *wake automatically every slot time(*0.625ms) - Once the radio is awake it stay active for exactly 1 second of inactivity and then sleeps again. - Downside: latency and data loss - -Disable Output driver Idle or Active (3.1.3) - S%,1000 // set all GPIO pins(0-11) to inputs. - -Lower Transmit Power Idle or Active (3.1.4) - SY, // transmit power setting(takes effect after a power cycle and reboot) - Downside: reducing effective range - - -Optimizig for Latency ---------------------- -By default the firmware is optimized for throughput. -SQ,16 // set latency bit -SQ,0 // unset latency bit - - -Configuration timer settings ----------------------------- -Remote configuration is used for the module to be configured with various commands over Bluetooth(SPP profile only?). - -The module has remote configuration timer to allow remote configuration over Bluetooth after power up in Slave mode. In Master modes the remote configuration timer is set to 0(no remote configuration). (In Trigger Master mode the timer is used as an idle timer to break the connection after time expires with no charactors receive.) - ST,0 // no remote, no local when connected - ST,<1-252> // local and remote with timeout in seconds from power up - ST,253 // local only without timeout - ST,254 // remote only without timeout - ST,255 // local and remote without timeout - - -Commands --------- -S7, 7bit mode -SA, Authenticaiton -SB, Send break -SC, Service class -SD, Device class -SM, Operation mode -SP, Pin code(alpahnumeric) -SQ, Special configuration(GPIO, discovery mode, low latency, reboot, UART) -SR, Store remote address -SR,Z Erase all address -SS, Set service name(1-20)** -ST, Remote configuration timer(Master:0, Slave:0-255, Triger:as idle timer) -SU, UART baud rate -SW, low-power sniff mode** deep sleep and wake up every 625us * -SX,<0|1> bonding enable only acceps device that matches the stored address -SY, power setting** -SZ, non-standard raw baud rate =baud*0.004096 -S~, Profile 0:SPP, 5:APL, 6:HID -S-, Device name -15 alphanumeric charactors -S?,<0|1> role switch enable -S$, command mode char -$|, low-power connect mode deep sleep/active(discoverable and connectable) cycle -D display basic setting -E display extended setting -GB display the device's Bluetooth address -GF display Bluetooth address of connected device -GK show connection status -GR show remote address for reconnecting -G& show GPIO pin -G show stored setting -+ toggle local echo on/off -& show GPIO 3,4,6,7(DIP switch) -C connect to stored remote address -C,
connect last address -CFI connect and go into fast data mode -CFR connect and go into fast data mode -CT,
, connect to the address and disconnect after val? -F,1 fast data mod: -H display help -I,