Funcion Inkey()

HMG en Español

Moderator: Rathinagiri

Post Reply
jpuntoapunto
Posts: 36
Joined: Sat Jun 01, 2013 6:50 pm

Funcion Inkey()

Post 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
User avatar
mol
Posts: 3774
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Contact:

Re: Funcion Inkey()

Post 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
User avatar
bpd2000
Posts: 1207
Joined: Sat Sep 10, 2011 4:07 am
Location: India

Re: Funcion Inkey()

Post by bpd2000 »

Refer
viewtopic.php?f=36&t=2894&start=10&hili ... ter#p30628
or
C:\hmg\SAMPLES\Controls\Grid\GridIncrementalSearch
BPD
Convert Dream into Reality through HMG
jpuntoapunto
Posts: 36
Joined: Sat Jun 01, 2013 6:50 pm

Re: Funcion Inkey()

Post by jpuntoapunto »

OK, thanks for your quick answers, mol and bpd2000.
I will seek information about it.
Post Reply