----- Original Message ----- From: "Rafael Copquin" <[email protected]>
To: <[email protected]>
Sent: Wednesday, July 31, 2013 12:55 AM
Subject: keypress event and on key labels


I haven't used on key labels since the days of old FoxDOS.

However, I am migrating an old FD app to VFP9 and the prgs include a zillion on key labels operating on browse windows.

I easily replaced all browse windows with grids and the on key label calls with calls to the keypress events of the corresponding text boxes.

However, there is one particular on key label that is driving me nuts:

on key label ctrl+D do form frmDelete

In the keypress event of the textbox of the corresponding column of the grid I wrote:

lparameters nKeyCode,nShiftAltCtrl
if nKeyCode = 4  && ctrl+D
  do form frmDelete
endif

But to my surprise, the same number (4) is assigned to the right arrow key, so when the user navigates the grid with the right arrow, the frmDelete form pops up, as if he had pressed the Ctrl+D key combination

How can I solve this?

The numbers can be seen in help for the inkey() function

BTW, I never used the second parameter, nShiftAltCtrl of the keypress event. And can't figure out how to use it.

Rafael Copquin





Hello Rafael.

No way around the obstacle.

When you decide to assign some keys to predefined functions,
you must assert these are not conflicting with OS or underlyng apps.
CTRL+D is known by many interrupting vectors.

Changing that shortcut is the best way.

Gérard


_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: 
http://leafe.com/archives/byMID/profox/1EB41070F2AA4CC5B58AD9A28D763854@MuriellePC
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to