Ctrl + T and bKeyDown

Ctrl + T and bKeyDown

Postby Jimmy » Mon Dec 26, 2022 7:00 am

hi.

i do have in Main
Code: Select all  Expand view  RUN
  oMain:bKeyDown := { | nKey, nFlag | DoMyKey( nKey, nFlag) }

Code: Select all  Expand view  RUN
STATIC PROCEDURE DoMyKey( nKey, nFlag )
   DO CASE
      CASE GetKeyState( VK_SHIFT )
      CASE GetKeyState( VK_CONTROL )
      CASE GetKeyState( VK_MENU )
   ENDCASE
   DO CASE
      CASE nKey = VK_F2
      CASE nKey = VK_F3
      CASE nKey = VK_F5
      CASE nKey = VK_F6
      CASE nKey = VK_F7
      CASE nKey = VK_F8
      CASE nKey = VK_F9
      CASE nKey = VK_F11
      CASE nKey = VK_F12
      CASE nKey = VK_ADD
      CASE nKey = VK_SUBTRACT
// how Ctrl + "T"
      CASE nKey = 20 // 116 // .AND. lCtrl = .T.
   ENDCASE

how can i get Ctrl + T :?:
greeting,
Jimmy
User avatar
Jimmy
 
Posts: 1732
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany

Re: Ctrl + T and bKeyDown

Postby Antonio Linares » Mon Dec 26, 2022 7:36 am

Dear Jimmy,

Code: Select all  Expand view  RUN
STATIC PROCEDURE DoMyKey( nKey, nFlag )

   if GetKeyState( VK_CONTROL ) .and. nKey = 20
      ...
   endif

return
 
regards, saludos

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

Re: Ctrl + T and bKeyDown

Postby Jimmy » Mon Dec 26, 2022 8:28 am

hi Antonio,
Antonio Linares wrote:
Code: Select all  Expand view  RUN
   if GetKeyState( VK_CONTROL ) .and. nKey = 20 

the "Problem" is what to "use" for "t"/"T" as nKey :?:

is there a Way to find out which "nKey" was press :?:
greeting,
Jimmy
User avatar
Jimmy
 
Posts: 1732
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany

Re: Ctrl + T and bKeyDown

Postby Antonio Linares » Mon Dec 26, 2022 8:32 am

Dear Jimmy,

if GetKeyState( VK_CONTROL ) .and. ( nKey == Asc( "t" ) .or. nKey == Asc( "T" ) )

nKey is the key value that was pressed
regards, saludos

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

Re: Ctrl + T and bKeyDown

Postby Jimmy » Mon Dec 26, 2022 9:15 am

hi Antonio,
Antonio Linares wrote:
Code: Select all  Expand view  RUN
if GetKeyState( VK_CONTROL ) .and. ( nKey == Asc( "t" )  .or. nKey == Asc( "T" ) )

nKey is the key value that was pressed

YES :D
this Way it work like i want, thx
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: Google [Bot] and 95 guests