summaryrefslogtreecommitdiffstats
path: root/tmk_core/common
diff options
context:
space:
mode:
authorGiuseppe Rota <rota.giuseppe@gmail.com>2018-11-28 17:19:07 +0100
committerDrashna Jaelre <drashna@live.com>2018-11-28 08:19:07 -0800
commit8b85ec2a987d378fb95eea1468eadea70aec2cbf (patch)
treedf3e29b6c643cd36cec19d98d4ec3a4130baf49a /tmk_core/common
parent3b42cff51607171285754ced097392332b40b5fd (diff)
Add Extrakey support for Brightness up/down (#4477)
Diffstat (limited to 'tmk_core/common')
-rw-r--r--tmk_core/common/keycode.h6
-rw-r--r--tmk_core/common/report.h7
2 files changed, 11 insertions, 2 deletions
diff --git a/tmk_core/common/keycode.h b/tmk_core/common/keycode.h
index 61642ae84f..d6fef2bebf 100644
--- a/tmk_core/common/keycode.h
+++ b/tmk_core/common/keycode.h
@@ -33,7 +33,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define IS_SPECIAL(code) ((0xA5 <= (code) && (code) <= 0xDF) || (0xE8 <= (code) && (code) <= 0xFF))
#define IS_SYSTEM(code) (KC_PWR <= (code) && (code) <= KC_WAKE)
-#define IS_CONSUMER(code) (KC_MUTE <= (code) && (code) <= KC_MRWD)
+#define IS_CONSUMER(code) (KC_MUTE <= (code) && (code) <= KC_BRID)
#define IS_FN(code) (KC_FN0 <= (code) && (code) <= KC_FN31)
@@ -170,6 +170,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define KC_WFAV KC_WWW_FAVORITES
#define KC_MFFD KC_MEDIA_FAST_FORWARD
#define KC_MRWD KC_MEDIA_REWIND
+#define KC_BRIU KC_BRIGHTNESS_UP
+#define KC_BRID KC_BRIGHTNESS_DOWN
/* Mouse Keys */
#define KC_MS_U KC_MS_UP
@@ -457,6 +459,8 @@ enum internal_special_keycodes {
KC_WWW_FAVORITES,
KC_MEDIA_FAST_FORWARD,
KC_MEDIA_REWIND,
+ KC_BRIGHTNESS_UP,
+ KC_BRIGHTNESS_DOWN,
/* Fn keys */
KC_FN0 = 0xC0,
diff --git a/tmk_core/common/report.h b/tmk_core/common/report.h
index 5a1a6b19c7..eb9afb727e 100644
--- a/tmk_core/common/report.h
+++ b/tmk_core/common/report.h
@@ -38,6 +38,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
/* Consumer Page(0x0C)
* following are supported by Windows: http://msdn.microsoft.com/en-us/windows/hardware/gg463372.aspx
+ * see also https://docs.microsoft.com/en-us/windows-hardware/drivers/hid/display-brightness-control
*/
#define AUDIO_MUTE 0x00E2
#define AUDIO_VOL_UP 0x00E9
@@ -47,6 +48,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define TRANSPORT_STOP 0x00B7
#define TRANSPORT_STOP_EJECT 0x00CC
#define TRANSPORT_PLAY_PAUSE 0x00CD
+#define BRIGHTNESSUP 0x006F
+#define BRIGHTNESSDOWN 0x0070
/* application launch */
#define AL_CC_CONFIG 0x0183
#define AL_EMAIL 0x018A
@@ -189,7 +192,9 @@ typedef struct {
(key == KC_WWW_FORWARD ? AC_FORWARD : \
(key == KC_WWW_STOP ? AC_STOP : \
(key == KC_WWW_REFRESH ? AC_REFRESH : \
- (key == KC_WWW_FAVORITES ? AC_BOOKMARKS : 0)))))))))))))))))))))
+ (key == KC_BRIGHTNESS_UP ? BRIGHTNESSUP : \
+ (key == KC_BRIGHTNESS_DOWN ? BRIGHTNESSDOWN : \
+ (key == KC_WWW_FAVORITES ? AC_BOOKMARKS : 0)))))))))))))))))))))))
uint8_t has_anykey(report_keyboard_t* keyboard_report);
uint8_t get_first_key(report_keyboard_t* keyboard_report);