Edu Posted December 1, 2016 Report Share Posted December 1, 2016 Prezados, Bom dia! Gostaria de uma ajuda, estou querendo colocar um atalho com duas teclas num GET. Ex: Ctrl + P. Isso é possível? Grato. Quote Link to comment Share on other sites More sharing options...
aferra Posted December 1, 2016 Report Share Posted December 1, 2016 bem não testei mas a ideia é +- assim oKey:bPostKey := {|| IF( oKey:nLastKey == VK_CONTROL + oKey:nLastKey == "P", sua_funcao(), ) } Quote Link to comment Share on other sites More sharing options...
Edu Posted December 1, 2016 Author Report Share Posted December 1, 2016 Não funcionou aferra. Deixa eu explicar melhor... Eu quero, no nKeyDown da Dialog, quando teclado [Ctrl + P], execute um setFocus no GET. Quote Link to comment Share on other sites More sharing options...
Edu Posted December 1, 2016 Author Report Share Posted December 1, 2016 No xDevStudio tem a tabela de Inkey Codes que tem teclas do tipo K_CTRL_P = [Ctrl + P], porém não funciona. Dá erro de variável não existe. Quote Link to comment Share on other sites More sharing options...
Theotokos Posted December 1, 2016 Report Share Posted December 1, 2016 vc inlcuir o INCLUDE #Include "inkey.ch" Quote Link to comment Share on other sites More sharing options...
kapiaba Posted December 1, 2016 Report Share Posted December 1, 2016 Veja se te ajuda: oDlg:bKeyDown := { | nKey | Ctrl_Teclas(nKey,oDlg) } Function Ctrl_Teclas(nKey,oDlg) Do Case Case ( nKey == Asc( "S" ) .OR. nKey == Asc( "s" ) ) .AND. GetKeyState( VK_CONTROL ) oDlg:End() Case ( nKey == Asc( "O" ) .OR. nKey == Asc( "o" ) ) .AND. GetKeyState( VK_CONTROL ) Grava() Case ( nKey == Asc( "P" ) .OR. nKey == Asc( "p" ) ) .AND. GetKeyState( VK_CONTROL ) Imprime() EndCase Return Nil Quote Link to comment Share on other sites More sharing options...
Edu Posted December 1, 2016 Author Report Share Posted December 1, 2016 Show Kapiaba! Funcionou! Many Thanks. kapiaba 1 Quote Link to comment Share on other sites More sharing options...
kapiaba Posted December 1, 2016 Report Share Posted December 1, 2016 Very good. ou, "mmercado" Hola Ubiratan: Preciso chamar em todo meu sistema a função GERAL(), para isso gostaria de usar a tecla CTRL+K. ex: setKey( CTRL+K, { | nKey | GERAL() } ) Como fazer isto? No soy Antonio pero tal vez esto te sirva: #define VK_K 75 SetKey( VK_K, {|| If( GetKeyState( VK_CONTROL ), GERAL(), Nil ) } ) Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.