Qt 4.8
Public Functions | List of all members
QWSServer::KeyboardFilter Class Referenceabstract

The KeyboardFilter class is a base class for global keyboard event filters in Qt for Embedded Linux. More...

#include <qwindowsystem_qws.h>

Public Functions

virtual bool filter (int unicode, int keycode, int modifiers, bool isPress, bool autoRepeat)=0
 Implement this function to return true if a given key event should be stopped from being processed any further; otherwise it should return false. More...
 
virtual ~KeyboardFilter ()
 Destroys the keyboard filter. More...
 

Detailed Description

The KeyboardFilter class is a base class for global keyboard event filters in Qt for Embedded Linux.

Note that this class is only available in Qt for Embedded Linux.

In Qt for Embedded Linux, all system generated events, including keyboard events, are passed to the server application which then propagates the event to the appropriate client. The KeyboardFilter class is used to implement a global, low-level filter on the server side. The server applies the filter to all keyboard events before passing them on to the clients:

qwsserver_keyboardfilter.png

This feature can, for example, be used to filter things like APM (advanced power management) suspended from a button without having to filter for it in all applications.

To add a new keyboard filter you must first create the filter by deriving from this class, reimplementing the pure virtual filter() function. Then you can install the filter on the server using QWSServer's QWSServer::addKeyboardFilter() function. QWSServer also provides a QWSServer::removeKeyboardFilter() function.

See also
{Qt for Embedded Linux Architecture}, QWSServer, QWSInputMethod

Definition at line 246 of file qwindowsystem_qws.h.

Constructors and Destructors

◆ ~KeyboardFilter()

QWSServer::KeyboardFilter::~KeyboardFilter ( )
inlinevirtual

Destroys the keyboard filter.

Definition at line 249 of file qwindowsystem_qws.h.

249 {}

Functions

◆ filter()

bool QWSServer::KeyboardFilter::filter ( int  unicode,
int  keycode,
int  modifiers,
bool  isPress,
bool  autoRepeat 
)
pure virtual

Implement this function to return true if a given key event should be stopped from being processed any further; otherwise it should return false.

A key event can be identified by the given unicode value and the keycode, modifiers, isPress and autoRepeat parameters.

The keycode parameter is the Qt keycode value as defined by the Qt::Key enum. The modifiers is an OR combination of Qt::KeyboardModifier values, indicating whether Shift/Alt/Ctrl keys are pressed. The isPress parameter is true if the event is a key press event and autoRepeat is true if the event is caused by an auto-repeat mechanism and not an actual key press.

Referenced by QWSServer::processKeyEvent().


The documentation for this class was generated from the following files: