Page 1 of 1

Auto selectable menu.

Posted: Mon Jul 04, 2011 6:22 am
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.

Re: Auto selectable menu.

Posted: Mon Jul 04, 2011 8:52 am
by Enrico Maria Giordano

Code: Select all

__KEYBOARD( cString )
EMG

Re: Auto selectable menu.

Posted: Mon Jul 04, 2011 8:55 am
by HunterEC
Enrico:

Thank you for your response. Can the ACCELERATOR keys be put in the keyboard buffer, for example Alt-I ?

Re: Auto selectable menu.

Posted: Mon Jul 04, 2011 8:57 am
by Enrico Maria Giordano
I don't know, sorry.

EMG

Re: Auto selectable menu.

Posted: Mon Jul 04, 2011 4:40 pm
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:

Re: Auto selectable menu.

Posted: Mon Jul 04, 2011 5:23 pm
by HunterEC
Massimo:

Thank you. I'll give it a try.