Page 1 of 2

RICHEDITBOX and TAB-KEY

Posted: Wed May 10, 2017 8:44 am
by Karl
Hello to all,

as a newcomer in HMG I don´t know if my problem was solved in another topic? I´m working with RICHEDITBOX and load a blank file but with TAPSTOPPS (Left-Tab, Right-Tab, Deci-Tab). To jump from one TABSTOPP to the next you must press the Shortcut-Key Ctrl+Tab. But everybody is used to take the TAB-KEY and not the Ctrl+Tab. If someone accidentially presses the TAB-KEY, he is out of the program and in the following control. Can I change this behavior. It would be a great help for me and my customers to solve this problem.

Thanks in advance from Ulm-Germany
Karl

Re: RICHEDITBOX and TAB-KEY

Posted: Wed May 10, 2017 11:29 am
by serge_girard
Karl,

Maybe this will help:

Code: Select all

ON KEY TAB   [ OF <ParentWindow> ] ACTION nil 
Serge

Re: RICHEDITBOX and TAB-KEY

Posted: Wed May 10, 2017 12:11 pm
by Karl
Hi Serge,

Thanks for your tip. I tried immediately but it is only the half solution. Now pressing the TAB-KEY doesn´t push me out of the RICHEDITBOX-Control. But I want to do the TAB the same as the CTRL+TAB. Most users are not familiar with the shortcuts of Rich Edit but all know what TAB does normally. Do you think that there is a solution for this ?

Best regards Karl

Re: RICHEDITBOX and TAB-KEY

Posted: Wed May 10, 2017 2:07 pm
by edk
Hi Karl.
For hmg version 3.4.3 and above try this (dirty way):

Code: Select all

ON KEY TAB ACTION HMG_PressKey( 17, 9)
For earlier versions of hmg try this:

Code: Select all

ON KEY TAB ACTION (Keybd_Event( 17, .F. ), Keybd_Event( 9, .F. ), Keybd_Event( 9, .T. ), Keybd_Event( 17, .T. ))

Re: RICHEDITBOX and TAB-KEY

Posted: Wed May 10, 2017 3:44 pm
by Karl
Thanks a lot dear edk,

It works perfect. I am very happy and would like to know, where I can find the documentation of this command. :)

Kind regards
Karl

Re: RICHEDITBOX and TAB-KEY

Posted: Wed May 10, 2017 4:04 pm
by serge_girard
drive:/hmg.3.4.44/doc/data/index.htm
where drive is c or d...

Serge

Re: RICHEDITBOX and TAB-KEY

Posted: Wed May 10, 2017 5:05 pm
by Karl
Serge, of course I know where to find the commands ON KEY and RELEASE KEY but where do I find the HMG_PressKey(7, 19) ? :D
I want to learn more....

Karl

Re: RICHEDITBOX and TAB-KEY

Posted: Wed May 10, 2017 5:35 pm
by KDJ
Karl

It seems to me this function is not documented. Source code is in h_hotkey.prg.

Re: RICHEDITBOX and TAB-KEY

Posted: Wed May 10, 2017 6:00 pm
by edk
Indeed Krzysztof :)
17 is vk_control code
9 is vk_tab code
Keybd_Event ( vk_code , lKeyMessage )
where lKeyMessage: False is for key pressed Down; True for key released Up.

Re: RICHEDITBOX and TAB-KEY

Posted: Wed May 10, 2017 6:27 pm
by Karl
Thanks to all. :)

Karl