The Pianist
The Pianist

Reputation: 556

How to know Shift key status when a key is pressed in C?

I want to write a program that waits until CTRL + SHIFT + A is pressed and then it prints "Hello World!". I'm using MacOSX and I want it to be Console-Based.

Upvotes: 3

Views: 203

Answers (1)

Jouni K. Seppänen
Jouni K. Seppänen

Reputation: 44152

If "Console-Based" means that the program must run in a terminal, it cannot distinguish Ctrl+A from Ctrl+Shift+A; both produce the same input.

Upvotes: 3

Related Questions