diff options
author | Stephan Bösebeck <sb@caluga.de> | 2016-03-08 23:56:50 +0100 |
---|---|---|
committer | Stephan Bösebeck <sb@caluga.de> | 2016-03-08 23:56:50 +0100 |
commit | 3119778e0cef697d78b5f425822382a455cf6d36 (patch) | |
tree | 3bcb802e2bb133765c04e7bd81da04b172017bf2 /keyboard/planck | |
parent | 98fe40caa7b862a26f8900f8b9547f8c9b61726b (diff) | |
parent | 7d3ebd7b40b96f576fe4608b33f47329c334925b (diff) |
Merge branch 'master' of https://github.com/jackhumbert/qmk_firmware
Diffstat (limited to 'keyboard/planck')
-rwxr-xr-x | keyboard/planck/CYGWIN_GUIDE.md | 237 | ||||
-rw-r--r-- | keyboard/planck/PCB_GUIDE.md | 30 | ||||
-rw-r--r-- | keyboard/planck/keymaps/lucas.c | 163 |
3 files changed, 427 insertions, 3 deletions
diff --git a/keyboard/planck/CYGWIN_GUIDE.md b/keyboard/planck/CYGWIN_GUIDE.md new file mode 100755 index 0000000000..2fa4452f1c --- /dev/null +++ b/keyboard/planck/CYGWIN_GUIDE.md @@ -0,0 +1,237 @@ +#Planck Advanced (but not too advanced) `cygwin` Users Guide
+If you are a user of the [cygwin environment](https://cygwin.com) in Windows and want the freedom to use the latest tools available, then this is the guide for you. If compiling your own copy of the latest and greatest Gnu C Compiler makes you super happy, then this is the guide for you. If the command line make you smile, then this is the guide for you.
+
+
+This guide was written step by step as I went through the process on a `Windows 10` `x86_64` based system. This should be generally applicable to to any `Windows` environment with `cygwin`.
+
+
+#####Do not skip steps. Do not move past a step until the previous step finishes successfully.
+
+
+
+Based on [avr-libc installation guide](http://www.nongnu.org/avr-libc/user-manual/install_tools.html)
+
+
+##Get the Required Packages
+Download the `cygwin` setup ([x86_64](https://cygwin.com/setup-x86_64.exe)) and install the default system plus the following if they are not already selected:
+- devel/gcc-core
+- devel/gcc-g++
+- devel/flex
+- devel/git
+- libs/libglib2.0_0
+- libs/libgcc1
+- interpreters/m4
+- web/wget
+
+The following sources will be required:
+- [gmp](https://gmplib.org/) (6.1.0)
+- [mpfr](http://www.mpfr.org/) (3.1.3)
+- [mpc](http://www.multiprecision.org/) (1.0.3)
+- [binutils](https://www.sourceware.org/binutils/) (2.26)
+- [gcc](https://gcc.gnu.org/) (5.3.0)
+- [avr-libc](http://www.nongnu.org/avr-libc/) (2.0.0)
+
+The `dfu-programmer` will be required to flash the new firmware
+- [dfu-programmer](https://dfu-programmer.github.io/) (0.7.2)
+
+
+The set of commands below will create a directory (`~/local/avr`) for the sources you compile to be installed on the machine and a directory (`~/src`) for these source files to be stored. The commands then download the sources of the needed packages and unpack them. Note: the expand commands are different depending on if the packages are offered as a `bz2` or `gz` archive
+
+```
+$ mkdir ~/local/avr
+$ mkdir ~/src
+$ cd ~/src
+$ wget https://gmplib.org/download/gmp/gmp-6.1.0.tar.bz2
+$ wget http://www.mpfr.org/mpfr-current/mpfr-3.1.3.tar.bz2
+$ wget ftp://ftp.gnu.org/gnu/mpc/mpc-1.0.3.tar.gz
+$ wget http://ftp.gnu.org/gnu/binutils/binutils-2.26.tar.gz
+$ wget http://mirror0.babylon.network/gcc/releases/gcc-5.3.0/gcc-5.3.0.tar.gz
+$ wget http://download.savannah.gnu.org/releases/avr-libc/avr-libc-2.0.0.tar.bz2
+$ tar -xjf gmp-6.1.0.tar.bz2
+$ tar -xjf mpfr-3.1.3.tar.bz2
+$ tar -zxf mpc-1.0.3.tar.gz
+$ tar -zxf binutils-2.26.tar.gz
+$ tar -zxf gcc-5.3.0.tar.gz
+$ tar -xjf avr-libc-2.0.0.tar.bz2
+```
+
+##Setup the Build Environment
+These commands will set up the install directory and the `PATH` variable, which will allow you to access your installed packages. Note: if you close the `cygwin` terminal window, you will need to rerun these commands, they are not permanent.
+```
+$ PREFIX=$HOME/local/avr
+$ export PREFIX
+$ PATH=/usr/local/bin:/usr/local/lib:/usr/local/include:/bin:/lib:/cygdrive/c/WINDOWS/system32:/cygdrive/c/WINDOWS
+$ PATH=$PATH:$PREFIX/bin
+$ export PATH
+```
+
+##The `gcc` Required Math Library Packages
+The following packages are required to be complied and installed in order to compile `gcc`. They are not available through the `cygwin` package system, so we have to make them ourselves. They must be complied in this order because each one depends on the previous.
+
+###Build and Install `gmp`
+```
+$ cd ~/src/gmp-6.1.0
+$ ./configure --enable-static --disable-shared
+$ make
+$ make check
+$ make install
+```
+
+###Build and Install `mpfr`
+```
+$ cd ~/src/mpfr-3.1.3
+$ ./configure --with-gmp-build=../gmp-6.1.0 --enable-static --disable-shared
+$ make
+$ make check
+$ make install
+```
+
+###Build and Install `mpc`
+```
+$ cd ~/src/mpc-1.0.3
+$ ./configure --with-gmp=/usr/local --with-mpfr=/usr/local --enable-static --disable-shared
+$ make
+$ make check
+$ make install
+```
+
+##OPTIONAL Part
+You can build and install a brand new `gcc` or you can use the one supplied by `cygwin`. This will take about 4-5 hours to compile (It is a "native build", so it does the entire build **3 times**. This takes a long while). I would skip it.
+###Build and Install `gcc` on your Machine
+```
+$ cd ~/src/gcc-5.3.0
+$ mkdir obj-local
+$ cd obj-local
+$ ../configure --enable-languages=c,c++ --with-gmp=/usr/local --with-mpfr=/usr/local --with-mpc=/usr/local --enable-static --disable-shared
+$ make
+$ make install
+```
+
+###Build and Install `binutils` on your Machine
+```
+$ cd ~/src/binutils-2.26
+$ mkdir obj-local
+$ cd obj-local
+$ ../configure
+$ make
+$ make install
+```
+##End OPTIONAL Part
+
+##Buliding `binutils`, `gcc`, and `avr-libc` for the AVR system
+Now we can make the critical stuff for compiling our firmware: `binutils`, `gcc`, and `avr-libc` for the AVR architecture. These allow us to build and manipulate the firmware for the keyboard.
+
+###Build `binutils` for AVR
+```
+$ cd ~/src/binutils-2.26
+$ mkdir obj-avr
+$ cd obj-avr
+$ ../configure --prefix=$PREFIX --target=avr --disable-nls
+$ make
+$ make install
+```
+
+###Build `gcc` for AVR
+```
+$ cd ~/src/gcc-5.3.0
+$ mkdir obj-avr
+$ cd obj-avr
+$ ../configure --prefix=$PREFIX --target=avr --enable-languages=c,c++ --with-gmp=/usr/local --with-mpfr=/usr/local --with-mpc=/usr/local --enable-static --disable-shared --disable-nls --disable-libssp --with-dwarf2
+$ make
+$ make install
+```
+
+For building the `avr-libc`, we have to specify the host build system. in my case it is `x86_64-unknown-cygwin`. You can look for build system type in the `gcc` configure notes for the proper `--build` specification to pass when you configure `avr-libc`.
+
+###Build `avr-libc` for AVR
+```
+$ cd ~/src/avr-libc-2.0.0
+$ ./configure --prefix=$PREFIX --build=x86_64-unknown-cygwin --host=avr
+$ make
+$ make install
+```
+
+##Install `dfu-programmer`
+To install the `dfu-programmer`, we must get if from [their website](https://dfu-programmer.github.io/) (no fancy command line tricks here, but [this](http://iweb.dl.sourceforge.net/project/dfu-programmer/dfu-programmer/0.7.2/dfu-programmer-win-0.7.2.zip) might work).
+Copy this file into your `cygwin` home directory. (For me, it is `C:\cygwin64\home\Kevin`), extract the files, move `dfu-programmer.exe` to `~/local/avr/bin`. Most obnoxiously, the `libusb0_x86.dll` and `libusb0.sys` need to be moved from `dfu/dfu-prog-usb-1.2.2/x86/` to a directory in the `Windows` `PATH` and the `cygwin` `PATH`. I achieved this by moving the files with Windows Explorer (you know, click and drag...) to `C:\cygwin64\home\Kevin\local\avr\bin` Then, in a `WINDOWS` command prompt running:
+```
+C:\> set PATH=%PATH%;C:\cygwin64\home\Kevin\local\avr\bin
+```
+Adjust your path (for username) as needed. Also, `libusb0_x86.dll` needs to be renamed to `libusb0.dll`. Why must this be so hard? You can tell that you were successful this way:
+```
+$ which dfu-programmer
+/home/Kevin/local/avr/bin/dfu-programmer
+
+$ dfu-programmer
+dfu-programmer 0.7.2
+https://github.com/dfu-programmer/dfu-programmer
+Type 'dfu-programmer --help' for a list of commands
+ 'dfu-programmer --targets' to list supported target devices
+```
+If you are not getting the above result, you will not be able to flash the firmware!
+- Try making sure your `PATH` variables are set correctly for both `Windows` and `cygwin`.
+- Do not extract it with `cygwin`'s `unzip` as it does not set the executable permissions correctly. If you did it anyway, do `chmod 755 dfu-programmer.exe`
+
+####Install the USB drivers
+These drivers are included in the `dfu-programmer` 0.7.2 (but you can get newer ones [here](http://iweb.dl.sourceforge.net/project/libusb-win32/libusb-win32-releases/1.2.6.0/libusb-win32-bin-1.2.6.0.zip)) and allow the `dfu-programmer` to program the firmware. From an **administrator-privileged** `Windows` terminal, run the following command (adjust the path as necessary) and accept the prompt that pops up:
+```
+C:\> pnputil -i -a C:\cygwin64\home\Kevin\dfu-prog-usb-1.2.2\atmel_usb_dfu.inf
+```
+This should be the result:
+```
+Microsoft PnP Utility
+
+Processing inf : atmel_usb_dfu.inf
+Successfully installed the driver on a device on the system.
+Driver package added successfully.
+Published name : oem104.inf
+
+
+Total attempted: 1
+Number successfully imported: 1
+```
+
+##Building and Flashing the Planck firmware!
+
+If you did everything else right. This part should be a snap! Grab the latest sources from `github`, make the Plank firmware, then flash it.
+
+###Build Planck and Load the Firmware
+```
+$ cd ~/src
+$ git clone https://github.com/jackhumbert/qmk_firmware.git
+$ cd qmk_firmware/keyboard/planck
+$ make
+```
+Make sure there are no errors. You should end up with this or something similar:
+
+```
+Creating load file for Flash: planck.hex
+avr-objcopy -O ihex -R .eeprom -R .fuse -R .lock -R .signature planck.elf planck.hex
+
+Creating load file for EEPROM: planck.eep
+avr-objcopy -j .eeprom --set-section-flags=.eeprom="alloc,load" \
+--change-section-lma .eeprom=0 --no-change-warnings -O ihex planck.elf planck.eep || exit 0
+
+Creating Extended Listing: planck.lss
+avr-objdump -h -S -z planck.elf > planck.lss
+
+Creating Symbol Table: planck.sym
+avr-nm -n planck.elf > planck.sym
+
+Size after:
+ text data bss dec hex filename
+ 18602 82 155 18839 4997 planck.elf
+
+-------- end --------
+```
+
+If you do not get the above, you **did not** build the firmware, and you will have nothing to flash. If you have the fresh clone from github, it was probably something gone wrong in this install process, go check and see what didn't work and threw errors or what steps you might have missed.
+
+But if everything went OK, you are ready to flash! Press the reset button on the bottom of the Planck, wait two seconds, then:
+```
+$ make dfu
+```
+.
+.
+.
+profit!!!
diff --git a/keyboard/planck/PCB_GUIDE.md b/keyboard/planck/PCB_GUIDE.md index 3daf0e0092..b36d8fb64c 100644 --- a/keyboard/planck/PCB_GUIDE.md +++ b/keyboard/planck/PCB_GUIDE.md @@ -3,10 +3,12 @@ ## Setting up the environment ### Windows +1. 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**. +2. 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. +3. 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. +4. 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. +5. 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! -1. Install [WinAVR Tools](http://sourceforge.net/projects/winavr/) for AVR GCC compiler. -2. Install [DFU-Programmer][dfu-prog] (the -win one). -3. Start DFU bootloader on the chip first time you will see 'Found New Hardware Wizard' to install driver. If you install device driver properly you can find chip name like 'ATmega32U4' under 'LibUSB-Win32 Devices' tree on 'Device Manager'. If not you will need to update its driver on 'Device Manager' to the `dfu-programmer` driver. ### Mac @@ -52,6 +54,28 @@ Generally, the instructions to flash the PCB are as follows: 4. Press the reset button on the PCB/press the key with the `RESET` keycode 5. `make <arguments> dfu` - use the necessary `KEYMAP=<keymap>` and/or `COMMON=true` arguments here. +## Troubleshooting +If you see something like this + + 0 [main] sh 13384 sync_with_child: child 9716(0x178) died before initialization with status code 0xC0000142 + 440 [main] sh 13384 sync_with_child: *** child state waiting for longjmp + /usr/bin/sh: fork: Resource temporarily unavailable + +after running 'make' on Windows than you are encountering a very popular issue with WinAVR on Windows 8.1 and 10. +You can easily fix this problem by replacing msys-1.0.dll in WinAVR/utils/bin with [this one](http://www.madwizard.org/download/electronics/msys-1.0-vista64.zip). +Restart your system and everything should work fine! + + +If you see this + + dfu-programmer atmega32u4 erase + process_begin: CreateProcess(NULL, dfu-programmer atmega32u4 erase, ...) failed. + make (e=2): The system cannot find the file specified. + make: *** [dfu] Error 2 + +when trying to 'make dfu' on Windows you need to copy the dfu-programmer.exe to qmk_firmware/keyboard/planck. + + ## Quantum MK Firmware ### Keymap diff --git a/keyboard/planck/keymaps/lucas.c b/keyboard/planck/keymaps/lucas.c new file mode 100644 index 0000000000..27672e1bbc --- /dev/null +++ b/keyboard/planck/keymaps/lucas.c @@ -0,0 +1,163 @@ +/* +This is the keymap of /u/deepshitgoeshere! +Layer 1 exists so I can have the symbol positions of QWERTY while having my system in german. +The second layer has all the german umlauts I need and with capital and small letters on the +same layer there is no need to press shift+lower. +This keymap is made to work with software implemented QWERTZ. +The "Gaming" layer is mainly customized for CS:GO. +If you have any question about this keymap feel free to shoot me a message on reddit! +*/ + +#include "keymap_common.h" +#include "keymap_extras/keymap_german.h" +#include "backlight.h" +#include "debug.h" + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +[0] = { /* Colemak + * ,-----------------------------------------------------------------------. + * | Esc | q | w | f | p | g | j | l | u | y | ; | - | + * |-----------------------------------------------------------------------| + * | BS | a | r | s | t | d | h | n | e | i | o | ' | + * |-----------------------------------------------------------------------| + * | SFT | z | x | c | v | b | k | m | , | . | / | Ent | + * |-----------------------------------------------------------------------| + * | CTL | GUI | Tab | ALT |Lower| Space |Raise|Left |Down | Up |Right| + * `-----------------------------------------------------------------------' + */ + {KC_ESC, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Z, DE_SCLN, DE_MINS}, + {KC_BSPC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, DE_QUOT}, + {M(0), KC_Y, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, DE_COMM, DE_DOT, DE_SLSH, KC_ENT}, + {KC_LCTL, KC_LGUI, KC_TAB, KC_LALT, F(2), F(3), F(3), F(1), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} +}, +[1] = { /* Symbols + * ,-----------------------------------------------------------------------. + * | | | | | | | | | | | : | | + * |-----------------------------------------------------------------------| + * | | | | | | | | | | | | " | + * |-----------------------------------------------------------------------| + * | | | | | | | | | < | > | ? | | + * |-----------------------------------------------------------------------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------' + */ + {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, DE_DOT, KC_TRNS}, + {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, DE_DQOT}, + {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, M(1), DE_MORE, DE_QST, 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} +}, +[2] = { /* Raise + * ,-----------------------------------------------------------------------. + * | | Ä | | | | | | | Ü | Ö | |Game | + * |-----------------------------------------------------------------------| + * | Del | ä | | ß | | | | | ü | ö | |FVol+| + * |-----------------------------------------------------------------------| + * | | | | | | | | |Stop | Prv | Nxt |FVol-| + * |-----------------------------------------------------------------------| + * |LCTL |LGUI | Tab |LALT |Lower| Space | |Mute |Vol- |Vol+ | P/P | + * `-----------------------------------------------------------------------' + */ + {KC_NO, S(DE_AE), KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, S(DE_UE), S(DE_OE), KC_NO, F(4)}, + {KC_DEL, DE_AE, KC_NO, DE_SS, KC_NO, KC_NO, KC_NO, KC_NO, DE_UE, DE_OE, KC_NO, RALT(KC_F12)}, + {KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_MSTP, KC_MPRV, KC_MNXT, RALT(KC_F11)}, + {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MUTE, KC_VOLD, KC_VOLU, KC_MPLY} +}, +[3] = { /* Lower + * ,-----------------------------------------------------------------------. + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | + | + * |-----------------------------------------------------------------------| + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | = | + * |-----------------------------------------------------------------------| + * | | | | | | [ | ] | { | } | € | | \ | Ent | + * |-----------------------------------------------------------------------| + * |LCTL |LGUI | Tab |LALT | | Space |Raise|Home |PgDn |PgUp | End | + * `-----------------------------------------------------------------------' + */ + {DE_TILD, DE_EXLM, DE_AT, DE_HASH, DE_DLR, DE_PERC, DE_CIRC, DE_AMPR, DE_ASTR, DE_LPRN, DE_RPRN, DE_PLUS}, + {DE_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, DE_EQL}, + {KC_NO, KC_NO, KC_NO, DE_PIPE, DE_LBRC, DE_RBRC, DE_LCBR, DE_RCBR, DE_EURO, KC_NO, DE_BSLS, KC_ENT}, + {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_HOME, KC_PGDN, KC_PGUP, KC_END} +}, +[4] = { /* Function + * ,-----------------------------------------------------------------------. + * | F13 | F14 | F15 | F16 | F17 | F18 | F19 | F20 | F21 | F22 | F23 | F24 | + * |-----------------------------------------------------------------------| + * | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | + * |-----------------------------------------------------------------------| + * | | | | | | KP- | KP+ | | | | |Reset| + * |-----------------------------------------------------------------------| + * | |Light|BL DN|BL UP| | | | |Mute |Vol- |Vol+ | P/P | + * `-----------------------------------------------------------------------' + */ + {KC_F13, KC_F14, KC_F15, KC_F16, KC_F17, KC_F18, KC_F19, KC_F20, KC_F21, KC_F22, KC_F23, KC_F24}, + {KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12}, + {KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_PMNS, KC_PPLS, KC_NO, KC_NO, KC_NO, RESET, KC_NO}, + {KC_NO, BL_TOGG, BL_DEC, BL_INC, FUNC(2), KC_TRNS, KC_TRNS, KC_TRNS, KC_MUTE, KC_VOLD, KC_VOLU, KC_MPLY} +}, +[5] = { /* Gaming + * ,-----------------------------------------------------------------------. + * | Buy | ESC | q | w | e | r | t | y | u | i | o | p | + * |-----------------------------------------------------------------------| + * | ENT | BS | a | s | d | f | g | h | j | k | l | ; | + * |-----------------------------------------------------------------------| + * | CTL | SFT | z | x | c | v | b | n | m | , | Up | / | + * |-----------------------------------------------------------------------| + * | | | Tab | ALT | | Space |CrJmp| GUI |Left |Down |Right| + * `-----------------------------------------------------------------------' + */ + {MO(6), KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Z, KC_U, KC_I, KC_O, F(4)}, + {KC_ENT, KC_BSPC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, DE_SCLN}, + {KC_LCTL, KC_LSFT, KC_Y, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, DE_DOT, KC_UP, DE_SLSH}, + {KC_NO, KC_NO, KC_TAB, KC_LALT, KC_NO, KC_SPC, KC_SPC, LCTL(KC_SPC), KC_LGUI, KC_LEFT, KC_DOWN, KC_RGHT} +}, +[6] = { /* Gaming + /* CS:GO buy binds + * ,-----------------------------------------------------------------------. + * | | | | | | | | | 7 | 8 | 9 | | + * |-----------------------------------------------------------------------| + * | BS | | | | | | | | 6 | 5 | 4 | End | + * |-----------------------------------------------------------------------| + * | CTL | SFT | | | | | | | 1 | 2 | 3 |Pgdn | + * |-----------------------------------------------------------------------| + * | | | Tab | ALT | | Space |CrJmp| | 0 | KP+ |PEnt | + * `-----------------------------------------------------------------------' + */ + {KC_TRNS, KC_NO, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_P7, KC_P8, KC_P9, KC_NO}, + {KC_BSPC, KC_NO, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_P4, KC_P5, KC_P6, KC_END}, + {KC_LCTL, KC_LSFT, KC_Y, KC_X, KC_C, KC_V, KC_B, KC_K, KC_P1, KC_P2, KC_P3, KC_PGDN}, + {KC_NO, KC_NO, KC_TAB, KC_LALT, KC_NO, KC_SPC, KC_SPC, LCTL(KC_SPC), KC_NO, KC_P0, KC_PDOT, KC_PENT} +}, +}; + +const uint16_t PROGMEM fn_actions[] = { + [1] = ACTION_LAYER_MOMENTARY(2), // to RAISE + [2] = ACTION_LAYER_MOMENTARY(3), // to LOWER + [3] = ACTION_LAYER_TAP_KEY(4,KC_SPC), // to Function + [4] = ACTION_LAYER_TOGGLE(5), // toggle Gaming + [5] = ACTION_MODS_TAP_KEY(KC_LSFT, KC_CAPS), //Shift on press, Caps on tap +}; + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) +{ + switch(id) { + case 0: // M(0) + if (record->event.pressed) { + register_code(KC_LSFT); + layer_on(1); + } else { + layer_off(1); + unregister_code(KC_LSFT); + } + break; + case 1: // M(1) + if (record->event.pressed) { + unregister_code(KC_LSFT); + register_code(DE_MORE); + } else { + unregister_code(DE_MORE); + } + break; + } + return MACRO_NONE; + +};
\ No newline at end of file |