Closed daudix closed 1 year ago
But I am open to suggestions
I think the cool thing to do is to dive a layer even lower and go over Wayland's head with a virtual input device? I think it'd be done at the uinput level. Quick look through input.h and some other things, I don't see any way to push through arbitrary text so would still be emulating a keyboard shortcut.
Another way, though, might be ibus? Either by emulating its shortcut with uinput and dialing in a codepoint, or maybe there's a way to communicate to it to ask it what you want directly, it seems to hang out on dbus.
@different55 It would be amazing !!!
I think the cool thing to do is to dive a layer even lower and go over Wayland's head with a virtual input device? I think it'd be done at the uinput level. Quick look through input.h and some other things, I don't see any way to push through arbitrary text so would still be emulating a keyboard shortcut.
Another way, though, might be ibus? Either by emulating its shortcut with uinput and dialing in a codepoint, or maybe there's a way to communicate to it to ask it what you want directly, it seems to hang out on dbus.
I have absolutely no idea what you are talking about π , feel free to open a PR if you have some POC implementation
AFAIK the only possible way to do it is the ibus-typing-booster's way, which shows up as an ibus input method
lol unfortunately that just probably means I have no idea what I'm talking about, but I'll see if I can coerce anything into working.
@different55 do you have any experience with ibus input methods?
None at all from a development perspective, some (very) limited experience from the user's PoV
@different55 I'm analyzing that project.
It looks very interesting and probably the only way to pull it off. Unfortunately, at the moment ibus-typing-booster is barely usable for me: it is trying to do too much, resulting in a base user experience IMO.
Ah that's a shame, but you figure if ibus-typing-booster can get with ibus to get emojis inserted, smile oughta be able to sweet talk ibus the same way itself.
Just a quick glance at the DBus API it exposes pointed me in this direction which seems very promising:
https://valadoc.org/ibus-1.0/IBus.InputContext.html which led to https://ibus.github.io/docs/ibus-1.5/IBusEngine.html
But can check that out more later.
Is there any dev can do this?
there is, but they're not typically summoned and coerced so easily
this kind of stuff, which is completely undocumented, requires a deeper knowledge of the platform, which I don't have ATM (or lot of free time, which is lacking as well)
On second glance, process_key_event()
might be everything we need already. I'm still flying blind on the inner workings of IBus but I do know the Ctrl+Shift+U keyboard shortcut for unicode input is handled by IBus, so assuming it's possible to yell at whatever engine is handling that behind the scenes through process_key_event()
then that oughta be fairly reliable. It'd still technically be a keyboard shortcut, but a highly targeted one.
Only concerns that come to mind w/ this is whether or not the user has configured the shortcut to something else, and how many of the massive assumptions and guesses I'm making might be about to collapse.
Both Ctrl+Shift+U and Ctrl+Shift+E enable some sort of "special characters" mode which allows you to enter emojis and other stuff.
There are both TERRIBLE imo, and should be removed (or at least, give me an option to turn them off).
Why? Because if you hit them accidentally your keyboard stops typing! Seriously, who thought that was a good idea? One day I activated Ctrl+Shift+E
without realizing it and I couldn't understand what was going on. I ended up closing the program I was using because I thought it had crashed or something.
I mean valid complaints lol. They can be turned off, check out the IBus Preferences app, although GNOME has it hidden so check out ibus-setup
. Under the Emoji tab you can reassign or unassign those keyboard shortcuts. But hitting Esc at most a few times or Enter once also dispels them if they're called by accident. I personally have the hotkey set to include Super because Ctrl-y and Shift-y hotkeys are really dominated by applications anyway.
Hopefully though it's possible to ignore all that and somehow call up that functionality directly. I think I'm starting to wrap my head around things finally but still not sure what the best/any way is to actually go about this. Current thoughts: Custom IBus engine, switch to it when dumping an emoji out, switch back after?
OMG thanks
There is nothing I can do about this feature. Any possible solution goes far beyond my skills RN.
this feature is not coming any time soon, unfortunately. Here is why:
Until I find a "clean" way to do it, auto-paste will not be available