Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Keyboard '{SHIFT+TAB}' doesn't
Message
From
25/10/2001 20:00:38
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
 
To
25/10/2001 15:09:45
Stan Vaninger
Mitek Industries, Inc
Missouri, United States
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00573343
Message ID:
00573464
Views:
24
>In one particular form, I need to capture the PageUp and PageDown keystrokes and change them to Tab and Shift+Tab. I have put the code:
>
LPARAMETERS nKeyCode, nShiftAltCtrl
>DO case
>	case nKeyCode = 18	&& PageUp key remapped to Shift+Tab
**>		Keyboard "{SHIFT + TAB}"
            nodefault
            dodefault(15, nShiftAltCtrk)
>	case nKeyCode = 3	&& PageDown key remapped to Tab
**>		Keyboard "{TAB}"
            nodefault
            dodefault(9, nShiftAltCtrk)
>	otherwise
>		DoDefault(nKeyCode, nShiftAltCtrl)
>EndCase
While stufffing the keyboard generally works, specially within keypress method, it's still not entirely bulletproof - just tried using a keyboard macro which stuffs "abcdefghijklmnoprst" and had
LPARAMETERS nKeyCode, nShiftAltCtrl
IF nKeyCode%16=1
	NODEFAULT
*	DODEFAULT(nKeyCode+1, nShiftAltCtrl)
	KEYBOARD CHR(nKeyCode+1)
endif
for Keypress - it gave me "bcdefghijklmnoprstbr" instead of "bbcdefghijklmnoprrst". It did work with the Dodefault uncommented and Keyboard commented. What happened: the keyboard macro stuffs all the characters at once, and keypress reacted by not accepting the two characters (a and q) and by stuffing b and r instead in the keyboard buffer - only after the other characters were already there. While it may not hurt your case, I still think that this technique is cleaner - KeyPress processes immediately, not relying on an external mechanism such as stuffing characters in keyboard buffer.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform