8

The LA Fox Developer Newsletter
June 1997
KeyPress Event Parameters
by Robin Connelly
rhe file below of VFP coding replaces the ‘ON KEY LABEL’ processing in Foxpro for MSDOS / Windows...

Niotice the command lines are simply qualified names for the Click’ method, and does not look like the procedural coding we have been used to...


‘Name: TEMP3.PRG

LPARAMETERS nKeyCode, nShiftAItCtrl

5/29/97 out of the “need to know” Robin developed this chart of parameters passed to the
KeyPress Method in Visual Foxpro version 5.0
(I feel sure this is documented somewhere else,
but here it is for your use as well as mine)
nKeyCode is the Chr() value for the key pressed,

e.g.
97 for the character ‘a’
nShiftAltCtrl value is as follows:

Value Shift CtrI Alt

0
No
No
No
I
Yes
No
No
2
No
Yes
No
3
Yes
Yes
No
4
No
No
Yes
5
Yes
No
Yes
6
No
Yes
Yes
7
n/a
n/a
n/a
=ddisplay(
chr(13) + space(10) +
altrim( str( m.nKeycode) ) + = m.nKeyCode” +;
space(10) + chr(13) + space(10) +;
alltrim( str( m.nShlftAltctrl ) ) + = m.nShiftAltCtrl” + space(10) ) && DEBUG ONLY ONLY DEBUG


do case

case m.nKeycode = 27 .and.;
m.nShiftAltCtrl 0

This is the ‘customer’ window...

*
Just ring the bell if they hit [Esc]
WavToBell( “Ding” ) && Thought about puttin 'Yipe.wav' here...
RingBell()

case m.nKeyCode = 3 .and.
m.nShiftAltCtrl 0

*
Page Down Key
Thisform.Next_Button.click && emulate 16 bit action


(Con't next column)
From David Salson...
Hot Off the Wire
Get Microsoft’s TechNet - FREE


Someone at Microsoft sure is feeling generous. A special, limited promotion is just around the corner for a free 30-day trial offer to Tech Net Microsoft’s “must have” technical support CD. With more than 150,000 pages on two CDs, TechNet is the most complete resource for your technical information needs. The promo should be starting at the beginning of June, with info available from the Office Migration web site. Supplies are limited, so bookmark the URL below and watch for the promo to start to get in on the action.

Microsoft, Web: http://www.microsoft.com/office/migration/


New Microsoft Online Support Solutions


If you haven’t visited Microsoft’s support site lately, you don’t know what you’re missing. New services now being offered make Microsoft’s site one of the most comprehensive sources of web based support around. What’s all the hoopla? Well for starters, all customers can now submit support requests for any Microsoft product through a form on the web. Just fill out the appro riate form arid a technical specialist will respond within one business day! Next, a series of slick, new wizards that can do almost anything from comparing files on your own desktop to locate recommended patches and free add-ons, to troubleshooting wizards that will help diagnose your technical problems. Why not check it out for yourself, and click that tiny URL listed below.

Microsoft, Web: http://www.microsoft.com/supportJ


KeyPress (Con't from previous column)

case m.nKeyCode = 18 .and.
m.nShiftAltCtrl 0
*


Page Up Key
Thisform.Previous_Button.click && emulate 16 bit action

otherwise
a
Do nothing...
*


•ndcase
Page 8

8