scancodes

How can I capture a key stroke immediately in linux? [duplicate]

♀尐吖头ヾ 提交于 2020-06-24 09:00:08
问题 This question already has answers here : Closed 7 years ago . 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 echo it or not and how to display it, just like telnet. for example, if a user strikes 'A', I want the program to display 'B', if he types 'B', 'C' is wanted, and so on. It sounds funny and

What is the difference between an SDL physical key code and an SDL virtual key code?

社会主义新天地 提交于 2020-01-01 04:06:08
问题 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. 回答1: See the SDL documentation. Scancodes represent the physical position of the keys, modeled after a standard QWERTY keyboard, while Keycodes are the character obtained by pressing the key. On an AZERTY keyboard, pressing A will emit a 'Q' scancode and an 'a' keycode. 回答2: Generally,

ASM Replacing scancodes with ASCII characters

旧时模样 提交于 2019-12-12 04:12:41
问题 I have this code: bits 16 org 0x7C00 start: jmp main key: dw 0x1e, 'a', 0x30, 'b' print: mov ah, 0x0E int 0x10 keyboard: cli in al, 0x64 test al, 1 jz return test al, 0x20 jnz return in al, 0x60 call convert call print sti convert: mov bx, 0 .LOOP: cmp al, [key+bx] je .conv add bx, 2 jmp .LOOP .conv: mov al, [key+bx+1] ret return: ret main: call keyboard jmp main times 510 - ($-$$) db 0 dw 0xAA55 It checks for keypressess and everytime I press a key, I save it to register al and then wanna

How to convert VK scan codes to appropriate character for language selected

有些话、适合烂在心里 提交于 2019-12-10 11:42:10
问题 I have an application which is multilingual, and I have to convert the VK scan codes to the appropriate character as specified by the current keyboard layout provided that they are mapped to some character representation and not just an action, state or other meta use. How would I accomplish this, such that it is portable across different Windows using different languages? I could write a mapping function for the VK scan codes, but in the WinUser.h file, I'm reading stuff like: #define VK_OEM

What is the difference between an SDL physical key code and an SDL virtual key code?

和自甴很熟 提交于 2019-12-03 10:35:18
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. See the SDL documentation . Scancodes represent the physical position of the keys, modeled after a standard QWERTY keyboard, while Keycodes are the character obtained by pressing the key. On an AZERTY keyboard, pressing A will emit a 'Q' scancode and an 'a' keycode. Generally, scancode s are the true values emitted by the keyboard (hardware) to the OS while keycode is what the OS/library maps

Tkinter international bind

我的梦境 提交于 2019-12-02 02:04:26
问题 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 layouts, such as: * Russian layout, * Greek layout, etc. Here's what I tried: from Tkinter import * root=Tk() def f(event): print 'undo' button1=Button(root, text=u'Button') button1.pack() button1.bind('<Control-z>', f) root.mainloop() It doesn't work

Tkinter international bind

老子叫甜甜 提交于 2019-12-01 21:07:01
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 layouts, such as: * Russian layout, * Greek layout, etc. Here's what I tried: from Tkinter import * root=Tk() def f(event): print 'undo' button1=Button(root, text=u'Button') button1.pack() button1.bind('<Control-z>', f) root.mainloop() It doesn't work for Russian and Greek keyboard layouts. Update-2: I did some more experiments with Windows and now the