logo

qmk_firmware

custom branch of QMK firmware git clone https://anongit.hacktivis.me/git/qmk_firmware.git

keymap.c (1998B)


  1. /* Copyright 2018 Jack Humbert
  2. *
  3. * This program is free software: you can redistribute it and/or modify
  4. * it under the terms of the GNU General Public License as published by
  5. * the Free Software Foundation, either version 2 of the License, or
  6. * (at your option) any later version.
  7. *
  8. * This program is distributed in the hope that it will be useful,
  9. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. * GNU General Public License for more details.
  12. *
  13. * You should have received a copy of the GNU General Public License
  14. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  15. */
  16. #include QMK_KEYBOARD_H
  17. #define BASE 0
  18. #define FN 1
  19. const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
  20. [BASE] = LAYOUT(
  21. KC_7, KC_8, KC_9,
  22. KC_4, KC_5, KC_6,
  23. KC_1, KC_2, KC_3,
  24. MO(1), KC_0, KC_DOT
  25. ),
  26. [FN] = LAYOUT(
  27. KC_TRNS, KC_HOME, KC_PGUP,
  28. KC_TRNS, KC_END, KC_PGDN,
  29. KC_TRNS, KC_TRNS, KC_TRNS,
  30. KC_TRNS, KC_TRNS, KC_ENT
  31. )
  32. };
  33. #ifdef OLED_ENABLE
  34. oled_rotation_t oled_init_user(oled_rotation_t rotation) {
  35. return OLED_ROTATION_270; // flips the display 180 degrees if offhand
  36. }
  37. bool oled_task_user(void) {
  38. // Host Keyboard Layer Status
  39. oled_write_P(PSTR("Let's\nbuild\nsome-\nthing\nto-\nget-\nher!"), false);
  40. switch (get_highest_layer(layer_state)) {
  41. case BASE:
  42. oled_write_ln_P(PSTR(""), false);
  43. break;
  44. case FN:
  45. oled_write_ln_P(PSTR("FN"), false);
  46. break;
  47. default:
  48. // Or use the write_ln shortcut over adding '\n' to the end of your string
  49. oled_write_ln_P(PSTR("Undef"), false);
  50. }
  51. // Host Keyboard LED Status
  52. led_t led_state = host_keyboard_led_state();
  53. oled_write_P(led_state.num_lock ? PSTR("NLCK ") : PSTR(" "), false);
  54. oled_write_P(led_state.caps_lock ? PSTR("CAPS ") : PSTR(" "), false);
  55. oled_write_P(led_state.scroll_lock ? PSTR("SCRLK") : PSTR(" "), false);
  56. return false;
  57. }
  58. #endif