summaryrefslogtreecommitdiff
path: root/src/fltk.adb
diff options
context:
space:
mode:
authorJed Barber <jjbarber@y7mail.com>2017-05-22 20:27:55 +1000
committerJed Barber <jjbarber@y7mail.com>2017-05-22 20:27:55 +1000
commitbc87503ae6879d76c579828f2f90de0383239373 (patch)
treef55947488a437a06eeb4bc404bf10dfdb936cc03 /src/fltk.adb
parenta466cb205885576087f40df28dd0680d66aebbc9 (diff)
Moved FLTK.Enums to FLTK
Diffstat (limited to 'src/fltk.adb')
-rw-r--r--src/fltk.adb64
1 files changed, 64 insertions, 0 deletions
diff --git a/src/fltk.adb b/src/fltk.adb
index 983f308..8591ac2 100644
--- a/src/fltk.adb
+++ b/src/fltk.adb
@@ -3,6 +3,7 @@
with Interfaces.C;
with System;
use type System.Address;
+use type Interfaces.C.unsigned_long;
package body FLTK is
@@ -40,5 +41,68 @@ package body FLTK is
end Initialize;
+
+
+
+ function Shortcut
+ (Key : Pressable_Key)
+ return Shortcut_Key is
+ begin
+ return This : Shortcut_Key do
+ This.Modifier := Mod_None;
+ This.Keypress := Key;
+ end return;
+ end Shortcut;
+
+
+
+
+ function "+"
+ (Left, Right : in Modifier_Key)
+ return Modifier_Key is
+ begin
+ return Left or Right;
+ end "+";
+
+
+
+
+ function "+"
+ (Left : in Modifier_Key;
+ Right : in Pressable_Key)
+ return Shortcut_Key is
+ begin
+ return This : Shortcut_Key do
+ This.Modifier := Left;
+ This.Keypress := Right;
+ end return;
+ end "+";
+
+
+
+
+ function "+"
+ (Left : in Modifier_Key;
+ Right : in Shortcut_Key)
+ return Shortcut_Key is
+ begin
+ return This : Shortcut_Key do
+ This.Modifier := Left or Right.Modifier;
+ This.Keypress := Right.Keypress;
+ end return;
+ end "+";
+
+
+
+
+ function Key_To_C
+ (Key : Shortcut_Key)
+ return Interfaces.C.unsigned_long is
+ begin
+ return Interfaces.C.unsigned_long (Key.Modifier) *
+ 65536 + Character'Pos (Key.Keypress);
+ end Key_To_C;
+
+
end FLTK;