Thank you for this advice. However, I solved the problem with the keypress event, using both parameters

Here is an example:

If nKeyCode = 4  and nShiftAltCtrl = 2   && ctrl-D remove a project

   Do form frmprojects with 'DEL',thisform.nProjId

EndIf

Using the second parameter avoids all the interference from the OS, at least in VFP 9 and Windows 7. It also works well in Windows XP

BTW, I can't change the shortcut as you suggest. My client is adamant that the VFP version should use the same function key combinations as the DOS version, because his employees are so used to operating with the function keys in that way. that any change would confuse them. And he pays my bills so I don't argue too much :-)

Rafael Copquin


El 07/08/2013 01:23 p.m., Gérard Lochon escribió:
----- 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


[excessive quoting removed by server]

_______________________________________________
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/[email protected]
** 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