summary refs log tree commit diff stats
path: root/doc/tools/print_keys.py
diff options
context:
space:
mode:
Diffstat (limited to 'doc/tools/print_keys.py')
-rwxr-xr-xdoc/tools/print_keys.py21
1 files changed, 11 insertions, 10 deletions
diff --git a/doc/tools/print_keys.py b/doc/tools/print_keys.py
index 73091db4..cf915591 100755
--- a/doc/tools/print_keys.py
+++ b/doc/tools/print_keys.py
@@ -3,18 +3,19 @@
 You can use this tool to find out values of keypresses
 """
 
-from curses import *
+import curses
 
-sep = '; '
 
+SEPARATOR = '; '
 
-@wrapper
-def main(w):
-    mousemask(ALL_MOUSE_EVENTS)
-    mouseinterval(0)
+
+@curses.wrapper
+def main(window):
+    curses.mousemask(curses.ALL_MOUSE_EVENTS)
+    curses.mouseinterval(0)
     while True:
-        ch = w.getch()
-        if ch == KEY_MOUSE:
-            w.addstr(repr(getmouse()) + sep)
+        char = window.getch()
+        if char == curses.KEY_MOUSE:
+            window.addstr(repr(curses.getmouse()) + SEPARATOR)
         else:
-            w.addstr(str(ch) + sep)
+            window.addstr(str(char) + SEPARATOR)