Fivewin Setkey(ALT + F2, {|| ...} ) ?

Fivewin Setkey(ALT + F2, {|| ...} ) ?

Postby Jimmy » Mon Oct 31, 2022 4:50 am

hi,

how do i use ALT + F2 as "Key" to call a ACTION :?:

---

i found in Help File
ON KEYDOWN

but search under \Sample there is no File use it :shock:

when search for KEYDOWN only i found
Code: Select all  Expand view
  :bKeyDown   := { |nKey| DoMyKey(nKey) }


so i wrote
Code: Select all  Expand view
STATIC PROCEDURE DoMyKey(nKey,nFlag,cWho)

   DO CASE
      CASE EMPTY(nKey)

      CASE nKey = VK_F1
         DO CASE
            CASE GetKeyState( VK_MENU ) ;                MsginFo("VK_MENU VK_F1",cWho)
            CASE GetKeyState( VK_CONTROL ) ;             MsginFo("VK_CONTROL VK_F1",cWho)
            CASE GetKeyState( VK_SHIFT ) ;               MsginFo("VK_SHIFT VK_F1",cWho)
         OTHERWISE
            ShowHelp()
         ENDCASE

      CASE nKey = VK_F2
         DO CASE
            CASE GetKeyState( VK_MENU ) ;                MsginFo("VK_MENU VK_F2",cWho)
            CASE GetKeyState( VK_CONTROL ) ;             MsginFo("VK_CONTROL VK_F2",cWho)
            CASE GetKeyState( VK_SHIFT ) ;               MsginFo("VK_SHIFT VK_F2",cWho)
         OTHERWISE
            MsginFo("VK_F2",cWho)
         ENDCASE
   ENDCASE

RETURN

when press ALT F2 nothing happens
when press CTRL + F2 i got MsgInfo()
when press SHIFT + F2 i got MsgInfo()
otherwise F2 i got MsgInfo()


when press ALT + F1 nothing happens
when press CTRL + F1 got Error Message no define
when press SHIFT + F1 got Error Message no define
otherwise F1 got Error Message no define

Question :
how to het ALT + nKey working :?:
what about "override" F1 :?:
greeting,
Jimmy
User avatar
Jimmy
 
Posts: 1732
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany

Re: Fivewin Setkey(ALT + F2, {|| ...} ) ?

Postby Antonio Linares » Mon Oct 31, 2022 7:29 am

Dear Jimmy,

Usually you associate Alt to a menuitem action that will be executed:

Code: Select all  Expand view
     MENUITEM FWString( "Save &as..." ) + Chr( 9 ) + "Alt+A" ;
         MESSAGE FWString( "Saves the active file under a new name" ) ;
         ACCELERATOR ACC_ALT, Asc( "A" )
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42099
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Fivewin Setkey(ALT + F2, {|| ...} ) ?

Postby Antonio Linares » Mon Oct 31, 2022 7:32 am

Pressing F1 you get this call by default (Class TWindow):

Code: Select all  Expand view
  // Generated by pressing F1 on an open Menu

   METHOD Help() INLINE ::HelpTopic()

So all you need is to redefine the Method Help()
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42099
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Fivewin Setkey(ALT + F2, {|| ...} ) ?

Postby Jimmy » Mon Oct 31, 2022 8:18 am

hi Antonio,

thx for Answer

do you know "Total Commander" ( Norton Commander )
ALT + F1 left Drive Select Combobox
ALT + F2 right Drive Select Combobox


---

to use SHIFT, CONTROL and ALT i can build 4 x 12 Fn-Key
how under Fivewin :?:

---

does F1 "only" work with "Help" :?:
why is GetKeyState( VK_MENU ) not recognize :?:
greeting,
Jimmy
User avatar
Jimmy
 
Posts: 1732
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany

Re: Fivewin Setkey(ALT + F2, {|| ...} ) ?

Postby Enrico Maria Giordano » Mon Oct 31, 2022 8:43 am

Jimmy wrote:why is GetKeyState( VK_MENU ) not recognize :?:


Try GetAsyncKeyState( VK_MENU ). Works fine here.
User avatar
Enrico Maria Giordano
 
Posts: 8715
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: Fivewin Setkey(ALT + F2, {|| ...} ) ?

Postby Armando » Mon Oct 31, 2022 5:14 pm

Jimmy:

Here is an other sample

IF GetAsyncKey(VK_UP) .OR.;
GetAsyncKey(VK_SHIFT,VK_TAB)
RETURN (.T.)
ENDIF

Regards
SOI, s.a. de c.v.
estbucarm@gmail.com
http://www.soisa.mex.tl/
http://sqlcmd.blogspot.com/
Tel. (722) 174 44 45
Carpe diem quam minimum credula postero
User avatar
Armando
 
Posts: 3228
Joined: Fri Oct 07, 2005 8:20 pm
Location: Toluca, México

Re: Fivewin Setkey(ALT + F2, {|| ...} ) ?

Postby Enrico Maria Giordano » Mon Oct 31, 2022 5:46 pm

Armando wrote:Jimmy:

Here is an other sample

IF GetAsyncKey(VK_UP) .OR.;
GetAsyncKey(VK_SHIFT,VK_TAB)
RETURN (.T.)
ENDIF

Regards


GetAsyncKey() takes only one argument.
User avatar
Enrico Maria Giordano
 
Posts: 8715
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: Fivewin Setkey(ALT + F2, {|| ...} ) ?

Postby Armando » Mon Oct 31, 2022 5:56 pm

Enrico:

In my example

GetAsyncKey(VK_SHIFT,VK_TAB)

Works fine.

If I push the TAB key only, the focus jumps to the next GET, but
If I push both keys, VK_SHIFT + VK_TAB, the focus jumps to the previous GET.

Regards
SOI, s.a. de c.v.
estbucarm@gmail.com
http://www.soisa.mex.tl/
http://sqlcmd.blogspot.com/
Tel. (722) 174 44 45
Carpe diem quam minimum credula postero
User avatar
Armando
 
Posts: 3228
Joined: Fri Oct 07, 2005 8:20 pm
Location: Toluca, México

Re: Fivewin Setkey(ALT + F2, {|| ...} ) ?

Postby Enrico Maria Giordano » Mon Oct 31, 2022 6:26 pm

Armando wrote:Enrico:

In my example

GetAsyncKey(VK_SHIFT,VK_TAB)

Works fine.


Please try with

Code: Select all  Expand view
GetAsyncKey(VK_SHIFT)


It should be the same.
User avatar
Enrico Maria Giordano
 
Posts: 8715
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: Fivewin Setkey(ALT + F2, {|| ...} ) ?

Postby Jimmy » Mon Oct 31, 2022 10:09 pm

hi Enrico,
Enrico Maria Giordano wrote:
Jimmy wrote:why is GetKeyState( VK_MENU ) not recognize :?:

Try GetAsyncKeyState( VK_MENU ). Works fine here.

still can not get any Result for VK_MENU :(

i got Result for GetKeyState( VK_CONTROL ) and GetKeyState( VK_SHIFT ) but not for GetKeyState( VK_MENU )
greeting,
Jimmy
User avatar
Jimmy
 
Posts: 1732
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany

Re: Fivewin Setkey(ALT + F2, {|| ...} ) ?

Postby Jimmy » Mon Oct 31, 2022 10:16 pm

hi Antonio,
Antonio Linares wrote:Usually you associate Alt to a menuitem action that will be executed:

hm ... :idea:

Workaroud
Code: Select all  Expand view
  MENUITEM "Left"  + Chr(9) + "Alt+F1" ;
    ACCELERATOR ACC_ALT, 65648 ;
    ACTION MsgInfo("Alt+F1")

   MENUITEM "Right" + Chr(9) + "Alt+F2" ;
    ACCELERATOR ACC_ALT, 65649 ;
    ACTION MsgInfo("Alt+F2")

so i got now all ALT "Hotkey" also in MENU :D
greeting,
Jimmy
User avatar
Jimmy
 
Posts: 1732
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 94 guests