PlayCover / PlayTools

Tools for keymapping, dynamic resolution, and more
GNU Affero General Public License v3.0
71 stars 56 forks source link

Support mapping more keys & fix controller D-Pad input issue in keymap editor #148

Closed XuYicong closed 4 months ago

XuYicong commented 5 months ago

Can now map more keys on different types of keyboards, including number keypad and function keys up to F20.

Fix controller direction pad issue when setting the key in the keymap editor, where the element has to be unfocused before a D-Pad key is released to be mapped.

Also, testing on an Xbox controller shows the D-Pad up and down key are reversed. They're now swapped back.

截屏2024-06-07 15 01 04
XuYicong commented 4 months ago

I was considering a way of decreasing the file length. There are three dicts: mapVirtualToName, mapGCtoName and mapVirtualToGc. Actually mapVirtualToName can be generated from the other two dicts during class initialization. In that way we can both shorten the file length and mitigate the risk of data inconsistency when editing these dicts. Do you think it's a good idea?

Depal1 commented 4 months ago

I was considering a way of decreasing the file length. There are three dicts: mapVirtualToName, mapGCtoName and mapVirtualToGc. Actually mapVirtualToName can be generated from the other two dicts during class initialization. In that way we can both shorten the file length and mitigate the risk of data inconsistency when editing these dicts. Do you think it's a good idea?

By all means, it would be a better approach for the maintainability of the code.