I want to make a game that requires the arrow keys to be pressed. How do I detect if a key has been pressed?

In a lot of UI libraries, an event will be passed from the event loop when a button is pressed. Some libraries will call a function or a method directly instead of implementing an event.

What are you using to create your UI?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.