Commit Graph

21 Commits

Author SHA1 Message Date
Elias Naur 060ae1cdf9 all: add //go:build lines
They're automatically added by Go 1.17 source formatters. This change
adds them all now.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
2021-07-26 15:17:51 +02:00
pierre e0262c20e3 io/key: add NameSpace, report it on Linux
Fixes gio#204.

Signed-off-by: pierre <pierre.curto@gmail.com>
2021-03-12 13:18:08 +01:00
Elias Naur 002a66f3f3 Revert "app/internal/xkb: fix duplicate edit events for special keys"
This reverts commit e84a2344cf.

The fix is wrong: it's supressing the release key.Event, not key.EditEvents.
The culprit is that Editor fails to ignore release events.

Updates gio#171
2020-11-10 15:27:17 +01:00
Rajiv Kanchan e84a2344cf app/internal/xkb: fix duplicate edit events for special keys
Edit events were being sent twice, once upon key press and again on key release for special keys such as Enter, Arrow keys etc, which resulted in duplicate inputs while pressing these keys. key.EditEvents for special keys now fire once on key press only.

Signed-off-by: Rajiv Kanchan <rajiivkanchan@gmail.com>
2020-11-09 11:00:52 +01:00
Josiah Niedrauer 42e568775c io/key: implement key.Release state
Implement key state for the following platforms:
js, wayland, windows, x11.

Unsupported platforms will continue to function as before, sending
key.Press for all key events.

Signed-off-by: Josiah Niedrauer <josiah@niedrauer.com>
2020-11-01 17:13:00 +01:00
aarzilli 4821472ea1 app/internal/xkb: fix events sent when modifier keys are pressed
When modifier keys are active DispatchKey should not send a
key.EditEvent for the key that was pressed. For example when pressing
Ctrl+Alt+e DispatchEvent should not generate a key.EditEvent{Text:"e"}.

Signed-off-by: aarzilli <alessandro.arzilli@gmail.com>
2020-08-25 12:43:53 +02:00
Elias Naur 4bf043eb5b app/internal/window,app/internal/xkb: silence string(int) conversion warnings
Signed-off-by: Elias Naur <mail@eliasnaur.com>
2020-05-31 11:57:45 +02:00
Elias Naur f6dff2fd1c app/internal/window,app/internal/xkb: [Wayland] report modifiers for pointer events
Updates #120

Signed-off-by: Elias Naur <mail@eliasnaur.com>
2020-05-27 16:39:07 +02:00
Elias Naur 38ed6d1569 app/internal: use pkg-config for finding system headers and libraries
I've resisted relying on pkg-config in the hope that hard-coded include and
library paths would suffice. However, apart from having to work around some
distro-specific differences, building with hardcoded include paths fails when
building on a buildroot:

	x86_64-buildroot-linux-gnu-gcc: ERROR: unsafe header/library path used in cross-compilation: '-I/usr/include/wayland'

(see #91)

Andri mentions a workaround (prefixing paths with "="), but that doesn't seem
to work on the BSDs.

Let's see how pkg-config fares. It's an extra dependency, but it promises to keep
us isolated from the varying paths on Linux distrobutions.

Updates #91

Signed-off-by: Elias Naur <mail@eliasnaur.com>
2020-03-23 12:03:38 +01:00
Aaron Bieber fdaf891732 app: Enable building on OpenBSD
Currently the golang.org/x/sys package is missing the Pipe2 call for OpenBSD.
The call exists on OpenBSD, it just isn't exposed.

This diff was tested buy adding the Pipe2 call and setting:

   go mod edit -replace=golang.org/x/sys=/pat/to/modified/sys

Signed-off-by: Aaron Bieber <aaron@bolddaemon.com>
2020-01-24 14:32:54 +01:00
Elias Naur d5424ef7fc app/internal/window: replace X11 input handling with xkb
Unifies Wayland and X11 keyboard handling.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
2019-11-24 19:41:11 +01:00
Elias Naur 5a34b6f2c3 app/internal/xkb: send key.Events for shifted keysyms
Signed-off-by: Elias Naur <mail@eliasnaur.com>
2019-11-22 16:13:38 +01:00
Elias Naur 968669d39e app/internal/xkb: fix cleanup check
Signed-off-by: Elias Naur <mail@eliasnaur.com>
2019-11-22 14:52:33 +01:00
Elias Naur c8d01d99cc app/internal/xkb: translate physical "Backtab" keys to Shift-Tab
Signed-off-by: Elias Naur <mail@eliasnaur.com>
2019-11-09 15:55:03 +01:00
Elias Naur dca25a7708 app/internal/window: map "Backtab" to Shift-Tab
Updates gio#62

Signed-off-by: Elias Naur <mail@eliasnaur.com>
2019-11-09 15:47:06 +01:00
Elias Naur de7d6b28fa io/key: add support for the Tab and Space keys
Fixes gio#62

Signed-off-by: Elias Naur <mail@eliasnaur.com>
2019-11-09 11:57:36 +01:00
Elias Naur cc43588aba io/key: switch Event.Name to be a string and add function keys
Function keys don't have a natural rune representation so switch
Event.Name to be a string to fit "F1"-"F12".

Fixes gio#59

Signed-off-by: Elias Naur <mail@eliasnaur.com>
2019-11-08 22:20:17 +01:00
Elias Naur c833c98fd7 io/key: add ModAlt, ModSuper
Signed-off-by: Elias Naur <mail@eliasnaur.com>
2019-11-08 18:39:21 +01:00
Elias Naur d293dfe604 key: add ModCtrl, ModShortcut
ModCtrl is the physical Ctrl key, ModShortcut is the virtual
"shortcut" modifier, which is Ctrl on most platforms, Command on
Apple platforms.

Updates #59

Signed-off-by: Elias Naur <mail@eliasnaur.com>
2019-11-08 18:02:26 +01:00
Elias Naur 3425b25ecc app/internal: add FreeBSD support
Signed-off-by: Elias Naur <mail@eliasnaur.com>
2019-10-30 14:01:02 +01:00
Elias Naur 52fedc27a2 app/internal/xkb: extra XKB interface to internal package
Signed-off-by: Elias Naur <mail@eliasnaur.com>
2019-10-14 11:50:44 +02:00