I've read up on the internet about how to simulate keypresses on the keyboard in the X window system. So far, I've got a program, written in C, that works at sending key events from the traditional keys on the keyboard. However, I can't figure out a way to simulate someone pressing the keyboard's mute/volume up/volume down keys.
This may not even be possible to do with the XKeyEvent structure I used for the previous key presses, since I didn't find anything remotely close in the keysymdef.h file, and I think that those events are delivered to the host OS rather than each individual window.
I've also fired up xev and it didn't give me very much helpful output (or at least any that I could decipher).
Does anyone have any tips on where I should look?
Try with keycode 123 keysym 269025043 for volume up (xF86XK_AudioRaiseVolume)
and Keycode 122 keysym 269025041 (xF86XK_AudioLowerVolume), hope that helps
Related
recently I bought a wireless keyboard from Lidl:
SilverCrest
IAN 377704_2101 SPCC 2 A1
Model Nr.: HG08233A
Everything works great, but there's some setting that releases the button after it was being pressed for 22 sec. I know it's a time-related setting because I was playing with the key repetition setting and no matter how fast/slow it was typing(repeating the same key over and over), it stopped after 22.XX sec. (measured on my watch, so that's why .XX).
Has someone any idea how to turn that off, so the button stays pressed till I release it? It's making the keyboard useless for gaming.
Filter keys: OFF
Sticky keys: OFF
Toggle keys: OFF
I have one more wireless keyboard from ConnectIt and it doesn't have that issue, so it must be something drivers/settings related.
I wanted to use it as a replacement for my current ConnectIt keyboard, but the purpose is development (which is great for) and gaming (which is impossible due to key releases).
I've tried to look into registry, but I wasn't able to find anything.
Have a nice evening, and thanks for any ideas ;)
So I have a keyboard, and it has a mode where it lights up every key you press.
I was wondering if you could physically simulate a keypress, AHK just sends it directly to the system.
However I need a way to make the keyboard light up, because AHK doesn't do that. The keyboard is not programmable.
Solutions in mostly any language are welcome.
This is not possible, you want to send a simulate keypress to your fysical keyboard. (this is i think a mechanical switch insite the keyboard self, that does do light up if you press a key) and it is only possible if the company did make a keyboard driver that allows you to change the settings (disable - light up) in the Windows Registry. (you did not give me the name of your keyboard but you can then try to searching into the registry for example software/Logitech/settings)
I am currently working on a project for mapping every possible keyboard and mouse interrupt.
The mapping is done in linux environment and with ncurses library.
The question is how to catch the following keyboard keys :
Home
End
page up / down
when pressing those keys the terminal itself is catching them and the program itself cant see them (spent a few hours of configuration and found no solution yet)
pause/break (above page up in standard keyboard)
PrtScreen
Num Locked keys (0 to 9 and < . >).
Windows button
the following just not getting any response at all, neither from the terminal or the program.
short: you cannot catch all keys with ncurses
long: the usual problems lie in a failure to initialize things properly:
you probably forgot to call keypad(stdscr,TRUE) (or whatever window you might be using with wgetch). That will allow an application to read any of the keys defined in the terminal description as an integer.
If it is not in the terminal description, (n)curses will return the sequence of bytes which make up the key as sent from the keyboard.
That's two likely problems. There are other keys (or combinations of keys) which the terminal will not send (in a way which makes distinct keyboard sequences). For instance, using the Control key with other keys may change the sequence sent by the keyboard, or it may not. To see this, use experiment with the control key with comma, period or the other punctuation keys in that area of the keyboard.
Forgive me if this is a silly question but I am a novice programmer, and I'm hoping there is a novice solution to this.
Is there any programming language that will quickly allow me to write a simple program to show a notification on Windows 7 when CAPS LOCK is pressed?
My laptop doesn't have an indicator light and I have no program on my computer to do so, although I'd be open to suggestions. The only partial solution I've found is through accessibility settings in Windows which plays a god-awful beep every time the key is pressed.
Thanks!
Try Auto Hotkey. It is a great program just for that. It runs scripts in the background that can directly manipulate your keyboards input.
I changed capslock to require ctrl+capslock to work otherwise pressing capslock by itself does nothing :)
You can also do a bunch of other things. You are able to set a custom tone for when you push capslock (however a simple popup or key remapping would probably be best).
Here's an example from the site:
"Capslock::Ctrl Makes Capslock become a Control key. To retain the ability to turn Capslock on and off, also add the remapping +Capslock::Capslock (this toggles Capslock on and off when you hold down the shift key and press Capslock)."
I understand that new keyboards can be ordered online, but now that this problem has proven to be hard I am completely fascinated by it.
Many old laptop keyboards as they wear develop consistent shorts which cause multiple keys to react when a single key is pressed. For example, on my little sister's computer if you press "r" the system outputs "vr", "i" outputs ",i" and so-on.
Assuming the user is not a vim/emacs power user, the keyboard still seems salvageable. It seems that if the keyboard driver was changed so that pressing the "r" key resulted in the computer accepting "backspace r" the "v" would disappear and not be such a hassle anymore.
Xmodmap XKB and other systems seem to assume that each single key depression will result in a single command. Does anybody understand the missing link where more than one character can come from a single keypress? There seem to be many places in the stack where this can be pulled off, but none of them are particularly clearly documented. Another fun fact is that you can't force this in the ubuntu keyboard shortcuts editor, ubuntu will stop you from entering the changes there under the premise that "this will make it impossible to type."
Hacking around in xev shows that the computer believes that when you hit and release 'r' that it gets a keypress event for 'v' then a keypress event for 'r' then a keyrelease event for 'v' then one for 'r'. If you could change the configuration to ignore a first keypress if there is no corresponding key release before the next key is pressed, that would work too.