8000 Handling KeyPress Event? · Issue #47 · mkottman/lqt · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Handling KeyPress Event? #47
Open
Open
@dmattp

Description

@dmattp

I'm not sure if this is a problem or it is just not clear to me how to do this. I'm trying to handle some keypresses to a QListWidget, but the problem I have is:

  1. Installing a virtual handler for keyPressEvent() “works”, but I can’t find a way to pass unhandled keypresses to or invoke the original (not-overridden) keyPressEvent function. That means I would have to duplicate the functionality of responding to all keys in lua. Is there a way to call QListWidget's original QListWidget::keyPressEvent() function from the widget:keyPressEvent() function that I add in lua?
  2. Alternatively, I can install an event filter and return false to indicate I didn’t handle the event which allows the original key press handler to maintain existing behavior- but the QEvent doesn’t seem to be modeled like other QT objects and I can’t figure out how to "cast" it to an actual keypress event, which seems to be the suggested method under C++. (eventFilter just gets a QEvent object, which under C++ has to be cast to the specific event type [QKeyEvent in this case] based on the event→type() function. ev:type() returns a string that says “KeyPress”, but how can I cast the event to an actual QKeyEvent in lua?

Any ideas? Is this possible already or are these functions not implemented yet?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0