aboutsummaryrefslogtreecommitdiffstats
path: root/keyboard
diff options
context:
space:
mode:
authorGravatar tmk <nobody@nowhere>2013-01-23 23:53:51 +0900
committerGravatar tmk <nobody@nowhere>2013-01-23 23:53:51 +0900
commit28b5f69ce5c8b35d40725b490e7a2d4bfe922ad4 (patch)
tree1a427f0e0d410fee5f57bfc170e31ef2d7050ac9 /keyboard
parent1fe820a8654b69576875a8173e22b47b365c2460 (diff)
downloadqmk_firmware-28b5f69ce5c8b35d40725b490e7a2d4bfe922ad4.tar.gz
Add prototype of Action Function.
Diffstat (limited to 'keyboard')
-rw-r--r--keyboard/hhkb/keymap.c20
1 files changed, 18 insertions, 2 deletions
diff --git a/keyboard/hhkb/keymap.c b/keyboard/hhkb/keymap.c
index e29b37b16..e4eeb3e39 100644
--- a/keyboard/hhkb/keymap.c
+++ b/keyboard/hhkb/keymap.c
@@ -56,7 +56,8 @@ static const uint16_t PROGMEM fn_actions[] = {
ACTION_LAYER_SET_ON_PRESSED(1), // Fn1
ACTION_LAYER_SET_TAP_KEY(2, KC_SLASH), // Fn2
ACTION_LAYER_SET_TAP_KEY(3, KC_SCLN), // Fn3
- ACTION_LAYER_SET_ON_PRESSED(3), // Fn4
+ //ACTION_LAYER_SET_ON_PRESSED(3), // Fn4
+ ACTION_FUNCTION(0x01, 0xA), // Fn4
ACTION_LAYER_SET_TAP_KEY(5, KC_SPC), // Fn5
ACTION_LMODS_TAP(MOD_BIT(KC_LCTL), KC_BSPC), // Fn6
ACTION_RMODS_TAP(MOD_BIT(KC_RCTL), KC_ENT), // Fn7
@@ -196,7 +197,7 @@ action_t keymap_get_action(uint8_t layer, uint8_t row, uint8_t col) {
case KC_MS_UP ... KC_MS_ACCEL2:
action.code = ACTION_MOUSEKEY(key);
break;
-/*
+/* TODO
case KC_LCTRL ... KC_LGUI:
action.code = ACTION_LMODS(MOD_BIT(key));
break;
@@ -214,3 +215,18 @@ action_t keymap_get_action(uint8_t layer, uint8_t row, uint8_t col) {
}
return action;
}
+
+// TODO: how to define action function
+void action_call_function(keyevent_t event, uint8_t id)
+{
+ // '(' Shift+9
+ if (event.pressed) {
+ register_code(KC_LSHIFT);
+ register_code(KC_9);
+ debug("action_call_function: pressed: id: "); debug_hex(id); debug("\n");
+ } else {
+ unregister_code(KC_9);
+ unregister_code(KC_LSHIFT);
+ debug("action_call_function: released: id: "); debug_hex(id); debug("\n");
+ }
+}