keyboard

Detecting PS/2 port state in C#

自闭症网瘾萝莉.ら 提交于 2019-12-24 04:12:33
问题 this is my first post! I am attempting to simply detect whether there is a keyboard attached to the PS/2 port on my machine. The idea is that the computer will boot up, although if it detects a USB device or PS/2 keyboard, it reboots into an administrator mode. I have handled the USB aspect, although I have had no luck in finding any documentation for the PS/2 port. Some posts have said it is not possible to detect a keyboard plugged into a PS/2 port after boot, although I simply wish to

Convert sequence of System.Windows.Forms.Keys to a Char

无人久伴 提交于 2019-12-24 03:53:44
问题 Is there a way to convert a sequence of keystrokes represented by the Keys enum (i.e. System.Windows.Forms.Keys ) in a Char. For example: Keys.Oem4 and then Keys.A yields the char á . It must exist somewhere in the WinAPI, because Windows does that for me, when I press keys inside a text-box... I just don't know where. Please help! thanks. EDIT: What I want is to record the user input keys, and later translate the sequence of keys to characters, without the user having to type everything

iPhone prevent rotation of keyboard to landscape

谁说我不能喝 提交于 2019-12-24 02:30:35
问题 So, I'm putting some controls over an MPMoviePlayerController and I'm intending this to be used in portrait mode, simply by using video that is shot vertically. My only problem is that for text entry the keyboard comes up in landscape. Now, I realize that there is an undocumented way to set the orientation of the player, but I'd rather not try this and get rejected at the app store. (FYI this is it): [moviePlayer setOrientation:UIDeviceOrientationPortrait animated:NO]; // not legal? I've

How to implement an actionListener for space bar as action event

南楼画角 提交于 2019-12-24 02:07:33
问题 I have this set up to update pretty constantly on the timer, but I want to be able to pause the timer with the spacebar. I have attempted to implement an actionListener, but I am not sure what to apply it to. Most of the examples I can find relate to buttons or text boxes, not keyboard presses inside a jpanel. I have printed src to the console and it doesn't appear to be registering my spacebar as an event... I have tried adding the actionListener, but I am not getting something about the

objective-c uisearchbar only allows one character at a time

一个人想着一个人 提交于 2019-12-24 02:01:05
问题 I have created the following code but there's still one thing that's bugging me. For some reason, when I press any key on the keyboard, it immediately goes away, my cancel bar is disabled, but the code works and it correctly sorts and displays the cells in my table view that have those letters that the user typed in, though only one at a time. Is there something I'm missing? Thanks. Edit: Here's some code that I'm using. Might help figure this out. - (UIView *)tableView:(UITableView *

How do I program a double key press to make a non-modifier key behave like a modifier key within my program?

折月煮酒 提交于 2019-12-24 01:17:53
问题 I am writing a typing program that includes many more characters than are available on a standard keyboard. In order to achieve this I need to transform some of the alphabet keys into modifier keys CTRL + A . For example f + j would output a . Typing f then j is slow for the user, I need them to be able to press f and j at the same time and receive one output. It's fine (preferable even) if some of the keyboard's normal functionality is stopped while the program is running. I have looked into

Linux - Discard keyboard input

一笑奈何 提交于 2019-12-24 01:05:32
问题 First, a bit of background: I'm running the latest stable build of Crunchbang Linux inside a VirtualBox VM. I'm designing a custom text-based user interface to run on top of bash. This is being done with a combination of C++ and bash scripts. I need to, at times, completely and totally remove the ability for the user to provide the system with any sort of standard keyboard input. This is because, when I run a part of the system, the user is forced to wait for certain amounts of time.

Press esc to stop and any other key to continue in Python

北城余情 提交于 2019-12-24 00:46:05
问题 Now with help of raw_input , I can call a method every time user presses Enter . if __name__ == '__main__': while True: raw_input("Press Enter to continue...") _start() def _start(): print("HelloWorld") There is a problem because only Ctrl + C , the program can be stopped. As you see, I make my program to wait user to press key. From opencv , I find there is a similar need. # Hit 'q' on the keyboard to quit! if cv2.waitKey(1) & 0xFF == ord('q'): break Simply I want to press esc key to exit

How do I detect the iOS keyboard when it stays up between controllers?

偶尔善良 提交于 2019-12-24 00:24:05
问题 Just for starters: I'm already listening to keyboard will appear/disappear/change notifications. They're not firing. Neither are did appear/disappear/change. When I have the keyboard up, and push a controller on top which also has the keyboard up (-[UITextView becomeFirstResponder] in viewWillAppear), no keyboard notifications are fired. This makes some sense, as the keyboard does not actually move in this animation, but it's certainly not desirable in this case. How would I detect this

Get 'Shift' representation of a key in windows

一世执手 提交于 2019-12-23 23:16:48
问题 Is there a built in way to obtain the equivalent of a key combined with the Shift key e.g: a + Shift -> A 1 + Shift -> ! I currently have all the keys mapped in a dictionary in pretty much the same way as illustrated above. I'm using windows forms. 回答1: You can achieve what you want by first calling vkKeyScan to get the virtual-keycode for the char you're interested in. With the outcome of that call you can feed ToUnicode to translate what the characters would be when the Shift key is pressed