Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for International (AZERTY, etc.) keyboard layouts #9

Open
danisla opened this issue Jan 18, 2022 · 13 comments
Open

Support for International (AZERTY, etc.) keyboard layouts #9

danisla opened this issue Jan 18, 2022 · 13 comments
Labels
enhancement New feature or request help wanted External contribution is required transport Underlying media or data transport protocols web Web components including gst-web

Comments

@danisla
Copy link
Member

danisla commented Jan 18, 2022

Add support for AZERTY (French) keyboard layout.

Addenum by @ehfd: Read #9 (comment) for the required interventions to fix this problem in general.

@danisla danisla added enhancement New feature or request help wanted External contribution is required labels Jan 18, 2022
@ehfd
Copy link
Member

ehfd commented Feb 3, 2022

See: novnc/noVNC#1578

May be useful: Xpra-org/xpra-html5#48 Xpra-org/xpra-html5#15

Relevant code: https://github.com/selkies-project/selkies-gstreamer/blob/master/src/selkies_gstreamer/webrtc_input.py

Would be relatively trivial if code is borrowed over from noVNC or Guacamole.

@ehfd ehfd added the web Web components including gst-web label Oct 12, 2022
@ehfd ehfd added the transport Underlying media or data transport protocols label Jan 18, 2023
@andymaier
Copy link

Is there a chance to have also support for QWERTZ Layout?

I getting this when try to use an "@" on QWERTZ Layout:

(xfce4-terminal:323): dbind-WARNING **: 00:57:13.907: AT-SPI: Error retrieving accessibility bus address: org.freedesktop.DBus.Error.ServiceUnknown: The name org.a11y.Bus was not provided by any .service files Traceback (most recent call last): File "/usr/local/lib/python3.10/dist-packages/selkies_gstreamer/gstwebrtc_app.py", line 1007, in <lambda> 'on-message-string', lambda _, msg: self.on_data_message(msg)) File "/usr/local/lib/python3.10/dist-packages/selkies_gstreamer/webrtc_input.py", line 533, in on_message self.send_x11_keypress(int(toks[1]), down=True) File "/usr/local/lib/python3.10/dist-packages/selkies_gstreamer/webrtc_input.py", line 321, in send_x11_keypress self.keyboard.press(keycode) File "/usr/local/lib/python3.10/dist-packages/pynput/keyboard/_base.py", line 392, in press self._handle(resolved, True) File "/usr/local/lib/python3.10/dist-packages/pynput/keyboard/_xorg.py", line 242, in _handle with display_manager(self._display) as dm: File "/usr/lib/python3.10/contextlib.py", line 142, in __exit__ next(self.gen) File "/usr/local/lib/python3.10/dist-packages/pynput/_util/xorg.py", line 78, in display_manager display.sync() File "/usr/local/lib/python3.10/dist-packages/Xlib/display.py", line 182, in sync self.get_pointer_control() File "/usr/local/lib/python3.10/dist-packages/Xlib/display.py", line 833, in get_pointer_control return request.GetPointerControl(display = self.display) File "/usr/local/lib/python3.10/dist-packages/Xlib/protocol/rq.py", line 1368, in __init__ self.reply() File "/usr/local/lib/python3.10/dist-packages/Xlib/protocol/rq.py", line 1380, in reply self._display.send_and_recv(request = self._serial) File "/usr/local/lib/python3.10/dist-packages/Xlib/protocol/display.py", line 612, in send_and_recv gotreq = self.parse_response(request) File "/usr/local/lib/python3.10/dist-packages/Xlib/protocol/display.py", line 719, in parse_response gotreq = self.parse_error_response(request) or gotreq File "/usr/local/lib/python3.10/dist-packages/Xlib/protocol/display.py", line 745, in parse_error_response req = self.get_waiting_request(e.sequence_number) AttributeError: 'BadRRModeError' object has no attribute 'sequence_number'

@ehfd
Copy link
Member

ehfd commented Sep 5, 2023

Revamping of the Javascript libraries are necessary, especially vuetify and guacamole-keyboard.

@andymaier
Copy link

hello guys, is there any news on that topic? I am looking forward for this. I am able to help?
regards

@danisla
Copy link
Member Author

danisla commented Sep 13, 2023

I have no near term plans to work on this feature. It sounds like there may be some blocking browser related issues.

If you have time and would like to work on it then I would be happy to review a PR and test.

@ehfd
Copy link
Member

ehfd commented Mar 24, 2024

Connected to #84

@ehfd ehfd added the high-priority Must be addressed as soon as possible, remove when resolved label May 1, 2024
@ehfd ehfd changed the title Support for AZERTY keyboard layouts Support for International (AZERTY, etc.) keyboard layouts May 1, 2024
@ehfd ehfd removed the high-priority Must be addressed as soon as possible, remove when resolved label May 5, 2024
@ehfd
Copy link
Member

ehfd commented May 5, 2024

AttributeError: 'BadRRModeError' object has no attribute 'sequence_number'

This error itself should be fixed in v1.6.0 with #84. AZERTY and QWERTZ might even work. Insufficient.

About supporting arbitrary keyboard symbols, this will take some more time.

@ehfd
Copy link
Member

ehfd commented May 5, 2024

image

@cruizba We're still in progress of porting the .so to ctypes, and we've stumbled on this error where the keycode is mapped outside of accepted bounds. It happens with the .so file method. Do you have any thoughts about this?

From @m1k1o: that could happen if you map too many keysyms that are not mapped to any keycode, and we don't have any more keycodes left. obvious solution is to get number of free keycodes at the beginning and create circular linked list, so that they are overwritten as needed.

@ehfd
Copy link
Member

ehfd commented Feb 18, 2025

https://w3c.github.io/uievents/tools/key-event-viewer.html

To see if this might be a browser-side issue.

@ehfd
Copy link
Member

ehfd commented Feb 19, 2025

Leaving this here as it is very relevant to solving the issues: #85 (comment)

@m1k1o
Copy link

m1k1o commented Feb 19, 2025

Also this might be relevant, where I explained my findings when looking into this issue for neko: m1k1o/neko#45 (comment)

@ehfd
Copy link
Member

ehfd commented Feb 19, 2025

Oh, thanks. @m1k1o I'll leave the fix (m1k1o/neko#46) here too.

@ehfd
Copy link
Member

ehfd commented Feb 19, 2025

xkb-implementation.tar.gz

The above file contains the developments made by @PMohanJ some time ago to replicate #85 (comment) in pure Python or Cython (ctypes). The ones with _24xxxx at the end are older revisions, and ones without such suffixes are the most recent files. Files starting withpy-xlib is the effort towards a pure Python implementation and files starting with xkb-ctypes is the effort towards a Cython implementation. Text files contain relevant segfaults (to xkb-ctypes) or basic guides.

The fundamental task would be to implement main...cruizba:selkies-gstreamer:fix-inputs (https://github.com/cruizba/selkies-gstreamer/tree/fix-inputs / #85 (comment)) in pure Python or Cython (ctypes), because I do not intend to approve bundling a shared object library to an otherwise pure Python server codebase.

However, Cython has been observed to exhibit various segfaults.
If going to the pure Python direction, we are currently relying on a fork located in https://github.com/selkies-project/python-xlib, so we have the liberty to add or modify as much of the code there as needed, and cherry-pick PRs (https://github.com/python-xlib/python-xlib/pulls) as necessary.

This will ultimately remove the dependency for pynput.

Moreover, it would also be most useful to solve #9 (comment) by implementing a circular linked list for the keysym-keycode dictionary in order to purge old keycodes to make way for new ones.

m1k1o/neko#45 (comment) and m1k1o/neko#46 has also been provided for additional context and information.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted External contribution is required transport Underlying media or data transport protocols web Web components including gst-web
Projects
None yet
Development

No branches or pull requests

4 participants