44 #ifndef QT_NO_QWS_DIRECTFB 85 void readKeyboardData();
89 :
handler(h), eventBuffer(0), keyboardNotifier(0), bytesRead(0),
90 lastUnicode(0), lastKeycode(0), lastModifiers(0)
96 qCritical(
"QDirectFBKeyboardHandler: DirectFB not initialized");
101 result = fb->CreateInputEventBuffer(fb, DICAPS_KEYS, DFB_TRUE,
103 if (result != DFB_OK) {
104 DirectFBError(
"QDirectFBKeyboardHandler: " 105 "Unable to create input event buffer", result);
111 if (result != DFB_OK) {
112 DirectFBError(
"QDirectFBKeyboardHandler: " 113 "Unable to create file descriptor", result);
117 int flags =
::fcntl(fd, F_GETFL, 0);
118 ::fcntl(fd, F_SETFL, flags | O_NONBLOCK);
156 char *buf =
reinterpret_cast<char*
>(&
event);
158 buf +
bytesRead,
sizeof(DFBEvent) - bytesRead);
161 qWarning(
"QDirectFBKeyboardHandlerPrivate::readKeyboardData(): %s",
168 if (bytesRead <
int(
sizeof(DFBEvent)))
174 const DFBInputEvent input =
event.input;
182 if (!(input.flags & DIEF_KEYSYMBOL) ||
183 !(input.flags & DIEF_KEYID) ||
184 !(input.type & (DIET_KEYPRESS|DIET_KEYRELEASE)))
186 static bool first =
true;
188 qWarning(
"QDirectFBKeyboardHandler - Getting unexpected non-keyboard related events");
194 if (input.flags & DIEF_MODIFIERS) {
195 if (input.modifiers & DIMM_SHIFT)
197 if (input.modifiers & DIMM_CONTROL)
199 if (input.modifiers & DIMM_ALT)
201 if (input.modifiers & DIMM_ALTGR)
203 if (input.modifiers & DIMM_META)
208 const bool press = input.type & DIET_KEYPRESS;
209 DFBInputDeviceKeySymbol symbol = input.key_symbol;
213 keycode = keymap()->value(symbol);
214 if (DFB_KEY_TYPE(symbol) == DIKT_UNICODE)
217 if (unicode != -1 || keycode != 0) {
218 bool autoRepeat =
false;
233 modifiers,
false, autoRepeat);
238 modifiers, press, autoRepeat);
435 #include "qdirectfbkeyboard.moc" 436 #endif // QT_NO_QWS_DIRECTFB
Q_GUI_EXPORT QScreen * qt_screen
The QWSKeyboardHandler class is a base class for keyboard drivers in Qt for Embedded Linux...
#define QT_END_NAMESPACE
This macro expands to.
The QString class provides a Unicode character string.
The QHash class is a template class that provides a hash-table-based dictionary.
The QObject class is the base class of all Qt objects.
The QSocketNotifier class provides support for monitoring activity on a file descriptor.
QDirectFBKeyboardHandlerPrivate * d
#define QT_BEGIN_NAMESPACE
This macro expands to.
~QDirectFBKeyboardHandler()
static bool connect(const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
Creates a connection of the given type from the signal in the sender object to the method in the rece...
Qt::KeyboardModifiers lastModifiers
Q_CORE_EXPORT void qWarning(const char *,...)
QDirectFBKeyboardHandler * handler
~QDirectFBKeyboardHandlerPrivate()
Q_GLOBAL_STATIC(KeyMap, keymap)
QDirectFBKeyboardHandlerPrivate(QDirectFBKeyboardHandler *handler)
void setEnabled(bool)
If enable is true, the notifier is enabled; otherwise the notifier is disabled.
static QDirectFBScreen * instance()
QSocketNotifier * keyboardNotifier
virtual void processKeyEvent(int unicode, int keycode, Qt::KeyboardModifiers modifiers, bool isPress, bool autoRepeat)
Sends a key event to the Qt for Embedded Linux server application.
QImageIOHandler * handler
IDirectFBEventBuffer * eventBuffer
#define Q_UNUSED(x)
Indicates to the compiler that the parameter with the specified name is not used in the body of a fun...
Q_CORE_EXPORT void qCritical(const char *,...)
int socket() const
Returns the socket identifier specified to the constructor.
QDirectFBKeyboardHandler(const QString &device)