Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-113387

API to construct a proper key event for a specific key/character

    XMLWordPrintable

Details

    • 1652687d3 (dev), 11456b4d5 (6.6), 2aebbfc9f (tqtc/lts-6.2), 5df751774 (6.5), c0d108b50 (dev)

    Description

      QWaylandSeat::sendFullKeyEvent can be used to send key event, but it has a big caveat with sending keys that need modifiers. To send such a key event, one has to know what is the base key that must be pressed together with the modifier to produce it, which requires knowing the current keyboard layout in use.

      For example to send (, one has to send Key_9 with ShiftModifier on english layout, but on other layouts it could be something different, for example 8+shift on finnish layout.

      Perhaps a new function could be added for constructing a QKeyEvent for the desired key or perhaps even for a unicode codepoint (or separetely for both, there are special keys like print screen).

      I suspect this function should also be allowed to fail as all keys are not available in all layouts. Maybe it could return QKeyEvent* or in a smart pointer.

      Attachments

        Issue Links

          For Gerrit Dashboard: QTBUG-113387
          # Subject Branch Project Status CR V

          Activity

            People

              inho Inho Lee
              poikelin Joni Poikelin
              Votes:
              1 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes