fixed issue with emojis
This commit is contained in:
parent
14b4d15fcd
commit
6e0ac923fa
1 changed files with 6 additions and 2 deletions
|
@ -3,12 +3,16 @@
|
|||
import string
|
||||
from http.server import HTTPServer, BaseHTTPRequestHandler
|
||||
from io import BytesIO
|
||||
import string
|
||||
import base64
|
||||
|
||||
|
||||
NULL_CHAR = chr(0)
|
||||
file = open('/dev/hidg0', 'rb+')
|
||||
|
||||
alphabet_lower = set(string.ascii_lowercase)
|
||||
alphabet_upper = set(string.ascii_uppercase)
|
||||
|
||||
colors = {
|
||||
"Z": "a", # Black
|
||||
"B": "b", # Blue
|
||||
|
@ -37,9 +41,9 @@ def release_keys():
|
|||
|
||||
|
||||
def printchar(c):
|
||||
if c.islower():
|
||||
if c in alphabet_lower:
|
||||
write_report(NULL_CHAR*2+chr(4 + ord(c) - ord('a'))+NULL_CHAR*5)
|
||||
elif c.isupper():
|
||||
elif c in alphabet_upper:
|
||||
write_report(chr(32)+NULL_CHAR+chr(4 + ord(c) - ord('A'))+NULL_CHAR*5)
|
||||
elif c.isdigit():
|
||||
write_report(NULL_CHAR*2+chr(0x1e + ((ord(c) - ord('0') - 1) % 10))+NULL_CHAR*5)
|
||||
|
|
Loading…
Reference in a new issue