Bonjour,
Je cherche à utiliser les touches telles que F1..F12
j'ai essayé avec la procedure Get_Immediate (Item : out Character; Available : out Boolean); et la procedure Look_Ahead (Item : out Character; End_Of_Line : out Boolean); mais je n'y parviend pas.
j'utilise Gnat et suis sur Linux.
mon code de test ::=
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26 with Ada.Text_Io; use Ada.Text_Io; with Ada.Integer_Text_Io; -- Pour afficher character'pos(Char); use Ada.Integer_Text_Io; procedure Main is Char : Character; Real_String : String(1..4) := (others => Ascii.Nul); Last_char : Natural := 1; Avaible : Boolean; begin Text_Io.Skip_Line; Get_Immediate(Char,avaible); Put(Integer'Image(Character'Pos(Char))); if Avaible then Real_String(Last_char) := Char; loop Last_Char := Last_Char + 1; Get_Immediate(Char,avaible); Put(Integer'Image(Character'Pos(Char))); Real_String(Last_Char) := Char; exit when not Avaible; end loop; end if; end Main;
Partager