FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour inkey(0)
Posts: 1392
Joined: Mon May 14, 2007 09:49 AM
inkey(0)
Posted: Sun Aug 25, 2024 06:12 AM
Hi,

I need to perform some actions in an infinite loop, taking into account the pressed key at each iteration. I wrote:
Code (fw): Select all Collapse
do while .T.
  if inkey(0)=32
    .........
  else
    exit
  endif
  sysrefresh()
enddo
However, in FW24.2, this design does not work. That is, inkey(0) freezes. How can this be implemented ?
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: inkey(0)
Posted: Sun Aug 25, 2024 09:02 AM

If you are using a Windows GUI app you must be using a window or a dialog and then you check the inkey event on those objects

Are you showing something in your app ?

Please post a complete and reduced example, thank you

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 1392
Joined: Mon May 14, 2007 09:49 AM
Re: inkey(0)
Posted: Sun Aug 25, 2024 12:21 PM

Thank you, Antonio! I figured it out.

Posts: 8515
Joined: Tue Dec 20, 2005 07:36 PM
Re: inkey(0)
Posted: Sun Aug 25, 2024 05:11 PM
Use:
Code (fw): Select all Collapse
   IF LASTKEY() = VK_ESCAPE

      ...

   ELSE

      ...

   ENDIF
Regards, saludos.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341

Continue the discussion