keyboard-events

change keyboard layout with javascript

左心房为你撑大大i 提交于 2019-12-24 03:48:06
问题 I have a html form. Users can fill in the form in both english and persian languages. but I have a captcha input that users should fill it in english. If the user's keyboard layout is persian what is typed in this field should change to english so I need some coded that change the keyboard layout on focusing on this input text. Is it possbile to change keyboard layout with javascript?? 回答1: You won't be able to change the keyboard layout using JS, but you can capture the keydown event and

Input Accessory View Behave Unexpectedly with keyboard hide and show events

时光总嘲笑我的痴心妄想 提交于 2019-12-24 01:38:10
问题 I am facing an strange behavior with InputAccessoryView, I am working on chat screen where I have used InputAccessoryView where I have registered for KeyboardWillShow and KeyboardWillHide notifications. When my chat screen appears it automatically calls the KeyboardWillShowMethod once and after that it hides automatically without calling the KeyboardWillHide notification. After Loading chats when I click on textbox to type text it calls KeyboardWillShow which is fine. But when I try to hide

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

iOS why has moved ToolBar gap to keyboard

血红的双手。 提交于 2019-12-23 20:57:36
问题 I figured out how to move my toolbar with button and text field with the appearing keyboard: - (void) liftMainViewWhenKeybordAppears:(NSNotification*)aNotification { NSDictionary* userInfo = [aNotification userInfo]; NSTimeInterval animationDuration; UIViewAnimationCurve animationCurve; CGRect keyboardFrame; [[userInfo objectForKey:UIKeyboardAnimationCurveUserInfoKey] getValue:&animationCurve]; [[userInfo objectForKey:UIKeyboardAnimationDurationUserInfoKey] getValue:&animationDuration]; [

Longish delay between two consecutive KeyDown events

自古美人都是妖i 提交于 2019-12-23 20:32:55
问题 I'm kind of writing a little game engine -- purely to understand how these work from the inside. I currently don't want to mess with OpenGL or DirectX, so I stick to drawing on a control with GDI+ and all that WinForms stuff. Obviously, I need to handle input. More specifically, keyboard events. This, however, poses a problem: protected override void OnKeyDown(KeyEventArgs e) { Trace.WriteLine(string.Format("KD {0:hh:MM:ss.fff} {1}", DateTime.Now, e.KeyCode)); } This code (even with the

Clojure snake skips positions

荒凉一梦 提交于 2019-12-23 15:44:13
问题 I'm a Clojure beginner and I've been playing around with a snake game code presented here https://github.com/stuarthalloway/programming-clojure/blob/master/src/examples/snake.clj. When I run the game the snake seems to skip positions while moving, it doesn't go square by square as I expected. But when I turn the snake and hold down the direction key it starts to behave normally and moves square by square, as soon as I release the key it starts skipping again. I guess this has something to do

“KeyPress” event for WinForms textbox is missing?

余生颓废 提交于 2019-12-23 08:33:32
问题 I am trying to add an "KeyPress" event in a textbox (WinForm) this.textBox1.KeyPress += new System.Windows.Forms.KeyPressEventHandler(CheckKeys); and here's inside the 'CheckKeys': private void CheckKeys(object sender, System.Windows.Forms.KeyPressEventArgs e) { if (e.KeyChar == (char)13) { // Enter is pressed - do something } } The idea here is that once a textbox is in focus and the 'Enter' button was pressed, something will happen... However, my machine cannot find the 'KeyPress' event. Is

setOnEditorActionListener is not working for Android Lollipop

喜欢而已 提交于 2019-12-23 03:40:59
问题 I have been trying this IME_ACTION //Listening to the keyboard action mSearchEditText.setOnEditorActionListener(new TextView.OnEditorActionListener() { @Override public boolean onEditorAction(TextView v, int actionId, KeyEvent event) { if (actionId == R.id.ime_search || actionId == EditorInfo.IME_ACTION_SEARCH) { performSearch(); return true; } return false; } }); but seems like it doesn't at all work on Lollipop devices. Here is the XML code - I am completely sure that I am doing this right.

win32api & pyhook - How to get the user's typing language?

☆樱花仙子☆ 提交于 2019-12-23 01:41:28
问题 I installed pyHook and successfully attached handlers to keyboard events, but now I need to find out whether the user is typing in English layout or other layouts. I couldn't find this information in the event objects. How do I find on windows what the typing language in the focused window is? I tried playing with GetKeyboardLayout with no success (it always return the same value whether I type in English or in a different language - in my case Hebrew). Thanks Solved thanks to BrendanMcK's

Click event on the keyboard: up, down, left, right

微笑、不失礼 提交于 2019-12-23 01:04:29
问题 I need an event that gives one click right, up, down or left. I want that when a condition is met (if) he give a click on the button I choose, below is an example in which should fit: if (gesture.left) { The click event in the left direction button keypad } Else if (gesture.right) { Click the event in the right direction button keypad } Do not want to detect which key was pressed, only one condition that after he click button that I want. 回答1: arrow keys are only triggered by onkeydown , not