Home > Support > Forum

Trapping the Enter Key

Posted by vpalhories 
Trapping the Enter Key
September 01, 2011 08:14AM
Hello,

Is there a way to trap when the user presses a key on the keyboard (such as the Enter Key)? The value of e.keycode in the Key_Up event is always none.

Thanks

-- Val



Edited 1 time(s). Last edit at 09/01/2011 08:21AM by vpalhories.
Re: Trapping the Enter Key
September 01, 2011 10:27AM
Hello vpalhories!

Yes, absolutely. While you are creating the layout for the keyboard, assign the 'Enter' to MappedKey, not to SpecialKey property. Then handle KeyDown event and in there, you will receive a key code of 17 for Enter. While in Keyboard Designer, you will not find Enter in the combo box offer for MappedKey property. Therefore, you will have to type it there - type 'Enter' - without the quotes.

Best regards
Vladimir Gregor
Bee Mobile | Skype ID: beemobile_support | Phone: +421 94 88 99 22 9 | Email: support at beemobile4 dot net
Re: Trapping the Enter Key
November 01, 2011 03:47PM
I see that you can type "Enter" into the MappedKey field, and I have found out that there are other words that can be typed as well, like "Multiply", "Subtract", and others. Is there a complete list of these "user-entered" options that are not in the ComboBox of the MappedKey property?
Re: Trapping the Enter Key
November 03, 2011 07:03AM
Hello Bob.

Definitelly, there is.

Please check out http://msdn.microsoft.com/en-us/library/xy8ebtbf.

Best regards
Vladimir Gregor
Bee Mobile | Skype ID: beemobile_support | Phone: +421 94 88 99 22 9 | Email: support at beemobile4 dot net
Re: Trapping the Enter Key
February 28, 2012 01:27AM
hello
What is diference key_down,key_press and key_up event?becuse when i pressed any key,The three events, occurs two times per key pressed
Thanks
Re: Trapping the Enter Key
February 28, 2012 02:13PM
Hello Vahideh,

please let me know:
1. what is your operating system and its version?
2. Do you use Keyboard Control? What event do you handle when this issue occurs ?

Best regards
Vladimir Gregor
Bee Mobile | Skype ID: beemobile_support | Phone: +421 94 88 99 22 9 | Email: support at beemobile4 dot net
Re: Trapping the Enter Key
February 29, 2012 02:26AM
Hello
1.wince 5
2.Yes,i am used keyboardcontrol and KeyboardControl1_KeyPress event
And I've also attached my project
Thanks
Re: Trapping the Enter Key
February 29, 2012 02:34AM
Imports System.Threading.Thread
Public Class ARM
Dim a As Boolean = False
Private Sub KeyboardControl1_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles KeyboardControl1.KeyDown

End Sub
Private Sub KeyboardControl1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles KeyboardControl1.KeyPress
Dim key As String
If a = True Then
a = False
Else
a = True
End If
If a = True Then
Select Case KeyboardControl1.LastPressedKey
Case "D1"
RoundTextBox1.Text = RoundTextBox1.Text & 1
Case "D2"
RoundTextBox1.Text = RoundTextBox1.Text & 2
Case "Backspace"
key = RoundTextBox1.Text
RoundTextBox1.Text = key.Substring(0, key.Length - 1)
'key.
End Select
End If
End Sub
Private Sub KeyboardControl1_KeyUp(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles KeyboardControl1.KeyUp
End Sub
End Class
Re: Trapping the Enter Key
March 05, 2012 08:21AM
Hello Vahideh,

we've changed the sample project available on our web page: [beemobile4.net]

We've tested it on WinCE 5.0 with the latest version of BeeMobile.Keyboard.CF20.dll (v.2.0.0.5). The events occured only once. Are key events raised for every keys or just for some secial ones? Do you see the same behaviour on our test project as well?

Please send us the whole sample project.

Thanks in advance!

Best regards,
Gabriel
the BeeMobile team
Re: Trapping the Enter Key
March 05, 2012 08:57AM
Hi,

We're able to reproduce the issue.

You need to change the focus to a TextBox control. When the KeyboardControl has the focus it sends itself the pressed keys.

When a Form is activated please set a focus by calling e.g.: textBox1.Focus()

And it will work as expected.

Best regards,
Gabriel
the BeeMobile team
Re: Trapping the Enter Key
March 12, 2012 04:09AM
Hello,
Thanks for the guide,I've designed keyboard with a new version of the pkeyboard editor.So my problem was resolved.
Sorry, only registered users may post in this forum.

Click here to login