Move kmk.util.get_wide_ordinal to kmk.handlers.sequences
This commit is contained in:
parent
1eaf0e2c79
commit
02401e2ec0
@ -2,7 +2,13 @@ from kmk.consts import UnicodeMode
|
|||||||
from kmk.handlers.stock import passthrough
|
from kmk.handlers.stock import passthrough
|
||||||
from kmk.keys import KC, make_key
|
from kmk.keys import KC, make_key
|
||||||
from kmk.types import AttrDict, KeySequenceMeta
|
from kmk.types import AttrDict, KeySequenceMeta
|
||||||
from kmk.util import get_wide_ordinal
|
|
||||||
|
|
||||||
|
def get_wide_ordinal(char):
|
||||||
|
if len(char) != 2:
|
||||||
|
return ord(char)
|
||||||
|
|
||||||
|
return 0x10000 + (ord(char[0]) - 0xD800) * 0x400 + (ord(char[1]) - 0xDC00)
|
||||||
|
|
||||||
|
|
||||||
def sequence_press_handler(key, state, KC, *args, **kwargs):
|
def sequence_press_handler(key, state, KC, *args, **kwargs):
|
||||||
|
@ -1,10 +1,3 @@
|
|||||||
def get_wide_ordinal(char):
|
|
||||||
if len(char) != 2:
|
|
||||||
return ord(char)
|
|
||||||
|
|
||||||
return 0x10000 + (ord(char[0]) - 0xD800) * 0x400 + (ord(char[1]) - 0xDC00)
|
|
||||||
|
|
||||||
|
|
||||||
def reset_keyboard():
|
def reset_keyboard():
|
||||||
try:
|
try:
|
||||||
import machine
|
import machine
|
||||||
|
Loading…
x
Reference in New Issue
Block a user