1#!/usr/local/bin/python3.8
2"""
3You can use this tool to find out values of keypresses
4"""
5
6from __future__ import (absolute_import, division, print_function)
7
8import curses
9
10
11SEPARATOR = '; '
12
13
14@curses.wrapper
15def main(window):
16    curses.mousemask(curses.ALL_MOUSE_EVENTS)
17    curses.mouseinterval(0)
18    while True:
19        char = window.getch()
20        if char == curses.KEY_MOUSE:
21            window.addstr(repr(curses.getmouse()) + SEPARATOR)
22        else:
23            window.addstr(str(char) + SEPARATOR)
24