Questions tagged [scancodes]
73 questions
28
votes
2 answers
What is the difference between an SDL physical key code and an SDL virtual key code?
The struct SDL_Keysym has SDL_Scancode and SDL_Keycode members. What is the difference between them? The documentation does not really clear it up for me. I tried both and they seem to do the same thing.

Mampoempan
- 347
- 1
- 3
- 8
13
votes
4 answers
Mapping characters to keycodes for international keysets
so I built a pi zero keyboard emulator as mentioned here:
https://www.rmedgar.com/blog/using-rpi-zero-as-keyboard-setup-and-device-definition
I make it type text that it reads from a local text-file (everything developed in java - for reasons :)…

pinas
- 2,708
- 4
- 21
- 33
10
votes
5 answers
What is the scancode of "Pause/Break" key?
I download "SharpKeys.exe" from here. It works well. But I want to change "Pause/Break" to another, this app cannot recognize this key correctly. Does any one know the scancode? Thx

Redick
- 149
- 1
- 1
- 8
9
votes
1 answer
Get keyboard scancode of char
I want to interact with a Virtualbox-VM to do an unattended install of Virtualbox-Guest-Additions. Therefore I have to send keystrokes to the VM. I'm able to do this by using the VBoxManage-API, where I send the HEX of the scancode to the VM:
#…

Wolkenarchitekt
- 20,170
- 29
- 111
- 174
9
votes
4 answers
How can I capture a key stroke immediately in linux?
Possible Duplicate:
What is equivalent to getch() & getche() in Linux?
I'm a newbie in linux programming. :-)
I just wonder if my program (using C language) can capture every single key stroke immediately in linux, and then decide whether to…

Yishu Fang
- 9,448
- 21
- 65
- 102
7
votes
2 answers
SendInput() isn't "sending" the correct shifted characters?
void WriteChar(char c)
{
INPUT input = {0};
input.type = INPUT_KEYBOARD;
input.ki.wVk= VkKeyScanEx(c, GetKeyboardLayout(0) ) ;
SendInput(1,&input, sizeof(INPUT));
}
VkKeyScanEx returns different key codes for '/' and '?'(same…

Alex Gramatikov
- 71
- 1
- 3
7
votes
5 answers
Tkinter international bind
Is there a way in Tkinter to bind a combination of keys that will work in all keyboard layouts? (bind by scancode)
For example, I need 'Control-Z' binding that will work with the same physical key in the lower left corner of the keyboard in all…

Antony Hatchkins
- 31,947
- 10
- 111
- 111
6
votes
1 answer
Get scancode rather than keycode on Linux using X11
I'm trying to listen to keyboard input (using an X11 event loop) and get scancodes. These scancodes should refer to the physical location of a key, rather than the character it types. The problem is, all I can get are KeySyms and KeyCodes, which are…

ComfyS
- 131
- 1
- 5
6
votes
1 answer
Linux keyboard scancode issues: For example, UP ARROW gives ^[[A
We've been struggling for a while now to understand the keyboard scancode behavior in Linux.
When we open a normal bash shell, the arrow keys works as expected: UP shows the previous item in the history etc. However when you spawn a process, arrows…

user2749202
- 63
- 4
5
votes
3 answers
How to extract the character from WM_KEYDOWN in PreTranslateMessage(MSG*pMsg)
In a MFC application within PreTranslateMessage(MSG *pMsg) inherited from a CView, I have this:
if (pMsg->message == WM_KEYDOWN) ...
The fields in a WM_KEYDOWN are documented here. The virtual key VK_ value is in pMsg->wParam and pMsg->lParam…

Stéphane
- 19,459
- 24
- 95
- 136
5
votes
1 answer
Windows scancodes for F11 and F12 are different. Why?
Why are they separate from the rest of the scan codes? Is there some reason for it?
F9 is 67
F10 is 68
Numlock is 69
F11 is 87
F12 is 88

Lfod
- 581
- 5
- 14
5
votes
3 answers
What are the scan codes for keyboard arrows? (right,left,down,up)
I need scan codes for arrows (right,left,down,up). I am making software in Assembler and I need to know the hex values for the scan codes of the keyboard arrows.

Marko Stojkovic
- 3,255
- 4
- 19
- 20
5
votes
1 answer
difference between virtual code and scan code
What is the difference between Virtual Key Code and Scan Code. I read about scan code here but I do not understand what are virtual codes used for and what makes scan code different from virtual code ?
For example in Java :
private void…

Suhail Gupta
- 22,386
- 64
- 200
- 328
4
votes
5 answers
OS and implementation independent access to the keyboard?
I made an FPS game with MSVC++ which is running very well on Windows. But now I am trying to make it portable (at least I want to create a linux and a Windows version), so I decided to change the IDE to Code::Blocks and the framework to wxWidgets.…

Calmarius
- 18,570
- 18
- 110
- 157
4
votes
1 answer
Reverse op for GetKeyNameText
We can use GetKeyNameText() to retrieve a string that represents the name of a key. Is there any way to do the reverse, ie get a scancode or virtual key for a given key name?
I want to write key names to a config file so users can edit them easily.…

user3700562
- 693
- 11
- 23