Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Creating an auto-repeat command button
Message
De
11/01/2002 00:18:09
 
 
À
10/01/2002 23:35:26
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00603161
Message ID:
00603346
Vues:
69
Steve,

THANKS! Your new code works great under VFP 7!

Note: I added two lines to prevent the Space key from overflowing the keyboard buffer. This change makes the button more responsive to the real-time state of the spacebar, i.e. (almost) as soon as you release the space bar, the click events stop.

Thank you again for your help!
Malcolm
LPARAMETERS nKeyCode, nShiftAltCtrl

if nKeyCode = 32
        * eat space keys in keystroke buffer - when you take your finger
        * off the space key the click events stop (almost) instantaneously
	do while inkey() == 32
	enddo

	nKeyCode = 13
	nodefault
	dodefault(nKeyCode, nShiftAltCtrl)
endif
>>Hi Steve,
>>
>>Thanks for your feedback! I tried your suggestion and it failed for 2 reasons:
>>
>>1. The KeyPress event on a command button isn't fired until the user releases the space key (after the 'KeyUp' event). If command buttons had a 'KeyDown' event then your idea would probably work.
>>
>>2. Strange, but true - under VFP 7 (didn't try VFP 6), your code prevents the command button from losing focus via the keyboard. I can change focus by using the mouse, but the tab and arrow keys will not exit me from the command button.
>>
>>Any other suggestions? What I think(?!) I'm looking for is a Windows API function to check for a KeyDown event (KeyPressed vs. KeyPress?). I guess I would have to set a timer to check the status of the Space key - if pressed, do the Click event.
>>
>>Malcolm
>>
Malcolm Greene
Brooks-Durham
mgreene@bdurham.com
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform