Page 1 of 1

Ctrl + T and bKeyDown

Posted: Mon Dec 26, 2022 7:00 am
by Jimmy
hi.

i do have in Main

Code: Select all | Expand

   oMain:bKeyDown := { | nKey, nFlag | DoMyKey( nKey, nFlag) }

Code: Select all | Expand

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 :?:

Re: Ctrl + T and bKeyDown

Posted: Mon Dec 26, 2022 7:36 am
by Antonio Linares
Dear Jimmy,

Code: Select all | Expand

STATIC PROCEDURE DoMyKey( nKey, nFlag )

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

return
 

Re: Ctrl + T and bKeyDown

Posted: Mon Dec 26, 2022 8:28 am
by Jimmy
hi Antonio,
Antonio Linares wrote:

Code: Select all | Expand

   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 :?:

Re: Ctrl + T and bKeyDown

Posted: Mon Dec 26, 2022 8:32 am
by Antonio Linares
Dear Jimmy,

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

nKey is the key value that was pressed

Re: Ctrl + T and bKeyDown

Posted: Mon Dec 26, 2022 9:15 am
by Jimmy
hi Antonio,
Antonio Linares wrote:

Code: Select all | Expand

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