bug-ncurses
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Change of Get_Keystroke() Behaviour in Ada


From: Playerdark
Subject: Change of Get_Keystroke() Behaviour in Ada
Date: Wed, 14 May 2014 05:39:19 -0700
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0

I had this problem for a while but I wasn't able until now to examine it more deeply.

I am running the latest Ada version from AdaLibre, but had the problem with the 2013 version as well.

My application calls Get_Keystroke() in the mainloop and the function returns correctly with Key_None until I click into the terminal window that runs the application. From that moment on, the call to Wgetch (Win); blocks until a key is pressed. I'm not sure if I am making a mistake in the way the system is called, but since it works fine and a mouseclick shouldn't change it, I guess it must be a bug?





   function Get_Keystroke (Win : Window := Standard_Window)
     return Real_Key_Code
   is
      function Wgetch (W : Window) return C_Int;
      pragma Import (C, Wgetch, "wgetch");

      C : constant C_Int := Wgetch (Win); <<<<< Blocks after mouse click
   begin
      if C = Curses_Err then
         return Key_None;
      else
         return Real_Key_Code (C);
      end if;
   end Get_Keystroke;




reply via email to

[Prev in Thread] Current Thread [Next in Thread]