asticode/go-astilectron

On-screen keyboard trigger on Linux

maddie opened this issue · 4 comments

I'm trying to make an application that shows a control panel with some input boxes, running on a Raspberry Pi 4B with a touch screen.

I've configured Raspbian with onboard as its on-screen keyboard, and configured it to pop up automatically when the focus is on text input. However, the application built with go-astilectron doesn't trigger that popup event on input fields, and it seems to be an existing problem for Electron for a long time.

There is a (fork?) electron that utilizes the D-Bus to notify onboard to show up, as shown here, but I don't have any idea of how can I integrate this into go-astilectron.

I have an idea to workaround this problem: attach a listener on input fields on the page, when it focuses an event is fired back to the go backend, and the go backend can handle the D-Bus event trigger.

So my question is, is there a supported way of doing this (pop up the virtual keyboard/send D-Bus event/executing command)? If not, is the workaround possible to implement?

Thanks!

Also, I've encountered this problem:

loader.js?v=${version}:28 Uncaught Error: Check dependency list! Synchronous require cannot resolve module 'electron'. This is the first mention of this module!
    at s.synchronousRequire (loader.js?v=${version}:28)
    at s (loader.js?v=${version}:34)
    at <anonymous>:1:23
    at WebFrame.e.startsWith.e.startsWith.WebFrame.<computed> [as _executeJavaScript] (electron/js2c/renderer_init.js:87)
    at electron/js2c/renderer_init.js:115
    at electron/js2c/renderer_init.js:99
    at EventEmitter.<anonymous> (electron/js2c/renderer_init.js:103)
    at EventEmitter.emit (events.js:315)
    at Object.onMessage (electron/js2c/renderer_init.js:91)

What could be the problem here?

I think your only option is the workaround. You could do it like this:

  1. Attach a listener to input fields on the page that sends a message to GO
  2. In GO, process your message and execute dbus-send directly from GO

Does this sound more clear? If not I'll try to get into more details.

Also, I've encountered this problem

Does this sound like a solution?

That fixes it, and the workaround works fine!

Thanks!