/* Copyright 2013 Oleg Kostyuk 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 "bootloader.h" #include "keymap_common.h" const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KEYMAP( // layer 0 : default // left hand EQL, 1, 2, 3, 4, 5, ESC, BSLS,Q, W, E, R, T, FN2, TAB, A, S, D, F, G, LSFT,Z, X, C, V, B, FN1, LGUI,GRV, BSLS,LEFT,RGHT, LCTL,LALT, HOME, BSPC,DEL, END, // right hand FN3, 6, 7, 8, 9, 0, MINS, LBRC,Y, U, I, O, P, RBRC, H, J, K, L, SCLN,QUOT, FN1, N, M, COMM,DOT, SLSH,RSFT, LEFT,DOWN,UP, RGHT,RGUI, RALT,RCTL, PGUP, PGDN,ENT, SPC ), KEYMAP( // layer 1 : function and symbol keys // left hand TRNS,F1, F2, F3, F4, F5, F11, TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,FN4, TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, TRNS,TRNS,TRNS,TRNS,TRNS, TRNS,TRNS, TRNS, TRNS,TRNS,TRNS, // right hand F12, F6, F7, F8, F9, F10, TRNS, TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, TRNS,TRNS,TRNS,TRNS,TRNS, TRNS,TRNS, TRNS, TRNS,TRNS,TRNS ), KEYMAP( // layer 2 : keyboard functions // left hand 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, // right hand FN4, TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, TRNS,TRNS,TRNS,TRNS,TRNS, TRNS,TRNS, TRNS, TRNS,TRNS,TRNS ), KEYMAP( // layer 3: numpad // left hand TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, TRNS,TRNS,TRNS,TRNS,TRNS, TRNS,TRNS, TRNS, TRNS,TRNS,TRNS, // right hand TRNS,NLCK,PSLS,PAST,PAST,PMNS,BSPC, TRNS,NO, P7, P8, P9, PMNS,BSPC, NO, P4, P5, P6, PPLS,PENT, TRNS,NO, P1, P2, P3, PPLS,PENT, P0, PDOT,SLSH,PENT,PENT, TRNS,TRNS, TRNS, TRNS,TRNS,TRNS ), }; /* id for user defined functions */ enum function_id { TEENSY_KEY, }; /* * Fn action definition */ const uint16_t PROGMEM fn_actions[] = { ACTION_FUNCTION(TEENSY_KEY), // FN0 - Teensy key ACTION_LAYER_MOMENTARY(1), // FN1 - switch to Layer1 ACTION_LAYER_SET(2, ON_PRESS), // FN2 - set Layer2 ACTION_LAYER_TOGGLE(3), // FN3 - toggle Layer3 aka Numpad layer ACTION_LAYER_SET(0, ON_PRESS), // FN4 - set Layer0 }; void action_function(keyrecord_t *event, uint8_t id, uint8_t opt) { if (id == TEENSY_KEY) { clear_keyboard(); print("\n\nJump to bootloader... "); _delay_ms(250); bootloader_jump(); // should not return print("not supported.\n"); } }