Key.Shortcut is a new property that returns a string describing the key of a keyboard event with all its modifiers.

[GB.GTK]
* NEW: Key.Shortcut is a new property that returns a string describing the key of a keyboard event with all its modifiers.

[GB.GTK3]
* NEW: Key.Shortcut is a new property that returns a string describing the key of a keyboard event with all its modifiers.

[GB.QT4]
* NEW: Key.Shortcut is a new property that returns a string describing the key of a keyboard event with all its modifiers.

[GB.QT5]
* NEW: Key.Shortcut is a new property that returns a string describing the key of a keyboard event with all its modifiers.
This commit is contained in:
gambas 2021-08-24 01:54:41 +02:00
parent d550cdb246
commit a89f827a39
2 changed files with 39 additions and 1 deletions

View file

@ -104,6 +104,23 @@ BEGIN_PROPERTY(Key_Normal)
END_PROPERTY
BEGIN_PROPERTY(Key_Shortcut)
static GB_FUNCTION func;
static bool init = FALSE;
if (!init)
{
init = TRUE;
GB.GetFunction(&func, (void *)GB.FindClass("Shortcut"), "FromKey", NULL, "s");
}
if (GB_FUNCTION_IS_VALID(&func))
GB.Call(&func, 0, FALSE);
else
GB.ReturnNull();
END_PROPERTY
GB_DESC CKeyDesc[] =
{
@ -180,6 +197,8 @@ GB_DESC CKeyDesc[] =
GB_STATIC_PROPERTY_READ("Meta", "b", Key_Meta),
GB_STATIC_PROPERTY_READ("Normal", "b", Key_Normal),
GB_STATIC_PROPERTY_READ("Shortcut", "s", Key_Shortcut),
GB_END_DECLARE
};

View file

@ -140,6 +140,23 @@ BEGIN_PROPERTY(Key_Normal)
END_PROPERTY
BEGIN_PROPERTY(Key_Shortcut)
static GB_FUNCTION func;
static bool init = FALSE;
if (!init)
{
init = TRUE;
GB.GetFunction(&func, (void *)GB.FindClass("Shortcut"), "FromKey", NULL, "s");
}
if (GB_FUNCTION_IS_VALID(&func))
GB.Call(&func, 0, FALSE);
else
GB.ReturnNull();
END_PROPERTY
GB_DESC CKeyDesc[] =
{
@ -216,7 +233,9 @@ GB_DESC CKeyDesc[] =
GB_STATIC_PROPERTY_READ("Alt", "b", Key_Alt),
GB_STATIC_PROPERTY_READ("Meta", "b", Key_Meta),
GB_STATIC_PROPERTY_READ("Normal", "b", Key_Normal),
GB_STATIC_PROPERTY_READ("Shortcut", "s", Key_Shortcut),
GB_END_DECLARE
};