summaryrefslogtreecommitdiff
path: root/src/fltk.adb
diff options
context:
space:
mode:
authorJed Barber <jjbarber@y7mail.com>2017-06-11 18:27:34 +1000
committerJed Barber <jjbarber@y7mail.com>2017-06-11 18:27:34 +1000
commit260c988ea3f73d194643df1e871a2a40949c2763 (patch)
tree06494460507b1535a79ce6f0ec9760abf33ce667 /src/fltk.adb
parent50ebd224ee7dbed4494d43fd63cdc794380a9a36 (diff)
Key binding functions and procedures added to Text_Editor package
Diffstat (limited to 'src/fltk.adb')
-rw-r--r--src/fltk.adb21
1 files changed, 17 insertions, 4 deletions
diff --git a/src/fltk.adb b/src/fltk.adb
index 8591ac2..ad70379 100644
--- a/src/fltk.adb
+++ b/src/fltk.adb
@@ -50,7 +50,7 @@ package body FLTK is
begin
return This : Shortcut_Key do
This.Modifier := Mod_None;
- This.Keypress := Key;
+ This.Keypress := Character'Pos (Key);
end return;
end Shortcut;
@@ -74,7 +74,7 @@ package body FLTK is
begin
return This : Shortcut_Key do
This.Modifier := Left;
- This.Keypress := Right;
+ This.Keypress := Character'Pos (Right);
end return;
end "+";
@@ -96,13 +96,26 @@ package body FLTK is
function Key_To_C
- (Key : Shortcut_Key)
+ (Key : in Shortcut_Key)
return Interfaces.C.unsigned_long is
begin
return Interfaces.C.unsigned_long (Key.Modifier) *
- 65536 + Character'Pos (Key.Keypress);
+ 65536 + Interfaces.C.unsigned_long (Key.Keypress);
end Key_To_C;
+
+
+ function C_To_Key
+ (Key : in Interfaces.C.unsigned_long)
+ return Shortcut_Key is
+ begin
+ return Result : Shortcut_Key do
+ Result.Modifier := Modifier_Key (Key / 65536);
+ Result.Keypress := Interfaces.Unsigned_16 (Key mod 65536);
+ end return;
+ end C_To_Key;
+
+
end FLTK;