Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. [Solved] No Cursor KeyEvent to WebView

[Solved] No Cursor KeyEvent to WebView

Scheduled Pinned Locked Moved General and Desktop
2 Posts 1 Posters 763 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • McLionM Offline
    McLionM Offline
    McLion
    wrote on last edited by
    #1

    Hi

    I am getting key events by an external interface that need to be carried out by a WebView. This works perfect for Key_Tab and Key_Backtab for instance, but not for the Cursor Keys Key_Left/Up/Down/Right.
    I am using the following code and the cursor keys are not accepted.

    @QKeyEvent key(QEvent::KeyPress, datastring.section(' ', 1, 1).toULong(), Qt::NoModifier);
    QApplication::sendEvent(ui->webGUI, &key);
    if (key.isAccepted()) port->write(data);
    @

    What am I doing wrong, or how do I get the WebView to react on the Cursor Keycodes the same it does on the Tab key?

    Thanks
    McL

    1 Reply Last reply
    0
    • McLionM Offline
      McLionM Offline
      McLion
      wrote on last edited by
      #2

      Update:
      I didn't realize that the cursor keys have a KeyRelease event only. So I now always send a KeyPress and a KeyRelease event and it works.

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved