I need to ask a question in VB.NET.

  • Thread starter Thread starter amiga500
  • Start date Start date
A

amiga500

Hello,

I am developing in Visual Basic.NET for Symbol PocketPC Windows CE
5.0. I need to ask one question, I need to disable the Alpha and Func
key in the keybad of the scanner using .NET Compact for the PocketPC.
I tried to use this code

....
Imports Symbol.Keyboard
.....
.....
.....
Private Sub DocumentItems_Load(ByVal sender As Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Dim objSymbolKeyPad As New KeyPad
Dim intFunc As Integer = 128
objSymbolKeyPad.SetKeyState(intFunc, 0, False)
End Sub


Problem is it doesn't work. When I run the program and I go to the
text field to enter values then I press one of the Alpha or Func key
and then enter further data to the text field nothing happens. I have
to press the button again before it enters information into the text
field, that is what I want to prevent. I want to TURN OFF certain keys
in the keybad until I turn it back on. Does anyone have any advice in
this regard? Thanks in advance.
 
As I understand it, the Symbol.Keyboard assembly does not allow you to
disable the Alpha and Func keys, but just lets you set their state through
code. What I would suggest is to use the Key_Down even of your form or
control to check if the Alpha or Func key was pressed, and then reset the
state to what you want (ie: user presses the Alpha key to turn it's state to
ON, but you don't want to allow that, so you trap the keycode in the Key_Down
event and reset the state to OFF).

Hope this helps.

Tombstone
 
Tombstone here is the problem I am facing, in the Key_Down press when
I push either the alpha or function key this event doesn't get
executed. As a result I am unable to remap it or turn it off, however
it still executes and such I am unable to enter numbers anymore in the
text field. Do you have any suggestions? Thanks in advance.
 
Sorry about that. Alpha and Func keys are key modifiers and not actual keys.
To intercept the Alpha and Func key presses, look at AlphaNotify and
KeyStateNotify in the Symbol documentation for the Symbol.Keyboard class.
These should fire for the modifier keys, and you can set/reset the key states
as needed.
 
Here I placed this on top so it can be shared by the same class:

.....
Private objKeyStates As New Symbol.Keyboard.KeyStates
Private objKeyPad As New Symbol.Keyboard.KeyPad
.....

I have placed this code in the form load event:

' It disables the modifier keys
objKeyPad.AlphaMode = False <-- Alpha code
objKeyPad.SetKeyState(128, 0, False) <-- Function code

When I run the program it compiles correctly, etc. However, when I
attempt to test the two buttons it still fails miserably. When I press
the Alpha key the alpha keys refuses to work and I have to push it
again before they work (I presume alpha numbers only) and that is
wrong. I want when the user accidentaly hits the alpha keys nothing
happens and still enter numbers so it did not work. When the user
pushes the Func key the numbers don't appear at the first press they
have to press it again before it works, thuse both the Alpha code and
function code did not work. What did I do wrong? Thanks in advance.
 
Can you help me? Thanks in advance.

Here I placed this on top so it can be shared by the same class:

....
Private objKeyStates As New Symbol.Keyboard.KeyStates
Private objKeyPad As New Symbol.Keyboard.KeyPad
....

I have placed this code in the form load event:

' It disables the modifier keys
objKeyPad.AlphaMode = False <-- Alpha code
objKeyPad.SetKeyState(128, 0, False) <-- Function code

When I run the program it compiles correctly, etc. However, when I
attempt to test the two buttons it still fails miserably. When I press
the Alpha key the alpha keys refuses to work and I have to push it
again before they work (I presume alpha numbers only) and that is
wrong. I want when the user accidentaly hits the alpha keys nothing
happens and still enter numbers so it did not work. When the user
pushes the Func key the numbers don't appear at the first press they
have to press it again before it works, thuse both the Alpha code and
function code did not work. What did I do wrong? Thanks in advance.





- Show quoted text -
 
Back
Top