diff options
author | Jed Barber <jjbarber@y7mail.com> | 2017-06-11 18:27:34 +1000 |
---|---|---|
committer | Jed Barber <jjbarber@y7mail.com> | 2017-06-11 18:27:34 +1000 |
commit | 260c988ea3f73d194643df1e871a2a40949c2763 (patch) | |
tree | 06494460507b1535a79ce6f0ec9760abf33ce667 /src/fltk.ads | |
parent | 50ebd224ee7dbed4494d43fd63cdc794380a9a36 (diff) |
Key binding functions and procedures added to Text_Editor package
Diffstat (limited to 'src/fltk.ads')
-rw-r--r-- | src/fltk.ads | 43 |
1 files changed, 38 insertions, 5 deletions
diff --git a/src/fltk.ads b/src/fltk.ads index 757eaf7..12ed6b1 100644 --- a/src/fltk.ads +++ b/src/fltk.ads @@ -32,7 +32,20 @@ package FLTK is type Shortcut_Key is private; subtype Pressable_Key is Character range Character'Val (32) .. Character'Val (126); function Shortcut (Key : Pressable_Key) return Shortcut_Key; - No_Key : constant Shortcut_Key; + No_Key : constant Shortcut_Key; + Enter_Key : constant Shortcut_Key; + Keypad_Enter_Key : constant Shortcut_Key; + Backspace_Key : constant Shortcut_Key; + Insert_Key : constant Shortcut_Key; + Delete_Key : constant Shortcut_Key; + Home_Key : constant Shortcut_Key; + End_Key : constant Shortcut_Key; + Page_Down_Key : constant Shortcut_Key; + Page_Up_Key : constant Shortcut_Key; + Down_Key : constant Shortcut_Key; + Left_Key : constant Shortcut_Key; + Right_Key : constant Shortcut_Key; + Up_Key : constant Shortcut_Key; type Modifier_Key is private; @@ -202,15 +215,20 @@ private type Shortcut_Key is record Modifier : Modifier_Key; - Keypress : Character; + Keypress : Interfaces.Unsigned_16; end record; function Key_To_C - (Key : Shortcut_Key) + (Key : in Shortcut_Key) return Interfaces.C.unsigned_long; + function C_To_Key + (Key : in Interfaces.C.unsigned_long) + return Shortcut_Key; + + -- these values designed to align with FLTK enumeration types Mod_None : constant Modifier_Key := 2#00000000#; Mod_Shift : constant Modifier_Key := 2#00000001#; @@ -218,8 +236,23 @@ private Mod_Alt : constant Modifier_Key := 2#00001000#; - No_Key : constant Shortcut_Key := - (Modifier => Mod_None, Keypress => Character'Val (0)); + No_Key : constant Shortcut_Key := (Modifier => Mod_None, Keypress => 0); + + + -- these values correspond to constants defined in FLTK Enumerations.H + Enter_Key : constant Shortcut_Key := (Modifier => Mod_None, Keypress => 16#ff0d#); + Keypad_Enter_Key : constant Shortcut_Key := (Modifier => Mod_None, Keypress => 16#ff8d#); + Backspace_Key : constant Shortcut_Key := (Modifier => Mod_None, Keypress => 16#ff08#); + Insert_Key : constant Shortcut_Key := (Modifier => Mod_None, Keypress => 16#ff63#); + Delete_Key : constant Shortcut_Key := (Modifier => Mod_None, Keypress => 16#ffff#); + Home_Key : constant Shortcut_Key := (Modifier => Mod_None, Keypress => 16#ff50#); + End_Key : constant Shortcut_Key := (Modifier => Mod_None, Keypress => 16#ff57#); + Page_Down_Key : constant Shortcut_Key := (Modifier => Mod_None, Keypress => 16#ff56#); + Page_Up_Key : constant Shortcut_Key := (Modifier => Mod_None, Keypress => 16#ff55#); + Down_Key : constant Shortcut_Key := (Modifier => Mod_None, Keypress => 16#ff54#); + Left_Key : constant Shortcut_Key := (Modifier => Mod_None, Keypress => 16#ff51#); + Right_Key : constant Shortcut_Key := (Modifier => Mod_None, Keypress => 16#ff53#); + Up_Key : constant Shortcut_Key := (Modifier => Mod_None, Keypress => 16#ff52#); end FLTK; |