Post Reply 
WaitLab: a utility for examining Wait(-1) command response to touchpad gestures
12-16-2014, 05:59 PM
Post: #2
RE: WaitLab: a utility for examining Wait(-1) command response to touchpad gestures
Here's a slightly different approach to seeing the difference between wait(-1) and mouse(). Press [Apps] to clear the screen. Press [Symb] to toggle between showing wait(-1), mouse(), or both. Event types are color coded according to the result from wait(-1).

Code:
EXPORT KEYHANDLER()
BEGIN

local run=1;
local key;
local n=0;
local cl:={#0h,#FF0000h,#FF00h,#FFh,#FFFF00h,#FFFFh,#A0A0A0h,#FF00AAh};
local cc:=1;
local mode:=0;

  rect_p();

  while run do
    key:=wait(-1);
    if TYPE(key)==6 then
      cc:=key(1)+1;
      if mode<2 then
        rect_p(G0,0,20*n,320,20*(n+1));
        textout_p(key,G0,1,20*n+1,1,cl(cc),320,#FFFFFFh);
        n:=n+1;
        if n>11 then n:=0;  end; 
      end;
      if mode then
        rect_p(G0,0,20*n,320,20*(n+1));
        textout_p(mouse(),G0,1,20*n+1,1,cl(cc),320,#FFFFFFh);
        n:=n+1;
        if n>11 then n:=0;  end; 
      end;
    else
      cc:=1;
      if key==0 then rect_p(); n:=0; end;
      if key==1 then mode:=(mode+1) MOD 3; end;
      rect_p(G0,0,20*n,320,20*(n+1));
      textout_p(key,G0,1,20*n+1,3,#0h,320,#FFFFFFh);
      n:=n+1;
      if n>11 then n:=0; rect_p(); end; 
      if key==4 then run:=0; end;
    end;

  end;

END;

Graph 3D | QPI | SolveSys
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: WaitLab: a utility for examining Wait(-1) command response to touchpad gestures - Han - 12-16-2014 05:59 PM



User(s) browsing this thread: 1 Guest(s)