aboutsummaryrefslogtreecommitdiff
path: root/keyboards/clueboard/keymaps/mouse_keys/keymap.c
diff options
context:
space:
mode:
Diffstat (limited to 'keyboards/clueboard/keymaps/mouse_keys/keymap.c')
-rw-r--r--keyboards/clueboard/keymaps/mouse_keys/keymap.c47
1 files changed, 1 insertions, 46 deletions
diff --git a/keyboards/clueboard/keymaps/mouse_keys/keymap.c b/keyboards/clueboard/keymaps/mouse_keys/keymap.c
index d3108d1e2..259fa29b7 100644
--- a/keyboards/clueboard/keymaps/mouse_keys/keymap.c
+++ b/keyboards/clueboard/keymaps/mouse_keys/keymap.c
@@ -1,7 +1,6 @@
1#include "clueboard.h" 1#include "clueboard.h"
2 2
3// Helpful defines 3// Helpful defines
4#define GRAVE_MODS (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT)|MOD_BIT(KC_LGUI)|MOD_BIT(KC_RGUI)|MOD_BIT(KC_LALT)|MOD_BIT(KC_RALT))
5#define _______ KC_TRNS 4#define _______ KC_TRNS
6 5
7// Each layer gets a name for readability, which is then used in the keymap matrix below. 6// Each layer gets a name for readability, which is then used in the keymap matrix below.
@@ -17,7 +16,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
17 /* Keymap _BL: Base Layer (Default Layer) 16 /* Keymap _BL: Base Layer (Default Layer)
18 */ 17 */
19[_BL] = KEYMAP( 18[_BL] = KEYMAP(
20 F(0), 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_GRV, KC_BSPC, KC_PGUP, \ 19 KC_GESC, 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_GRV, KC_BSPC, KC_PGUP, \
21 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_BSLS, KC_PGDN, \ 20 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_BSLS, KC_PGDN, \
22 KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NUHS, KC_ENT, \ 21 KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NUHS, KC_ENT, \
23 KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RO, KC_RSFT, KC_UP, \ 22 KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RO, KC_RSFT, KC_UP, \
@@ -50,47 +49,3 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
50 _______, _______, _______,_______,_______,_______,_______,_______,_______,_______, _______, _______, _______, _______, KC_MS_U, \ 49 _______, _______, _______,_______,_______,_______,_______,_______,_______,_______, _______, _______, _______, _______, KC_MS_U, \
51 _______, _______, _______,_______, LT(_ML, KC_SPC),LT(_ML, KC_SPC), _______, KC_BTN1, KC_BTN2, KC_BTN3, KC_MS_L, KC_MS_D,KC_MS_R), 50 _______, _______, _______,_______, LT(_ML, KC_SPC),LT(_ML, KC_SPC), _______, KC_BTN1, KC_BTN2, KC_BTN3, KC_MS_L, KC_MS_D,KC_MS_R),
52}; 51};
53
54/* This is a list of user defined functions. F(N) corresponds to item N
55 of this list.
56 */
57const uint16_t PROGMEM fn_actions[] = {
58 [0] = ACTION_FUNCTION(0), // Calls action_function()
59};
60
61void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) {
62 static uint8_t mods_pressed;
63 static bool mod_flag;
64
65 switch (id) {
66 case 0:
67 /* Handle the combined Grave/Esc key
68 */
69 mods_pressed = get_mods()&GRAVE_MODS; // Check to see what mods are pressed
70
71 if (record->event.pressed) {
72 /* The key is being pressed.
73 */
74 if (mods_pressed) {
75 mod_flag = true;
76 add_key(KC_GRV);
77 send_keyboard_report();
78 } else {
79 add_key(KC_ESC);
80 send_keyboard_report();
81 }
82 } else {
83 /* The key is being released.
84 */
85 if (mod_flag) {
86 mod_flag = false;
87 del_key(KC_GRV);
88 send_keyboard_report();
89 } else {
90 del_key(KC_ESC);
91 send_keyboard_report();
92 }
93 }
94 break;
95 }
96}