try to expose transcoding key codes to ascii into kc_to_ascii
This commit is contained in:
1 parent
ebc188f265
commit
5684a3747a
6 files changed
+64
-32
No files matched your search
+29
-8
@@ -1,13 +1,34 @@
|
||||
// Author: redlineo, romanov.pd@gmail.com
|
||||
|
||||
#include "kc_to_ascii.h"
|
||||
|
||||
void crypto_process_record_user(uint16_t keycode, keyrecord_t *record, uint8_t readed_key) {
|
||||
switch (keycode) {
|
||||
case KC_1:
|
||||
if (record->event.pressed) {
|
||||
uint8_t shift_tracker = 0;
|
||||
|
||||
uint8_t kc_to_ascii(uint16_t keycode, keyrecord_t *record, uint8_t readed_key[]) {
|
||||
switch (keycode) {
|
||||
case KC_LEFT_SHIFT:
|
||||
if (record->event.pressed) {
|
||||
register_code(KC_LEFT_SHIFT);
|
||||
shift_tracker = 1;
|
||||
}
|
||||
return 1;
|
||||
break;
|
||||
case KC_1:
|
||||
if (record->event.pressed) {
|
||||
if (shift_tracker == 1) {
|
||||
unregister_code(KC_LEFT_SHIFT);
|
||||
shift_tracker = 0;
|
||||
readed_key[count_char_key] = ASCII_UP_1;
|
||||
} else {
|
||||
readed_key[count_char_key] = ASCII_LOW_1;
|
||||
count_char_key++;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
dprintf("%d",readed_key[count_char_key]);
|
||||
count_char_key++;
|
||||
}
|
||||
return 1;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
Reference in new issue
Block a user