Coder Social home page Coder Social logo

Comments (8)

dobey avatar dobey commented on September 19, 2024

What keyboard are you trying to use, exactly?

from framework.

Langstonius avatar Langstonius commented on September 19, 2024

I am attempting to use the Maliit-2 keyboard via DBUS.

from framework.

jpetersen avatar jpetersen commented on September 19, 2024

I do not really understand what you really want to achieve, there might be a better way.

DBus is used to communicate between Maliit keyboard and the application input context. For the specific error message, the input context need to register such an object on the DBus. See

https://github.com/maliit/framework/blob/master/connection/dbusserverconnection.cpp#L93

from framework.

dobey avatar dobey commented on September 19, 2024

I am attempting to use the Maliit-2 keyboard via DBUS.

https://github.com/maliit/keyboard ?

Can you be more specific about how you are running things. Are you using a Qt application as the client? Gtk3? What?

The DBus interface works very well, and is used in Ubuntu Touch.

from framework.

Langstonius avatar Langstonius commented on September 19, 2024
  1. Really appreciate you working with me here.

Back on topic.
I have an application that runs on a tablet. i wish to replace the existing keyboard with the maliit-2 keyboard.
It was decided that we would utilize dbus to control the keyboard, specifically to adjust its position and to set the current language. One of the reasons it was chosen was because of its language support.

The application is a Qt application, qml to be specific. I am currently attempting to get everything working before I move to the tablet device for additional dev.

Currently, I have a class that opens the dbus connection, gets the address and connects to maliit-server. I am able to do things like setpreedit text for example. However, when I attempt make calls to the keyboard for example to set the current language, i get the aforementioned error message.

I will take a look at that code snippet now, thank you for that JPeterson.

-Langston Ball

from framework.

Langstonius avatar Langstonius commented on September 19, 2024

Unfortunately it seems im a bit dense and am still struggling with this.

 QSharedPointer<Maliit::InputContext::DBus::Address> address;
    QByteArray maliitServerAddress = qgetenv("MALIIT_SERVER_ADDRESS");
    if (!maliitServerAddress.isEmpty()) {
        address.reset(new Maliit::InputContext::DBus::FixedAddress(maliitServerAddress.constData()));
    } else {
        address.reset(new Maliit::InputContext::DBus::DynamicAddress);
    }
    connect(address.data(), SIGNAL(addressReceived(QString)), this, SLOT(setupKeyboard(QString)));
    m_dbusServerConn = new DBusServerConnection(address);

The above code works to allow me to communicate with the server from inside my application.
This snippet from the 'setupKeyboard' function is what I thought I would use to connect to the keyboard instance itself

  QDBusConnection lcl = QDBusConnection::connectToPeer(addr, "Maliit::IMServerConnection");
    m_keyboardInterface = new MaliitKeyboardInterface(
                QString(),
                "/com/meego/inputmethod/inputcontext",
                lcl  );

Unfortunately, the following seems to not connect to the keyboard which i am trying to do for 2 main reasons:

  • allow the user to change language
  • be able to know when they keyboard is shown and its geometry so that i can adjust my application to make space for the keyboard.

Thanks for any insights you can provide.
-Langston Ball

from framework.

dobey avatar dobey commented on September 19, 2024
  • allow the user to change language

I don't think this can be done via DBus with the new keyboard. Instead it should be done by setting the active language key in GSettings. There is also another key there to be set for which languages are enabled, and there is a menu in the keyboard which shows this list, as well as a Settings… entry, which normally would take one to the settings panel in the system settings of Plasma Mobile or Lomiri (there is no generic settings UI, and other environments aren't really supported so well yet).

  • be able to know when they keyboard is shown and its geometry so that i can adjust my application to make space for the keyboard.

Given your app is QML, you can simply use Qt.inputMethod.keyboardRectangle values to adjust your app's size/anchors:
https://doc.qt.io/qt-5/qml-qtqml-qt.html#inputMethod-prop
https://doc.qt.io/qt-5/qinputmethod.html#keyboardRectangle-prop

from framework.

Langstonius avatar Langstonius commented on September 19, 2024

Thanks, that's what I searching for!

from framework.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.