+ 1

How to get character inputs at the same time from user in Python?

I know how to do this in Pygame but not Python. I want it so that I can perform a function when the user presses two keys at the same time. Can anyone please help? Also what i want to do is create an application with Python that allows users to press x and f keys at the same time to navigate through the application

19th Feb 2020, 2:11 AM
Dan
2 Réponses
+ 3
This kind of functionality is not practical for console-based programs.
19th Feb 2020, 2:56 AM
👑 Prometheus 🇸🇬
👑 Prometheus 🇸🇬 - avatar
+ 2
It is kind of useless to have shortcuts in the console, because consoles have their shortcuts as well, it would only lead to problems. However, look up the pynput module to detect keypresses.
19th Feb 2020, 2:24 AM
Aymane Boukrouh
Aymane Boukrouh - avatar