Browse Source

Update 'CARDPUTER CircuitPython/keyboard_test.py'

cube 9 months ago
parent
commit
abb9291ee3
2 changed files with 15 additions and 5 deletions
  1. 15
    0
      CARDPUTER CircuitPython/keyboard_test.py
  2. 0
    5
      CARDPUTER CircuitPython/test.py

+ 15
- 0
CARDPUTER CircuitPython/keyboard_test.py View File

@@ -0,0 +1,15 @@
1
+from keyboard import Keyboard
2
+
3
+# Initialize keyboard object
4
+keyb=Keyboard()
5
+
6
+# Must be running on a loop
7
+while True:
8
+    print(keyb.scan(), end="") 
9
+    # This will print all keys and special, without special programming (backspace will print as BACKSP)
10
+    # end="" prevents the print statement from starting a new line every time, it isn't necessary
11
+    # It just makes it look more like a text editor and takes up less space
12
+    
13
+    # The keyboard library is a work in progress and ALL keys/combinations aren't mapped yet.
14
+    # The most important ones are though, so it's useable in it's current state.
15
+    # Use this program or the text editor to find unknown codes and add them to the library

+ 0
- 5
CARDPUTER CircuitPython/test.py View File

@@ -1,5 +0,0 @@
1
-from keyboard import Keyboard
2
-
3
-keyb=Keyboard()
4
-while True:
5
-    print(keyb.scan(), end="")