Move kmk.util.get_wide_ordinal to kmk.handlers.sequences

This commit is contained in:
Josh Klar 2019-07-24 23:44:26 -07:00
parent 1eaf0e2c79
commit 02401e2ec0
No known key found for this signature in database
GPG Key ID: A4A0C7B4E8EEE222
2 changed files with 7 additions and 8 deletions

View File

@ -2,7 +2,13 @@ from kmk.consts import UnicodeMode
from kmk.handlers.stock import passthrough
from kmk.keys import KC, make_key
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):

View File

@ -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():
try:
import machine