 void dudrackKeyDown(uint8_t key) {
     switch (key) {
         case KEY_HENKAN:
-            henkanPressed = true;
+            keyboardState.henkanPressed = true;
 
             return;
 
         case KEY_MUHENKAN:
-            muhenkanPressed = true;
+            pressModifier(MODIFIER_LEFT_SHIFT);
+            keyboardState.muhenkanPressed = true;
 
             return;
 
         case KEY_SPACE:
             pressModifier(MODIFIER_LEFT_SHIFT);
-            spacePressed = true;
-            noEventBetweenSpaceEvents = true;
+            keyboardState.spacePressed = true;
+            keyboardState.noEventBetweenSpaceEvents = true;
 
             return;
 
         default:
-            noEventBetweenSpaceEvents = false;
-
-            if (muhenkanPressed) {
-                pressModifier(MODIFIER_LEFT_SHIFT);
-            }
-
-            if (henkanPressed || muhenkanPressed) {
+            keyboardState.noEventBetweenSpaceEvents = false;
+
+            if (keyboardState.henkanPressed || keyboardState.muhenkanPressed) {
                 pressKey(keyMappings[MAPPING_HENKAN][key]);
             } else {
                 pressKey(keyMappings[MAPPING_NEUTRAL][key]);

        default:
            releaseKey(keyMappings[MAPPING_HENKAN][key]);
            releaseKey(keyMappings[MAPPING_NEUTRAL][key]);

            if (muhenkanPressed) {
                releaseModifier(MODIFIER_LEFT_SHIFT);
            }
    }
}


            return;
        }

        switch (keyboardState.currentMode) {
            case MODE_NEUTRAL:
                pressKey(key);
                return;
