Diskey is an application that can present the press/release activities of mouse and keyboard on the screen. Diskey is written in C for effectiency. There is a similar project named showkeys written in python.
How to build the project, please see README
https://developer.mozilla.org/zh-CN/docs/Web/API/UI_Events/Keyboard_event_key_values