2019-07-10 08:25:15 -07:00
|
|
|
class Efl.Input.Key extends Efl.Object implements Efl.Input.Event, Efl.Input.State
|
2016-05-31 04:08:22 -07:00
|
|
|
{
|
|
|
|
[[Represents a single key event from a keyboard or similar device.
|
2019-10-14 00:55:52 -07:00
|
|
|
|
|
|
|
@since 1.23
|
2016-05-31 04:08:22 -07:00
|
|
|
]]
|
|
|
|
methods {
|
|
|
|
@property pressed {
|
|
|
|
[[$true if the key is down, $false if it is released.]]
|
|
|
|
values {
|
2019-08-05 13:33:52 -07:00
|
|
|
val: bool; [[$true if the key is pressed, $false otherwise.]]
|
2016-05-31 04:08:22 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
@property key_name {
|
2019-08-05 13:33:52 -07:00
|
|
|
[[Name string of the physical key that produced this event.
|
|
|
|
|
|
|
|
This typically matches what is printed on the key. For example, "1"
|
|
|
|
or "a". Note that both "a" and "A" are obtained with the same
|
|
|
|
physical key, so both events will have the same @.key_name "a" but
|
|
|
|
different @.key_sym.
|
|
|
|
|
|
|
|
Commonly used in keyboard remapping menus to uniquely identify a
|
|
|
|
physical key.
|
|
|
|
]]
|
2016-05-31 04:08:22 -07:00
|
|
|
values {
|
2019-08-05 13:33:52 -07:00
|
|
|
val: string; [[Name of the key that produced this event.]]
|
2016-05-31 04:08:22 -07:00
|
|
|
}
|
|
|
|
}
|
efl_input_key: replace key property name with key_sym
Summary:
Sorry to touch stable eo classes. there is name conflict issue between class and
property when binding language is generated from eo. for example in C#, compiler
error occurs.
```
src/bindings/mono/efl_input_key.eo.cs(272,26): error CS0542:
`Efl.Input.Key.Key': member names cannot be the same as their enclosing type
```
This patch changes Efl.Input.Key.GetKey/SetKey method to
Efl.Input.Key.GetKeySym/SetKeySym and generates Efl.Input.Key.KeySym
property.
Note that CAPI is not changed.
ref T8093
Test Plan: meson setup -Dbindings=mono,cxx -Dmono-beta=true
Reviewers: lauromoura, woohyun, zmike, segfaultxavi
Reviewed By: segfaultxavi
Subscribers: bu5hm4n, cedric, #reviewers, #committers
Tags: #efl
Maniphest Tasks: T8093
Differential Revision: https://phab.enlightenment.org/D9483
zmike note: this class was not released at the point of this patch, the class
was only recently marked as stable
2019-08-05 05:48:04 -07:00
|
|
|
@property key_sym {
|
2019-08-05 13:33:52 -07:00
|
|
|
[[Name of the symbol produced by this key event.
|
2016-05-31 04:08:22 -07:00
|
|
|
|
2019-08-05 13:33:52 -07:00
|
|
|
For example, "a", "A", "1" or "exclam". The same physical key can
|
|
|
|
produce different symbols when combined with other keys like "shift"
|
|
|
|
or "alt gr". For example, "a" and "A" have different @.key_sym but
|
|
|
|
the same @.key_name "a".
|
|
|
|
|
|
|
|
This is the field you typically use to uniquely identify a keyboard
|
|
|
|
symbol, in keyboard shortcuts for example.
|
2016-05-31 04:08:22 -07:00
|
|
|
]]
|
|
|
|
values {
|
2019-08-05 13:33:52 -07:00
|
|
|
val: string; [[Symbol name produced by key event.]]
|
2016-05-31 04:08:22 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
@property string {
|
|
|
|
[[A UTF8 string if this keystroke has produced a visible string to be
|
|
|
|
added.
|
|
|
|
]]
|
|
|
|
values {
|
2019-08-05 13:33:52 -07:00
|
|
|
val: string; [[Visible string produced by this key event, in UTF8.]]
|
2016-05-31 04:08:22 -07:00
|
|
|
}
|
|
|
|
}
|
2019-06-20 05:51:55 -07:00
|
|
|
@property compose_string {
|
2016-05-31 04:08:22 -07:00
|
|
|
[[A UTF8 string if this keystroke has modified a string in the middle
|
|
|
|
of being composed.
|
|
|
|
|
2019-08-05 13:33:52 -07:00
|
|
|
Note: This string replaces the previous one.
|
2016-05-31 04:08:22 -07:00
|
|
|
]]
|
|
|
|
values {
|
2019-08-05 13:33:52 -07:00
|
|
|
val: string; [[Composed string in UTF8.]]
|
2016-05-31 04:08:22 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
@property key_code {
|
2019-08-05 13:33:52 -07:00
|
|
|
[[Keyboard scan code of the physical key that produced this event.
|
|
|
|
|
|
|
|
You typically do not need to use this field, because the system maps scan
|
|
|
|
codes to the more convenient @.key_name.
|
|
|
|
Us this in keyboard remapping applications or when trying to use a keyboard
|
|
|
|
unknown to your operating system.
|
|
|
|
]]
|
2016-05-31 04:08:22 -07:00
|
|
|
values {
|
2019-08-05 13:33:52 -07:00
|
|
|
val: int; [[Keyboard scan code.]]
|
2016-05-31 04:08:22 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
implements {
|
2016-06-01 22:36:55 -07:00
|
|
|
class.destructor;
|
2016-08-10 07:23:04 -07:00
|
|
|
Efl.Object.constructor;
|
2016-08-15 22:57:02 -07:00
|
|
|
Efl.Object.destructor;
|
2016-08-25 03:20:10 -07:00
|
|
|
Efl.Input.Event.reset;
|
2017-12-10 21:50:22 -08:00
|
|
|
Efl.Duplicate.duplicate;
|
2017-11-29 03:03:16 -08:00
|
|
|
[[Creates a copy of this event. @Efl.Input.Event.fake is $true.
|
|
|
|
|
|
|
|
The returned event object is similar to the given object in most
|
|
|
|
ways except that @Efl.Input.Event.fake will be $true.
|
|
|
|
|
|
|
|
Note: A reference is given to the caller. In order to avoid leaks
|
|
|
|
the C API users should call $efl_unref() after use.
|
|
|
|
]]
|
2016-12-27 07:37:41 -08:00
|
|
|
Efl.Input.Event.timestamp { get; set; }
|
|
|
|
Efl.Input.Event.fake { get; }
|
|
|
|
Efl.Input.Event.event_flags { get; set; }
|
|
|
|
Efl.Input.Event.device { get; set; }
|
|
|
|
Efl.Input.State.modifier_enabled { get; }
|
|
|
|
Efl.Input.State.lock_enabled { get; }
|
2016-05-31 04:08:22 -07:00
|
|
|
}
|
|
|
|
}
|