KeyUp event of one button navigating to Enter event of other button - ms-access

I have a keyUp event in button1 and EnterEvent in button2
When i press button1 and use my up arrow automatically control is navigating to Enter Event of button2 after entering into the KeyUp event of button1
Feels something fishy; Please help !!

Just to be clear, the KeyUp event doesn't refer specifically to the Up key on your keyboard. It is an event that triggers anytime you release any key. The keyboard events are KeyDown (when you push any key down), KeyPress (after KeyDown), and KeyUp (when you let go of the key). If you hold down a key, the KeyDown and KeyPress events trigger repeatedly until you let go, at which point KeyUp fires. (Note: pressing the Enter key on a control that is set as Default or pressing the Esc key on a control that is set as Cancel will NOT trigger any of the Key events for those controls.)
Also, the Enter event doesn't refer to the Enter key, it refers to anytime you enter that control, whether by clicking your mouse into it or moving to it via the keyboard.
In light of all of this, here's what looks to be happening:
You press and release the Up Arrow on your button1, triggering button1's KeyUp event. The focus then moves to button2 (because you pressed the Up arrow key, a navigation key) and triggers the Enter event of button2 (because you just entered button2).

From MSDN
"The Enter event occurs before a control actually receives the focus from a control on the same form."
sounds like its doing the right thing, when you press the up arrow focus is being switched to the next button (Button2) which is causing the Enter event to fire.

Related

Button Command only get invokes when pressing the second time

I have a Button on my windows phone application. I have the Command Button binds to my RelayCommand in my ViewModel:
<Button Command="{Binding DoSomethingCommand}" CommandParameter="aString"/>
I see DoSomethingCommand get invoked correctly when I press the Button.
But when the keyboard is launched, I need to click the button twice before I see the DoSomethingCommand get invoked. The first click causes the keyboard to close, the second click invokes DoSomethingCommand.
Can you please tell me why there is a change in behaviors when the keyboard is open or not?
I came across the same issue today.
To explain it a bit better: a text box is focused, the keyboard is visible and a button is below the text box. Tapping this button the first time, unfocuses the text box and closes the keyboard. Tapping the button a second time, triggers the tapped event.
To solve this, I set MyTextBox.IsEnabled to false and then back to true in the next line. Setting it to false, unfocuses it. Setting it to true again, makes it usable again. The user won't notice, the keyboard closes and the button is tappable the first time.
Alternatively, one can set the focus to the button after leaving text box focus.

As3 iPad softkeyboard keycode listen

I would like to listen for user to Click the 'DONE' button to do my form submission. I am using Textfiled not StageText. Is there a way you can listen to user Click on it.
Cheers
Bill
You can listen for FlexEvent.ENTER on the TextInput - it gets fired when user closes soft keyboard by clicking 'done'
To listen for soft keyboard closing in general, add SoftKeyboardEvent.SOFT_KEYBOARD_DEACTIVATE listener to TextInput
See http://help.adobe.com/en_US/flex/mobileapps/WS82181550ec4a666a39bafe0312d9a274c00-8000.html#WS19f279b149e7481c-66e67e6c13313699023-8000 for full info.
I have done couple testing, looks like keycodeEvent dose works. 'Done' is equal as 'Enter'. the code is '13'

Action Script 3 keyboard event set focus

I set focus to a text field in the init method, however keyboard enter event only works when I click the text field first.
What is the problem?
It's because, in AS3, by default, stage got the focus. So if you are adding a keyboard event listener to anything other than stage you have to set focus to that object.
Example,
If txt is your text field, you are adding a keyboard event listener to txt then you must do get focus for that like
stage.focus = txt;
That line brought focus to the text field but remember if you click on anything other than that, that object got focus. Needless to say, txt lost focus.
Tip: Try using adding keyboard event listener to stage, if you do so then it dispatches the event when a key is clicked or released regardless of the what object has focus.
stage.addEventListener(KeyBoardEvent.KEY_DOWN, onKeyDown);

html onfocus tab vs page load

Let's say I have an onFocus event for a text box. That event triggers when the user tabs into that box, as expected. But it also seems like the event triggers when the box is selected, and then the window is covered and then uncovered, by switching tabs, opening then closing another application, etc. Is there a way to make it so that the event triggers only by tabbing (or mouse-clicking) the text box, and NOT by covering then uncovering the window?
You can use an onClick event. This will only trigger the event on the click though, not tabbing.
You could also use onKeyDown which would trigger on any key press, but would also trigger when the user tabbed away from the textbox.
http://jsfiddle.net/kBzAu/2/
when one goes away from page, you may use window.document.onblur=function(){disable all onFocus};
and re activate them with window.document.onfocus=function(){enable all onFocus};

Reset Button - Backspace OnClick

I've created a reset button that resets all the data on my search criteria form. I've made it so my Search buttons fires when enter is pressed, but I'm wondering:
How can I make the RESET button fire when BACKSPACE is pressed?
Thanks!
Take a look at the form's OnKeyPress event: http://msdn.microsoft.com/en-us/library/aa213952%28v=office.11%29.aspx