Auto selectable menu.

Post Reply
HunterEC
Posts: 723
Joined: Tue Sep 04, 2007 8:45 am

Auto selectable menu.

Post by HunterEC »

Guys:

I had a small program to rebuild all indexes from all tables (20+), the menu allows the user to select the specific table that will get its indexes recreated. Some tables got over 500,000 records. Instead of having the user wait for each table to complete its course, how can I, via an menu option, put in the keyboard buffer the accelerator key for each option ? In the old Clipper days this was done with the KEYBOARD command or with the KEYSEND() function. Any ideas ? Thank you.
HunterEC
Posts: 723
Joined: Tue Sep 04, 2007 8:45 am

Re: Auto selectable menu.

Post by HunterEC »

Enrico:

Thank you for your response. Can the ACCELERATOR keys be put in the keyboard buffer, for example Alt-I ?
User avatar
MaxP
Posts: 85
Joined: Thu Jul 12, 2007 2:02 pm
Contact:

Re: Auto selectable menu.

Post by MaxP »

Add to source keybrd.c the function

Code: Select all

CLIPPER __PUTACCKEY( PARAMS )
{
   int vKeyAcc = _parni( 1 ), vKey = _parni( 2 );
   
   PostVirtualKeyEvent( vKeyAcc, FALSE );

   PostVirtualKeyEvent( vKey, FALSE );
   PostVirtualKeyEvent( vKey, TRUE );

   PostVirtualKeyEvent( vKeyAcc, TRUE );

   SysRefresh();
}
 
Example:

__PUTACCKEY( VK_MENU, VK_F2 ) // Alt + F2
__PUTACCKEY( VK_CONTROL, VK_F3 ) // Control + F3

Best regards
Massimo :wink:
HunterEC
Posts: 723
Joined: Tue Sep 04, 2007 8:45 am

Re: Auto selectable menu.

Post by HunterEC »

Massimo:

Thank you. I'll give it a try.
Post Reply