From 34767d8f698059c58ca7cd94a9a676381d7ab2e1 Mon Sep 17 00:00:00 2001 From: Cube Date: Tue, 4 Mar 2025 13:02:37 +0000 Subject: [PATCH] improove --- CARDPUTER CircuitPython/full_display_test.py | 4 ++-- CARDPUTER CircuitPython/keyboard.py | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/CARDPUTER CircuitPython/full_display_test.py b/CARDPUTER CircuitPython/full_display_test.py index 2811224..c3097c3 100644 --- a/CARDPUTER CircuitPython/full_display_test.py +++ b/CARDPUTER CircuitPython/full_display_test.py @@ -11,7 +11,7 @@ from keyboard import Keyboard keyb = Keyboard() -text = "" +text = "Press CTRL+D to clear text\n\n" text_area = label.Label(terminalio.FONT, text=text) text_area.x = 10 text_area.y = 10 @@ -22,7 +22,7 @@ while True: if key == "BACKSP": text = text[:-1] elif key == "CTRLD": - text = "" + text = "Press CTRL+D to clear text\n\n" else: text = text+key text_area.text = text diff --git a/CARDPUTER CircuitPython/keyboard.py b/CARDPUTER CircuitPython/keyboard.py index 29845d3..48dabec 100644 --- a/CARDPUTER CircuitPython/keyboard.py +++ b/CARDPUTER CircuitPython/keyboard.py @@ -4,7 +4,10 @@ class Keyboard: def __init__(self): # the number row starts with 3 and ends with the number, e.g. key number 5 is 0x35 self.number_row=["0x30","0x31","0x32","0x33","0x34","0x35","0x36","0x37","0x38","0x39"] - self.chars={"0x21":"!","0x40":"@","0x23":"#","0x24":"$","0x25":"%","0x5e":"^","0x26":"&","0x2a":"*","0x28":"(","0x29":")", "0x3f":"?"} + self.chars={ + "0x21":"!","0x40":"@","0x23":"#","0x24":"$","0x25":"%","0x5e":"^","0x26":"&","0x2a":"*","0x28":"(","0x29":")", "0x3f":"?", + "0x27":"'", "0x22":"\"", "0x3a":":", "0x3c":"<", "0x3e":">" + } self.lowercase={ "0x71":"q", "0x77":"w", "0x65":"e", "0x72":"r", "0x74":"t", "0x79":"y", "0x75":"u", "0x69":"i", "0x6f":"o", "0x70":"p", "0x61":"a", "0x73":"s", "0x64":"d", "0x66":"f", "0x67":"g", "0x68":"h", "0x6a":"j", "0x6b":"k", "0x6c":"l",