Page 1 of 1

Funcion Inkey()

Posted: Tue May 17, 2016 5:01 pm
by jpuntoapunto
Hola.

¿Alguien me puede decir por que el siguiente ejemplo no me funciona ?.
El tema es que la funcion inkey() espera el tiempo que se le pasa como parámetro pero no detecta ni devuelve la tecla pulsada, siempre devuelve CERO.

Gracias por la atencion.
J.A.

Code: Select all

#include "hmg.ch"
#include "inkey.ch"

Function Main
  
  DEFINE WINDOW V_Prin ;
    AT 0,0 ;
    WIDTH 800 HEIGHT 600 ;
    MAIN

    DEFINE MAIN MENU OF V_Prin
      POPUP "Pruebas"
        ITEM "Prueba 1" ACTION Prueba1()
        ITEM "Salir" ACTION V_Prin.Release
      END POPUP
    END MENU
		
  END WINDOW
  ACTIVATE WINDOW V_Prin
Return Nil

Function Prueba1()

  tecla := inkey(5)
  
  msgbox(tecla)                 // ¿ POR QUE SIEMPRE ES CERO ?

RETURN

Re: Funcion Inkey()

Posted: Tue May 17, 2016 5:34 pm
by mol
you can use something like that:
ch := HMG_GetLastCharacter(@hWnd)
instead of inkey() function,
where hWnd returns handle of your active form.
Search for posts containing this function on forum

Re: Funcion Inkey()

Posted: Wed May 18, 2016 4:17 am
by bpd2000
Refer
viewtopic.php?f=36&t=2894&start=10&hili ... ter#p30628
or
C:\hmg\SAMPLES\Controls\Grid\GridIncrementalSearch

Re: Funcion Inkey()

Posted: Wed May 18, 2016 9:25 am
by jpuntoapunto
OK, thanks for your quick answers, mol and bpd2000.
I will seek information about it.