added blink support
This commit is contained in:
parent
8a5b554240
commit
259f8e3506
1 changed files with 10 additions and 9 deletions
19
server.py
19
server.py
|
@ -17,14 +17,14 @@ colors = {
|
||||||
"P": "f", # Pink
|
"P": "f", # Pink
|
||||||
"Y": "g", # Yellow
|
"Y": "g", # Yellow
|
||||||
"W": "h", # White
|
"W": "h", # White
|
||||||
"z": "i", # Light Black
|
"z": "i", # Light/blink Black
|
||||||
"b": "j", # Light Blue
|
"b": "j", # Light/blink Blue
|
||||||
"g": "k", # Light Green
|
"g": "k", # Light/blink Green
|
||||||
"m": "l", # Light Magenta
|
"m": "l", # Light/blink Magenta
|
||||||
"r": "m", # Light Red
|
"r": "m", # Light/blink Red
|
||||||
"p": "n", # Light Pink
|
"p": "n", # Light/blink Pink
|
||||||
"y": "o", # Light Yellow
|
"y": "o", # Light/blink Yellow
|
||||||
"w": "p" # Light White
|
"w": "p" # Light/blink White
|
||||||
}
|
}
|
||||||
|
|
||||||
def write_report(report):
|
def write_report(report):
|
||||||
|
@ -53,7 +53,7 @@ def printchar(c):
|
||||||
|
|
||||||
|
|
||||||
def change_color(background: str, foreground: str):
|
def change_color(background: str, foreground: str):
|
||||||
if background in colors and foreground in colors and background.isupper():
|
if background in colors and foreground in colors:
|
||||||
# DELETE keypress
|
# DELETE keypress
|
||||||
write_report(NULL_CHAR*2+chr(0x2a)+NULL_CHAR*5)
|
write_report(NULL_CHAR*2+chr(0x2a)+NULL_CHAR*5)
|
||||||
release_keys()
|
release_keys()
|
||||||
|
@ -61,6 +61,7 @@ def change_color(background: str, foreground: str):
|
||||||
release_keys()
|
release_keys()
|
||||||
write_report(NULL_CHAR*2+chr(4 + ord(colors[foreground]) - ord('a'))+NULL_CHAR*5)
|
write_report(NULL_CHAR*2+chr(4 + ord(colors[foreground]) - ord('a'))+NULL_CHAR*5)
|
||||||
else:
|
else:
|
||||||
|
print('Malformed Color code: §' + background + foreground)
|
||||||
write_report(chr(32)+NULL_CHAR+chr(0x38)+NULL_CHAR*5)
|
write_report(chr(32)+NULL_CHAR+chr(0x38)+NULL_CHAR*5)
|
||||||
release_keys()
|
release_keys()
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue