jtroo / kanata

Improve keyboard comfort and usability with advanced customization
GNU Lesser General Public License v3.0
3.21k stars 131 forks source link

feat: Include numeric key code in KeyEvent Debug #1089

Closed thomasa88 closed 5 months ago

thomasa88 commented 6 months ago

Describe your changes. Use imperative present tense.

Add the numeric key code value after the enum literal name in debug prints of KeyEvent.

Printing the numeric key code together with the pressed key enum value makes it much easier to create custom deflocalkeys.

Example --debug output:

21:42:09.5202 [DEBUG] (3) kanata_state_machine::kanata: process recv ev KeyEvent { code: KEY_LEFTCTRL (29), value: Press }
21:42:09.6403 [DEBUG] (3) kanata_state_machine::kanata: process recv ev KeyEvent { code: KEY_I (23), value: Press }

Checklist

It might be a better fit to modify the Debug implementation of OsCode, but I'm not sure how to do it correctly.

jtroo commented 6 months ago

Thanks for the PR!