0

I want to make something akin to virtual keyboard, capable of sending virtual keypress of a full keyboard including the modifiers and function keys, but I have never done anything similar to this so I don't even know how the input stack works or how to start googling for this to begin with.

I have heard of libinput, but I don't understand how it would be related to what I want to do; is there anything like a ready-made text utility or something that can trigger a keypress?

EDIT

After a little more digging, I think what I am looking for is triggering scancode or keycode. Just need a decent generic library to do that.

4
  • Could you give an example of a possible use case? Commented Apr 4, 2021 at 16:45
  • @Pourko, basically an on-screen keyboard to click/tap on. Commented Apr 4, 2021 at 16:57
  • Oh, so you're talking about a full-blown graphical interface? I am out of here. Commented Apr 4, 2021 at 17:01
  • @Pourko, I just need some library that can send keypress signals. Whatever you have on mind, please shoot. Commented Apr 4, 2021 at 17:02

1 Answer 1

0

Take a look at wtype. It's similar to xdotool but for Wayland.

https://github.com/atx/wtype

It basically uses the Wayland client together with virtual-keyboard :

Virtual keyboard

The virtual keyboard provides an application with requests which emulate the behaviour of a physical keyboard.

This interface can be used by clients on its own to provide raw input events, or it can accompany the input method protocol.

Note that this does not currently work on Gnome due to this bug

1
  • wtype does not work anymore on wayland, dues to incompatibility with the virtual keyboard. Commented Jul 26, 2024 at 21:36

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.