Questions on SpecialKeys

HARRY

Active Member
Licensed User
Longtime User
Hi,

As I have no room on the screen for a menu bar or additional button I want the middle Hardware Key to be used to ask for help information.

As far as I can test, the form needs to have the focus in order to activate the Sub Form1_KeyPress (SpecialKey). This works with me only when the Form is originally loaded. Setting somewhere Form1.Focus does not set the focus on the Form.

The above acts like that in executing the exe; working in debugging mode on the device, the effects are different.

A strange effect I found during testing, is that pressing the middle Hardware Key, without having a Sub Form1_KeyPress (SpecialKey), causes the label having the focus on the moment of pressing to loose its text or may be a space is inserted in front of the text. The labels are that small that they can only show one digit.

The test file attached illustrates the unexpected effects. Interested forum members should run that program, both as exe on the device as in debugging mode on the device.

My device is a P350 of Mitac.

Who can give some help?

Harry
 

Attachments

  • FormKeys.sbp
    998 bytes · Views: 197

derez

Expert
Licensed User
Longtime User
I believe it shouldn't work at all without adding the hardware library and the Hardkey object.
Read the help for declaring a Hardkey object (new1) - it says :

OnlyWhenFormIsActive - If set to true then the keys will be caught only when the specified form is active.

It means that if set to false - the key will be active no matter which form is displayed.
 

HARRY

Active Member
Licensed User
Longtime User
Erel,

:sign0013: I attached the wrong file. Now the corect one is attached.

Harry
 

Attachments

  • FormKeys.sbp
    998 bytes · Views: 191

HARRY

Active Member
Licensed User
Longtime User
derez,

Many thanks for your help. Everything clear now. Strange that it worked to a certain extend without a HardKey object.

Harry
 

agraham

Expert
Licensed User
Longtime User
Strange that it worked to a certain extend without a HardKey object
Not strange. You were trying with the very limited facilities built-in to a B4PPC Form which, as you found out, fails once an object that can accept the focus is placed on the form. The library provides a different and more complete mechanism for dealing with the Special Keys.
 
Top