diff options
author | Ethan Beyer <ethan@ethanbeyer.com> | 2019-12-12 05:53:39 -0500 |
---|---|---|
committer | James Young <18669334+noroadsleft@users.noreply.github.com> | 2019-12-12 02:53:39 -0800 |
commit | 45e71aedf030d80e62c491c4a906fdf88ccaec0c (patch) | |
tree | 17c820a26655ce4fb1cb8f306786221abd2cd673 /keyboards/dz60/keymaps/_bonfire/not-in-use/super-alt-tab.c | |
parent | bbad6e1ae7c68b4bf19c9d13f7347ce2b664fed6 (diff) |
[Keymap] My DZ60 Layout and files (#7537)
* I don't know if this is how my keyboard is laid out or not
* testing, still broken
* name change
* I think this is the layout I will try to use to start
* it compiles!
* added norman layout!
* media keys
* Moved backlight functions to KEYB
Moved Delete off of Backspace and to the < key
* more changes to layout, move Norman to 1 so it was moddable by FCTN
* swapped volume and media, I use volume a lot more than media
* Eh, it's still all in flux.
* I don't want the entire function layer full of dead keys, after all...
* moves escape to the caps lock key and caps lock to the functions layer
* update my readme for posterity
* Updates bonfire dz60 for better escape control
* WIP commit -- this is not working yet
* updates keymap for GAME layer
adds info to README
adds visual keyboard layout map in json and jpg for reference
* updates readme for visual keymap insertion
* removes my layout from the parent folder and keeps it localized
* updates the C code to be more readable
* finished the HELD_ESCAPE code
* finishes v6.1.0
* updates layout names to match repo code style per @mechmerlin
Apply suggestions from code review
* updates to code style per suggestions by @mechmerlin
* Update global-functions.c
updates some personal documentation
* updates hold time for escape on gaming layer
* updates several aspects of the code based on PR requests
* moves a variable
Diffstat (limited to 'keyboards/dz60/keymaps/_bonfire/not-in-use/super-alt-tab.c')
-rw-r--r-- | keyboards/dz60/keymaps/_bonfire/not-in-use/super-alt-tab.c | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/keyboards/dz60/keymaps/_bonfire/not-in-use/super-alt-tab.c b/keyboards/dz60/keymaps/_bonfire/not-in-use/super-alt-tab.c new file mode 100644 index 0000000000..1d951b1bcf --- /dev/null +++ b/keyboards/dz60/keymaps/_bonfire/not-in-use/super-alt-tab.c @@ -0,0 +1,37 @@ +/** + * Cool Function where a single key does ALT+TAB + * From: https://beta.docs.qmk.fm/features/feature_macros#super-alt-tab + */ +bool is_alt_tab_active = false; // ADD this near the begining of keymap.c +uint16_t alt_tab_timer = 0; // we will be using them soon. + +enum custom_keycodes { // Make sure have the awesome keycode ready + ALT_TAB = SAFE_RANGE, +}; + +// key processing +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { // This will do most of the grunt work with the keycodes. + case ALT_TAB: + if (record->event.pressed) { + if (!is_alt_tab_active) { + is_alt_tab_active = true; + register_code(KC_LALT); + } + alt_tab_timer = timer_read(); + register_code(KC_TAB); + } else { + unregister_code(KC_TAB); + } + break; + } + return true; +} + +// The very important timer. +void matrix_scan_user(void) { + if (is_alt_tab_active && timer_elapsed(alt_tab_timer) > 1000) { + unregister_code(KC_LALT); + is_alt_tab_active = false; + } +}
\ No newline at end of file |