-- B O D Y --
-- --
------------------------------------------------------------------------------
--- Copyright (c) 2000 Free Software Foundation, Inc. --
+-- Copyright (c) 2000-2006,2008 Free Software Foundation, Inc. --
-- --
-- Permission is hereby granted, free of charge, to any person obtaining a --
-- copy of this software and associated documentation files (the --
------------------------------------------------------------------------------
-- Author: Eugene V. Melaragno <aldomel@ix.netcom.com> 2000
-- Version Control
--- $Revision: 1.1 $
+-- $Revision: 1.7 $
+-- $Date: 2008/07/26 18:46:58 $
-- Binding Version 01.00
------------------------------------------------------------------------------
-- Character input test
return To_String (buf);
end mouse_decode;
-
buf : String (1 .. 1024); -- TODO was BUFSIZE
n : Integer;
c : Key_Code;
y : Line_Position;
tmpx : Integer;
incount : Integer := 0;
+
begin
Refresh;
tmp2 := Start_Mouse (All_Events);
Put (tmp6, Integer (c), 8);
Add (Str => tmp6);
Add (Ch => ' ');
- if c = Key_Mouse then declare
- event : Mouse_Event;
- begin
- event := Get_Mouse;
- Add (Str => "KEY_MOUSE, ");
- Add (Str => mouse_decode (event));
- Add (Ch => newl);
- end;
+ if c = Key_Mouse then
+ declare
+ event : Mouse_Event;
+ begin
+ event := Get_Mouse;
+ Add (Str => "KEY_MOUSE, ");
+ Add (Str => mouse_decode (event));
+ Add (Ch => newl);
+ end;
elsif c >= Key_Min then
Key_Name (c, tmp20);
Add (Str => tmp20);
Add (Ch => newl);
elsif c > 16#80# then -- TODO fix, use constant if possible
declare
- c2 : Character := Character'Val (c mod 16#80#);
+ c2 : constant Character := Character'Val (c mod 16#80#);
begin
if Ada.Characters.Handling.Is_Graphic (c2) then
Add (Str => "M-");
Add (Str => " (high-half character)");
Add (Ch => newl);
end;
- else declare
- c2 : Character := Character'Val (c mod 16#80#);
- begin
- if Ada.Characters.Handling.Is_Graphic (c2) then
- Add (Ch => c2);
- Add (Str => " (ASCII printable character)");
- Add (Ch => newl);
- else
- Add (Str => Un_Control ((Ch => c2,
- Color => Color_Pair'First,
- Attr => Normal_Video)));
- Add (Str => " (ASCII control character)");
- Add (Ch => newl);
- end if;
- end;
+ else
+ declare
+ c2 : constant Character := Character'Val (c mod 16#80#);
+ begin
+ if Ada.Characters.Handling.Is_Graphic (c2) then
+ Add (Ch => c2);
+ Add (Str => " (ASCII printable character)");
+ Add (Ch => newl);
+ else
+ Add (Str => Un_Control ((Ch => c2,
+ Color => Color_Pair'First,
+ Attr => Normal_Video)));
+ Add (Str => " (ASCII control character)");
+ Add (Ch => newl);
+ end if;
+ end;
end if;
-- TODO I am not sure why this was in the C version
-- the delay statement scroll anyway.
end loop;
end loop;
- tmp2 := Start_Mouse (No_Events);
+ End_Mouse (tmp2);
Set_Timeout_Mode (Mode => Blocking, Amount => 0); -- amount is ignored
Set_Raw_Mode (SwitchOn => False);
Set_NL_Mode (SwitchOn => True);