Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Tobias Hunger
qt-creator
Commits
1f176af9
Commit
1f176af9
authored
Apr 15, 2010
by
hjk
Browse files
fakevim: fix ^ when it is a dead key
parent
02a9a462
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/plugins/fakevim/fakevimhandler.cpp
View file @
1f176af9
...
...
@@ -72,6 +72,7 @@
#include
<QtCore/QStack>
#include
<QtGui/QApplication>
#include
<QtGui/QInputMethodEvent>
#include
<QtGui/QKeyEvent>
#include
<QtGui/QLineEdit>
#include
<QtGui/QPlainTextEdit>
...
...
@@ -3968,6 +3969,21 @@ bool FakeVimHandler::eventFilter(QObject *ob, QEvent *ev)
return
false
;
}
if
(
active
&&
ev
->
type
()
==
QEvent
::
InputMethod
&&
ob
==
d
->
editor
())
{
// This handles simple dead keys. The sequence of events is
// KeyRelease-InputMethod-KeyRelease for dead keys instead of
// KeyPress-KeyRelease as for simple keys. As vi acts on key presses,
// we have to act on the InputMethod event.
// FIXME: A first approximation working for e.g. ^ on a German keyboard
QInputMethodEvent
*
imev
=
static_cast
<
QInputMethodEvent
*>
(
ev
);
KEY_DEBUG
(
"INPUTMETHOD"
<<
imev
->
commitString
()
<<
imev
->
preeditString
());
QString
commitString
=
imev
->
commitString
();
int
key
=
commitString
.
size
()
==
1
?
commitString
.
at
(
0
).
unicode
()
:
0
;
QKeyEvent
kev
(
QEvent
::
KeyPress
,
key
,
Qt
::
KeyboardModifiers
(),
commitString
);
EventResult
res
=
d
->
handleEvent
(
&
kev
);
return
res
==
EventHandled
;
}
if
(
active
&&
ev
->
type
()
==
QEvent
::
KeyPress
&&
ob
==
d
->
editor
())
{
QKeyEvent
*
kev
=
static_cast
<
QKeyEvent
*>
(
ev
);
KEY_DEBUG
(
"KEYPRESS"
<<
kev
->
key
());
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment