reform

MNT Reform: Open Source Portable Computer
Log (Feed) | Files | Refs (Tags) | README

matrix.h (2115B)


      1 /*
      2   MNT Reform 2.0 Keyboard Firmware
      3   See keyboard.c for Copyright
      4   SPDX-License-Identifier: MIT
      5 */
      6 
      7 #include "keyboard.h"
      8 
      9 // Every line of `matrix` is a row of the keyboard, starting from the top.
     10 // Check keyboard.h for the definitions of the default rows.
     11 uint8_t matrix[KBD_MATRIX_SZ] = {
     12   MATRIX_DEFAULT_ROW_1,
     13   MATRIX_DEFAULT_ROW_2,
     14   MATRIX_DEFAULT_ROW_3,
     15   MATRIX_DEFAULT_ROW_4,
     16   MATRIX_DEFAULT_ROW_5,
     17   MATRIX_DEFAULT_ROW_6,
     18 
     19   // Marker for layout editor (FIXME)
     20   KBD_EDITOR_MARKER
     21 };
     22 
     23 // When holding down HYPER
     24 uint8_t matrix_fn[KBD_MATRIX_SZ] = {
     25   // Media keys on Hyper + F7-F12
     26   KEY_ESCAPE,
     27   HID_KEYBOARD_SC_MEDIA_BRIGHTNESS_DOWN,
     28   HID_KEYBOARD_SC_MEDIA_BRIGHTNESS_UP,
     29   KEY_F3,
     30   KEY_F4,
     31   KEY_F5,
     32   KEY_F6,
     33   HID_KEYBOARD_SC_MEDIA_PREVIOUS_TRACK,
     34   HID_KEYBOARD_SC_MEDIA_PLAY,
     35   HID_KEYBOARD_SC_MEDIA_NEXT_TRACK,
     36   HID_KEYBOARD_SC_MEDIA_MUTE,
     37   HID_KEYBOARD_SC_MEDIA_VOLUME_DOWN,
     38   HID_KEYBOARD_SC_MEDIA_VOLUME_UP,
     39   KEY_CIRCLE,
     40 
     41   KEY_GRAVE_ACCENT_AND_TILDE,
     42   KEY_1,
     43   KEY_2,
     44   KEY_3,
     45   KEY_4,
     46   KEY_5,
     47   KEY_6,
     48   KEY_7,
     49   KEY_8,
     50   KEY_9,
     51   KEY_0,
     52   KEY_MINUS_AND_UNDERSCORE,
     53   KEY_EQUAL_AND_PLUS,
     54   KEY_DELETE,
     55 
     56   MATRIX_DEFAULT_ROW_3,
     57   MATRIX_DEFAULT_ROW_4,
     58   MATRIX_DEFAULT_ROW_5,
     59 
     60   HID_KEYBOARD_SC_EXECUTE,
     61   HID_KEYBOARD_SC_LEFT_GUI,
     62   HID_KEYBOARD_SC_RIGHT_CONTROL,
     63   KEY_SPACE,
     64   HID_KEYBOARD_SC_LEFT_ALT,
     65   HID_KEYBOARD_SC_RIGHT_ALT,
     66   KEY_SPACE,
     67   HID_KEYBOARD_SC_HOME,
     68   HID_KEYBOARD_SC_END,
     69   HID_KEYBOARD_SC_LEFT_ARROW,
     70   HID_KEYBOARD_SC_DOWN_ARROW,
     71   HID_KEYBOARD_SC_RIGHT_ARROW
     72 };
     73 
     74 // Second layer (toggled by HYPER+CIRCLE)
     75 uint8_t matrix_fn_toggled[KBD_MATRIX_SZ] = {
     76   // Custom top row
     77   KEY_ESCAPE,
     78   HID_KEYBOARD_SC_MEDIA_BRIGHTNESS_DOWN,
     79   HID_KEYBOARD_SC_MEDIA_BRIGHTNESS_UP,
     80   KEY_F3,
     81   KEY_F4,
     82   KEY_F5,
     83   KEY_F6,
     84   HID_KEYBOARD_SC_MEDIA_PREVIOUS_TRACK,
     85   HID_KEYBOARD_SC_MEDIA_PLAY,
     86   HID_KEYBOARD_SC_MEDIA_NEXT_TRACK,
     87   HID_KEYBOARD_SC_MEDIA_MUTE,
     88   HID_KEYBOARD_SC_MEDIA_VOLUME_DOWN,
     89   HID_KEYBOARD_SC_MEDIA_VOLUME_UP,
     90   KEY_CIRCLE,
     91 
     92   MATRIX_DEFAULT_ROW_2,
     93   MATRIX_DEFAULT_ROW_3,
     94   MATRIX_DEFAULT_ROW_4,
     95   MATRIX_DEFAULT_ROW_5,
     96   MATRIX_DEFAULT_ROW_6
     97 };