ble nano hid over gatt
Dependencies: BLE_API mbed-dev nRF51822
Diff: keymap.h
- Revision:
- 86:e0fab77e669d
- Parent:
- 48:d6938de02f62
--- a/keymap.h Thu Sep 15 08:48:57 2016 +0900 +++ b/keymap.h Thu Sep 15 09:31:05 2016 +0900 @@ -38,6 +38,14 @@ DEBUG_PRINTF_KEYEVENT("LAYER->%d\r\n", keymap.layer); } + static void consumer_play_pause(Keymap& keymap, const bool pressed) { + if (pressed) { + HIDController::pressConsumerKey(0x00cd); + } else { + HIDController::releaseConsumerKey(); + } + } + void execute(const int row, const int col, const bool pressed) { for (int i = 0; ; i++) { const keyfunc_t& keyfunc = KEYMAP_FUNCTIONS[i]; @@ -100,6 +108,7 @@ const keyfunc_t Keymap::KEYMAP_FUNCTIONS[] = { { 5, 14, &Keymap::switch_layer }, + { 5, 5, &Keymap::consumer_play_pause }, { -1, -1, 0 } /* for iteration */ };