Ctrl + T and bKeyDown

Post Reply
User avatar
Jimmy
Posts: 1740
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany
Has thanked: 2 times

Ctrl + T and bKeyDown

Post 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 :?:
greeting,
Jimmy
User avatar
Antonio Linares
Site Admin
Posts: 42595
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Has thanked: 38 times
Been thanked: 86 times
Contact:

Re: Ctrl + T and bKeyDown

Post by Antonio Linares »

Dear Jimmy,

Code: Select all | Expand

STATIC PROCEDURE DoMyKey( nKey, nFlag )

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

return
 
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Jimmy
Posts: 1740
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany
Has thanked: 2 times

Re: Ctrl + T and bKeyDown

Post 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 :?:
greeting,
Jimmy
User avatar
Antonio Linares
Site Admin
Posts: 42595
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Has thanked: 38 times
Been thanked: 86 times
Contact:

Re: Ctrl + T and bKeyDown

Post 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
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Jimmy
Posts: 1740
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany
Has thanked: 2 times

Re: Ctrl + T and bKeyDown

Post 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
greeting,
Jimmy
Post Reply