| | |
Get keyboard key name?
Please support our C advertiser: Programming Forums - DaniWeb Sister Site
![]() |
•
•
Join Date: Mar 2008
Posts: 1,442
Reputation:
Solved Threads: 118
0
#2 31 Days Ago
Nope, not as far as I know, you will just have to create a function to return the right values, this could be a start:
C Syntax (Toggle Plain Text)
string getValueName(char vk) { string name; if ( vk >= '0' && vk <= '9' ) { name.push_back( vk ); return name; } switch ( vk ) { case VK_SPACE: return "Space"; case VK_SHIFT: return "Shift"; // ... more cases } return ""; }
Last edited by William Hemsworth; 31 Days Ago at 7:56 pm.
I need pageviews! most fun profile ever :)
0
#3 31 Days Ago
I know this is knit picking but....You can't get the name of the key "directly" from the keyboard, its generally via the operating system's kernel....I know knit picking
![]() |
Similar Threads
- Stop a keyboard key input (Visual Basic 4 / 5 / 6)
- My "a" key fell out! (USB Devices and other Peripherals)
- Mouse & Keyboard Suddenly Died - HELP (Troubleshooting Dead Machines)
- Making 6.,7.key on mouse (USB Devices and other Peripherals)
- PS2 Keyboard problem in XP (USB Devices and other Peripherals)
- Emulating a keyboard key press (Pascal and Delphi)
- keyboard ~ symbol (Windows 95 / 98 / Me)
Other Threads in the C Forum
- Previous Thread: dynamic Array in C from strings
- Next Thread: please help in following data structure programs
| Thread Tools | Search this Thread |







