unicode working, i think
This commit is contained in:
parent
5bb7ef0012
commit
6ec03b2218
6 changed files with 383 additions and 2 deletions
|
@ -28,6 +28,16 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
static action_t keycode_to_action(uint16_t keycode);
|
||||
|
||||
|
||||
uint16_t hextokeycode(int hex) {
|
||||
if (hex == 0x0) {
|
||||
return KC_0;
|
||||
} else if (hex < 0xA) {
|
||||
return KC_1 + (hex - 0x1);
|
||||
} else {
|
||||
return KC_A + (hex - 0xA);
|
||||
}
|
||||
}
|
||||
|
||||
/* converts key to action */
|
||||
action_t action_for_key(uint8_t layer, keypos_t key)
|
||||
{
|
||||
|
@ -78,6 +88,11 @@ action_t action_for_key(uint8_t layer, keypos_t key)
|
|||
action_t action;
|
||||
action.code = ACTION_FUNCTION_OPT(keycode & 0xFF, (keycode & 0x0F00) >> 8);
|
||||
return action;
|
||||
} else if (keycode >= 0x8000 && keycode < 0x9000) {
|
||||
action_t action;
|
||||
uint16_t unicode = keycode & ~(0x8000);
|
||||
action.code = ACTION_FUNCTION_OPT(unicode & 0xFF, (unicode & 0xFF00) >> 8);
|
||||
return action;
|
||||
}
|
||||
|
||||
switch (keycode) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue