Skip to content

Commit

Permalink
Merge branch 'feature/benblazak#36-non-standard-shifted-keys' into neo2
Browse files Browse the repository at this point in the history
  • Loading branch information
tschulte committed Jun 26, 2014
2 parents c3e3f82 + 014c8b8 commit b94532e
Showing 1 changed file with 55 additions and 17 deletions.
72 changes: 55 additions & 17 deletions firmware/keyboard/ergodox/layout/fragments/keys.part.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,18 @@
void P(name) (void) { KF(press)(value); } \
void R(name) (void) { KF(release)(value); }

/** macros/TYPE__DEFAULT/description
* Define the functions for a default key (i.e. a normal key that presses and
* releases a keycode as you'd expect). Other than KEYS_DEFAULT, this does send
* a press and release event on key press and does not wait for the user
* releasing the key.
*/
#define TYPE__DEFAULT(name, value) \
void P(name) (void) { KF(press)(value); \
usb__kb__send_report(); \
KF(release)(value); } \
void R(name) (void) { }

/** macros/KEYS__SHIFTED/description
* Define the functions for a "shifted" key (i.e. a key that sends a "shift"
* along with the keycode)
Expand All @@ -33,24 +45,50 @@
void R(name) (void) { KF(release)(value); \
KF(release)(KEYBOARD__LeftShift); }

/** macros/TYPE__SHIFTED/description
* Define the functions for a "shifted" key (i.e. a key that sends a "shift"
* along with the keycode). Other than KEYS_SHIFTED, this does send
* a press and release event on key press and does not wait for the user
* releasing the key.
*/
#define TYPE__SHIFTED(name, value) \
void P(name) (void) { KF(press)(KEYBOARD__LeftShift); \
usb__kb__send_report(); \
KF(press)(value); \
usb__kb__send_report(); \
KF(release)(value); \
KF(release)(KEYBOARD__LeftShift); } \
void R(name) (void) { }

/** macros/KEYS__ALT_GR/description
* Define the functions for a "AltGr" key (i.e. a key that sends a "AltGr"
* along with the keycode)
*
* Needed by ".../lib/layout/keys.h"
* along with the keycode).
*/
#define KEYS__ALT_GR(name, value) \
void P(name) (void) { KF(press)(KEYBOARD__RightAlt); \
KF(press)(value); } \
void R(name) (void) { KF(release)(value); \
KF(release)(KEYBOARD__RightAlt); }

/** macros/KEYS__NON_DEAD/description
/** macros/TYPE__ALT_GR/description
* Define the functions for a "AltGr" key (i.e. a key that sends a "AltGr"
* along with the keycode). Other than KEYS_SHIFTED, this does send
* a press and release event on key press and does not wait for the user
* releasing the key.
*/
#define TYPE__ALT_GR(name, value) \
void P(name) (void) { KF(press)(KEYBOARD__RightAlt); \
usb__kb__send_report(); \
KF(press)(value); \
usb__kb__send_report(); \
KF(release)(value); \
KF(release)(KEYBOARD__RightAlt); } \
void R(name) (void) { }

/** macros/TYPE__NON_DEAD/description
* Define the functions for a normally dead key, to be non-dead.
*
* Needed by ".../lib/layout/keys.h"
*/
#define KEYS__NON_DEAD(name, value) \
#define TYPE__NON_DEAD(name, value) \
void P(name) (void) { KF(press)(value); \
usb__kb__send_report(); \
KF(release)(value); \
Expand All @@ -60,13 +98,13 @@
KF(release)(KEYBOARD__Spacebar); } \
void R(name) (void) {}

/** macros/KEYS__NON_DEAD_SHIFTED/description
* Define the functions for a normally dead key, to be non-dead.
*
* Needed by ".../lib/layout/keys.h"
/** macros/TYPE__NON_DEAD_SHIFTED/description
* Define the functions for a normally dead key, which needs the "shift"
* key to be pressed, to be non-dead.
*/
#define KEYS__NON_DEAD_SHIFTED(name, value) \
#define TYPE__NON_DEAD_SHIFTED(name, value) \
void P(name) (void) { KF(press)(KEYBOARD__LeftShift); \
usb__kb__send_report(); \
KF(press)(value); \
usb__kb__send_report(); \
KF(release)(value); \
Expand All @@ -77,13 +115,13 @@
KF(release)(KEYBOARD__Spacebar); } \
void R(name) (void) {}

/** macros/KEYS__NON_DEAD_ALT_GR/description
* Define the functions for a normally dead key, to be non-dead.
*
* Needed by ".../lib/layout/keys.h"
/** macros/TYPE__NON_DEAD_ALT_GR/description
* Define the functions for a normally dead key, which needs the "AltGr"
* key, to be non-dead.
*/
#define KEYS__NON_DEAD_ALT_GR(name, value) \
#define TYPE__NON_DEAD_ALT_GR(name, value) \
void P(name) (void) { KF(press)(KEYBOARD__RightAlt); \
usb__kb__send_report(); \
KF(press)(value); \
usb__kb__send_report(); \
KF(release)(value); \
Expand Down

0 comments on commit b94532e

Please sign in to comment.