evertonlb Posted February 10, 2014 Report Share Posted February 10, 2014 Pessoal.. preciso saber onde encontro os códigos para usar no Setkey.. Gostaria de deixar o ALT+R para abrir o contas a receber, o ALT+O para abrir Ordem de Serviço... Procurei no Forum mas não encontrei.. Alguém pode me ajudar? Ja tenho atalhos usando F1, F2, F3... mas preciso usar as combinações de teclas Ctrl, Alt, Shift... Att. Everton Quote Link to comment Share on other sites More sharing options...
kapiaba Posted February 10, 2014 Report Share Posted February 10, 2014 vKey.ch e inKey.ch( não achei na minha versão 13.06)??? Quote Link to comment Share on other sites More sharing options...
SAOliveira Posted February 10, 2014 Report Share Posted February 10, 2014 Veja na pasta include do xHarbour, inkey.ch kapiaba 1 Quote Link to comment Share on other sites More sharing options...
evertonlb Posted February 10, 2014 Author Report Share Posted February 10, 2014 Isso ai que eu queria.. Obrigado! Porem, fiz e não funcionou.. evidentemente fiz algo errado, só não sei o que!!! SETKEY(VK_F2, {||PesqCliente() }) Aqui Funciona SETKEY(VK_F11, {||VES00502() }) Aqui funciona SETKEY(303, {||VES00102() }) Aqui NÃO Funciona Aguardo mais uma vez a gentileza dos colegas!! Att. Everton Quote Link to comment Share on other sites More sharing options...
kapiaba Posted February 10, 2014 Report Share Posted February 10, 2014 Onde você quer acionar este ALT+V?? Quote Link to comment Share on other sites More sharing options...
kapiaba Posted February 10, 2014 Report Share Posted February 10, 2014 tente assim, não testei: // tecla CTRL+K #Define VK_K 75 //#define K_ALT_V 303 /* Alt+V */ #Define VK_KAlt 303 SetKey( VK_K, {|| If( GetKeyState( VK_CONTROL ), TESTE1(), Nil ) } ) SetKey( VK_KAlt, {|| If( GetKeyState( VK_CONTROL ), TESTE2(), Nil ) } ) // ou, VK_MENU Abs, Quote Link to comment Share on other sites More sharing options...
evertonlb Posted February 10, 2014 Author Report Share Posted February 10, 2014 Kapiaba, eu quero colocar isso no Form principal.. ai, em qualquer lugar do software o cara pode chamar o VES00102(), que nada mais é do que uma janela para fazer observação no cadastro do cliente.. Mas ela precisa ficar disponível o tempo todo.. ai dentro da tela eu desabilito para o "uçuárrio" ( termo muito usado na região Oeste de SC por descendentes alemães ) não ficar chamando a janela infinitamente. Na saída eu torno a ativá-la. Vou tentar definir no início do Form principal, mas uma duvida que surgiu é: Porque que usando o VK_F9, VK_F2 e VK_F11 não preciso defini-las? Elas já vem definidas "de fábrica"? Quote Link to comment Share on other sites More sharing options...
kapiaba Posted February 10, 2014 Report Share Posted February 10, 2014 Sim, veja \fwh..\include\vKey.ch #define VK_F1 112 // 0x70 #define VK_F2 113 // 0x71 #define VK_F3 114 // 0x72 #define VK_F4 115 // 0x73 #define VK_F5 116 // 0x74 #define VK_F6 117 // 0x75 #define VK_F7 118 // 0x76 #define VK_F8 119 // 0x77 #define VK_F9 120 // 0x78 #define VK_F10 121 // 0x79 #define VK_F11 122 // 0x7A #define VK_F12 123 // 0x7B #define VK_F13 124 // 0x7C #define VK_F14 125 // 0x7D #define VK_F15 126 // 0x7E #define VK_F16 127 // 0x7F #define VK_F17 128 // 0x80 #define VK_F18 129 // 0x81 #define VK_F19 130 // 0x82 #define VK_F20 131 // 0x83 #define VK_F21 132 // 0x84 #define VK_F22 133 // 0x85 #define VK_F23 134 // 0x86 #define VK_F24 135 // 0x87 FORM Principal??? Você é ou era uçuárrrrio de DELPHIIIRRRRCCCCCCCCCCCCCCC??? kkkkkkkkkkkkkkkkkkkkkkk Senhor, livrai-nos de todo o mal(delphi), amém. Em FiveWin, não seria JANELA(WINDOW.PRG) Principal?? Abs, Quote Link to comment Share on other sites More sharing options...
evertonlb Posted February 10, 2014 Author Report Share Posted February 10, 2014 Cara.. unica coisa que sei a respeito do Delphi, é que ele existe. Sinceramente eu deveria ter me dedicado a aprende-lo qdo tive tempo. Mas o xBase me agrada muito, assim, ainda que muito limitado, aplico meu tempo a aprender e usar o FW. Então usarei o termo correto "JANELA principal"... Pronto, espero ter sido aceito ao grupo! rsrsrsrsrsrs Mas Olha só... tenho o Vkey.CH que tem algumas teclas já definidas, e também tenho a Inkey.CH que tem muito mais teclas definidas, Se eu colocar um #Include "inkey.ch" No início da "JANELA principal", estes valores não estariam todos definidos dentro do meu sófiti? Porque raios não consigo usar alem das Fx? Att. Everton Quote Link to comment Share on other sites More sharing options...
kapiaba Posted February 10, 2014 Report Share Posted February 10, 2014 #Include "inkey.ch" No início da "JANELA principal", estes valores não estariam todos definidos dentro do meu sófiti? Porque raios não consigo usar alem das Fx? Acho que não funcionará... Terias que usar um classe definindo estas novas teclas de atalho, tem uma no forum inter, mas não localizei o nome. Não lembro se foi o Manuel Mercado que a Fez ou a implementou. Não sei informar se é a API do rWindows ou se é o FiveWin q não deixa. Bem vindo ao TIME... kkkkkkkkkkkkk,, Delphiiiirrrccc, graças à Deus que não aprendestes. Quote Link to comment Share on other sites More sharing options...
evertonlb Posted February 10, 2014 Author Report Share Posted February 10, 2014 Obrigado Kapiaba, mas sinceramente achei que seria mais simples definir estas teclas... O problema é que preciso pra ontem!!! Mas vou dar mais uma olhada no forum.. vai que acho alguma coisa! Att. Everton Quote Link to comment Share on other sites More sharing options...
evertonlb Posted February 10, 2014 Author Report Share Posted February 10, 2014 SAOliveira, obrigado pela dica, inclui o inkey.ch, achei os códigos que queria, mas não funcionou mesmo assim! Att. Everton Quote Link to comment Share on other sites More sharing options...
cendon Posted February 10, 2014 Report Share Posted February 10, 2014 Boa tarde Everton! Tente assim Eu chamo uma função só, dentro dela eu trato o que eu quero a partir do parametro "PF2" setkey( 113, { | nkey | escrevepf("PF2") } ) Mais uma coisa eu não uso nenhum .ch para setar teclas coloco o codigo da tecla direto a linha de comando está no principo da main() Espero ter ajudado Quote Link to comment Share on other sites More sharing options...
Theotokos Posted February 10, 2014 Report Share Posted February 10, 2014 A Maneira que encontrei para fazer isto foi colocar associado ao menu... assim: MENUItem "&Vendas/Entregas"+CHR(9)+"(V)" ACTION Lan_Venda() MESSAGE "EFETUAR O LANÇAMENTO DE PEDIDO DO CLIENTE" ; ACCELERATOR ACC_ALT, ASC("V") When lS_Venda Quote Link to comment Share on other sites More sharing options...
Ariston Santos Posted February 11, 2014 Report Share Posted February 11, 2014 EU FAÇO ASSIM: SETKEY( VK_F2 , {|| ChkKeyFn("F2") }) SETKEY( VK_F3 , {|| ChkKeyFn("F3") }) DAÍ, DENTRO DA FUNCAO ChkKeyFn(cPar) REDIRECIONO PARA A FUNÇÃO APRORPIADA. FUNCTION ChkKeyFn(cKey) if GetKeyState( VK_CONTROL ) // Caso quera conjugar CTRL+F?? IF cKey = "F2" ; FuncaoDoCtrlF2() ; ENDIF IF cKey = "F3" ; FuncaoDoCtrlF3() ; ENDIF ELSEIF GetKeyState( VK_ALT ) // Caso quera conjugar ALT+F?? IF cKey = "F2" ; FuncaoDoAltF2() ; ENDIF IF cKey = "F3" ; FuncaoDoAltF3() ; ENDIF ELSE // Apenas F2 IF cKey = "F2" ; FuncaoDoF2() ; ENDIF IF cKey = "F3" ; FuncaoDoF3() ; ENDIF ENDIF RETURN NIL COMFORME VOCÊ PODE VER, PODEM SER USADAS OUTRAS TECLAS (F3, F4, ETC.) MAS PRECISA PASSAR ISSO COMO PARÂMETRO TAMBÉM. Quote Link to comment Share on other sites More sharing options...
evertonlb Posted February 11, 2014 Author Report Share Posted February 11, 2014 SIm, entendi a lógica... agora to com outro pepino.. umas etiquetas que não funcionam.. assim que terminar estas etiquetas volto as setkey().. Pelo jeito, hoje só vai acabar amanhã de tarde... tsc, tsc, tsc... Obrigado pelas dicas pessoal... Att. Everton Quote Link to comment Share on other sites More sharing options...
kapiaba Posted February 11, 2014 Report Share Posted February 11, 2014 Ariston, não funciona o ALT+, o que está errado? #include "FiveWin.ch" #Define VK_A 65 // tecla CTRL+A #Define VK_B 66 // tecla CTRL+B #Define VK_K 75 // tecla CTRL+K #define VK_P 80 // tecla CTRL+P //----------------------------------------------------------------// static oWnd function Main() local oBar /* SetKey( VK_A, {|| If( GetKeyState( VK_CONTROL ), Shortcut(), Nil ) } ) SetKey( VK_B, {|| If( GetKeyState( VK_CONTROL ), Shortcut(), Nil ) } ) SetKey( VK_K, {|| If( GetKeyState( VK_CONTROL ), Shortcut(), Nil ) } ) SetKey( VK_P, {|| If( GetASyncKey( VK_MENU ), Shortcut(), Nil ) } ) */ // Como acionar a tecla ALT+ aqui?? SETKEY( VK_F2 , {|| ChkKeyFn("F2") }) SETKEY( VK_F3 , {|| ChkKeyFn("F3") }) DEFINE WINDOW oWnd TITLE "SetKey " DEFINE BUTTONBAR oBar _3D OF oWnd DEFINE BUTTON OF oBar SET MESSAGE OF oWnd TO "Setkey " NOINSET CLOCK DATE KEYBOARD ACTIVATE WINDOW oWnd return nil Procedure Shortcut() If GetKeyState(VK_SHIFT) // Shift ? "Shift+" // funciona end If GetKeyState(VK_CONTROL) // CTRL ? "Ctrl+" // funciona end If GetKeyState(VK_MENU) // Alt ? "Alt+" // No funciona end return FUNCTION ChkKeyFn(cKey) if GetKeyState( VK_CONTROL ) // Caso quera conjugar CTRL+F?? IF cKey = "F2" ; FuncaoDoCtrlF2() ; ENDIF IF cKey = "F3" ; FuncaoDoCtrlF3() ; ENDIF ELSEIF GetKeyState( VK_MENU ) // VK_ALT ???Caso quera conjugar ALT+F?? IF cKey = "F2" ; FuncaoDoAltF2() ; ENDIF IF cKey = "F3" ; FuncaoDoAltF3() ; ENDIF ELSE // Apenas F2 IF cKey = "F2" ; FuncaoDoF2() ; ENDIF IF cKey = "F3" ; FuncaoDoF3() ; ENDIF ENDIF RETURN NIL FUNCTION FuncaoDoCtrlF2() ? [FuncaoDoCtrlF2()] RETURN NIL FUNCTION FuncaoDoCtrlF3() ? [FuncaoDoCtrlF3()] RETURN NIL FUNCTION FuncaoDoAltF2() ? [FuncaoDoAltF2()] RETURN NIL FUNCTION FuncaoDoAltF3() ? [FuncaoDoAltF3()] RETURN NIL FUNCTION FuncaoDoF2() ? [FuncaoDoF2()] RETURN NIL FUNCTION FuncaoDoF3() ? [FuncaoDoF3()] RETURN NIL Quote Link to comment Share on other sites More sharing options...
cendon Posted February 11, 2014 Report Share Posted February 11, 2014 Ariston, não funciona o ALT+, o que está errado? #include "FiveWin.ch" #Define VK_A 65 // tecla CTRL+A #Define VK_B 66 // tecla CTRL+B #Define VK_K 75 // tecla CTRL+K #define VK_P 80 // tecla CTRL+P //----------------------------------------------------------------// static oWnd function Main() local oBar /* SetKey( VK_A, {|| If( GetKeyState( VK_CONTROL ), Shortcut(), Nil ) } ) SetKey( VK_B, {|| If( GetKeyState( VK_CONTROL ), Shortcut(), Nil ) } ) SetKey( VK_K, {|| If( GetKeyState( VK_CONTROL ), Shortcut(), Nil ) } ) SetKey( VK_P, {|| If( GetASyncKey( VK_MENU ), Shortcut(), Nil ) } ) */ // Como acionar a tecla ALT+ aqui?? SETKEY( VK_F2 , {|| ChkKeyFn("F2") }) SETKEY( VK_F3 , {|| ChkKeyFn("F3") }) DEFINE WINDOW oWnd TITLE "SetKey " DEFINE BUTTONBAR oBar _3D OF oWnd DEFINE BUTTON OF oBar SET MESSAGE OF oWnd TO "Setkey " NOINSET CLOCK DATE KEYBOARD ACTIVATE WINDOW oWnd return nil Procedure Shortcut() If GetKeyState(VK_SHIFT) // Shift ? "Shift+" // funciona end If GetKeyState(VK_CONTROL) // CTRL ? "Ctrl+" // funciona end If GetKeyState(VK_MENU) // Alt ? "Alt+" // No funciona end return FUNCTION ChkKeyFn(cKey) if GetKeyState( VK_CONTROL ) // Caso quera conjugar CTRL+F?? IF cKey = "F2" ; FuncaoDoCtrlF2() ; ENDIF IF cKey = "F3" ; FuncaoDoCtrlF3() ; ENDIF ELSEIF GetKeyState( VK_MENU ) // VK_ALT ???Caso quera conjugar ALT+F?? IF cKey = "F2" ; FuncaoDoAltF2() ; ENDIF IF cKey = "F3" ; FuncaoDoAltF3() ; ENDIF ELSE // Apenas F2 IF cKey = "F2" ; FuncaoDoF2() ; ENDIF IF cKey = "F3" ; FuncaoDoF3() ; ENDIF ENDIF RETURN NIL FUNCTION FuncaoDoCtrlF2() ? [FuncaoDoCtrlF2()] RETURN NIL FUNCTION FuncaoDoCtrlF3() ? [FuncaoDoCtrlF3()] RETURN NIL FUNCTION FuncaoDoAltF2() ? [FuncaoDoAltF2()] RETURN NIL FUNCTION FuncaoDoAltF3() ? [FuncaoDoAltF3()] RETURN NIL FUNCTION FuncaoDoF2() ? [FuncaoDoF2()] RETURN NIL FUNCTION FuncaoDoF3() ? [FuncaoDoF3()] RETURN NIL Não é VK_MENU If GetKeyState(VK_MENU) // Alt ? "Alt+" // No funciona end é VK_ALT If GetKeyState(VK_ALT) // Alt ? "Alt+" // No funciona end Quote Link to comment Share on other sites More sharing options...
kapiaba Posted February 12, 2014 Report Share Posted February 12, 2014 Meu compilador diz que VK_ALT não existe. ???? Quote Link to comment Share on other sites More sharing options...
Ariston Santos Posted February 12, 2014 Report Share Posted February 12, 2014 Encontrei o código abaixo mas não teste. Veja se funciona aí. If GetASyncKey(18) ? 'Tecla Alt pressionada'ENDIF Quote Link to comment Share on other sites More sharing options...
evertonlb Posted February 13, 2014 Author Report Share Posted February 13, 2014 Usando o Código do Ariston e do Kapiaba, funciona os Ctrl+F, mas não os ALT+F. Mas ainda não seria beeeemmm isso na minha duvida original, precisaria usar o ALT+V, ALT+R, ALT+O, ALT+T... Pelo que vi só poderei usar o Ctrl+F e Alt+F.. certo? Att. Everton Quote Link to comment Share on other sites More sharing options...
evertonlb Posted February 13, 2014 Author Report Share Posted February 13, 2014 Mas se funcionar as ALT+F, com os outros atalhos posso usar o Ctrl+"letra" Att. Everton Quote Link to comment Share on other sites More sharing options...
kapiaba Posted February 13, 2014 Report Share Posted February 13, 2014 Everton, tem alguma confusão na sua dúvida. Para que voce quer tantas teclas de atalhos?? Pois usando o ACCELERATOR DO FiveWin, diretamente nos itens do MENU, você pode usar qualquer combinação de teclas. Quote Link to comment Share on other sites More sharing options...
evertonlb Posted February 13, 2014 Author Report Share Posted February 13, 2014 Kapiaba, estou trocando minha versão em Clipper por uma em FW. Para não causar mais problemas do que ja tenho, gostaria de deixar disponível o atalhos mais usados do sistema em Clipper. Sã o elas.: Alt+F1, ALt+F2, Alt+F4, Alt+F5, Alt+F6, Alt+F8, ALt+F9, Alt+f11 e Alt+F12. Estas eu já estou colocando com os Ctrl. Mas ai precisaria dos Alt+V, Alt+R, Alt+T e Alt+E. Estas ultimas 4, se eu conseguir deixar como estão vai me dar menos dor de cabeça. Não conheço o ACCELERATOR.. vou dar uma olhada, o Theotokos fez um comentário usando este comando.. Obrigado Att. Everton Quote Link to comment Share on other sites More sharing options...
kapiaba Posted February 13, 2014 Report Share Posted February 13, 2014 Veja no \samples\XBRDBU,PRG / TESTACC.PRG / TESTMENU.PRG Você mata a pau. abs, 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.