Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Utilities
Konsole
Commits
2f3d5f3b
Commit
2f3d5f3b
authored
Oct 03, 2020
by
Martin Tobias Holmedahl Sandsmark
Committed by
Kurt Hindenburg
Oct 06, 2020
Browse files
Make sure the keypress event doesn't "leak" if handled
parent
ab837e9c
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/filterHotSpots/FilterChain.cpp
View file @
2f3d5f3b
...
...
@@ -178,7 +178,7 @@ static int ascii_to_int(int c) {
return
c
-
'0'
;
}
void
FilterChain
::
keyPressEvent
(
TerminalDisplay
*
td
,
QKeyEvent
*
ev
,
int
charLine
,
int
charColumn
)
bool
FilterChain
::
keyPressEvent
(
TerminalDisplay
*
td
,
QKeyEvent
*
ev
,
int
charLine
,
int
charColumn
)
{
if
((
_urlHintsModifiers
!=
0u
)
&&
ev
->
modifiers
()
==
_urlHintsModifiers
)
{
QList
<
QSharedPointer
<
HotSpot
>>
hotspots
=
filterBy
(
HotSpot
::
Link
);
...
...
@@ -193,7 +193,7 @@ void FilterChain::keyPressEvent(TerminalDisplay *td, QKeyEvent *ev, int charLine
hotspots
.
at
(
hintSelected
)
->
activate
();
_showUrlHint
=
false
;
td
->
update
();
return
;
return
true
;
}
if
(
!
_showUrlHint
)
{
...
...
@@ -207,6 +207,7 @@ void FilterChain::keyPressEvent(TerminalDisplay *td, QKeyEvent *ev, int charLine
if
(
spot
)
{
spot
->
keyPressEvent
(
td
,
ev
);
}
return
false
;
}
void
FilterChain
::
mouseMoveEvent
(
TerminalDisplay
*
td
,
QMouseEvent
*
ev
,
int
charLine
,
int
charColumn
)
...
...
src/filterHotSpots/FilterChain.h
View file @
2f3d5f3b
...
...
@@ -91,7 +91,7 @@ public:
void
mouseMoveEvent
(
TerminalDisplay
*
td
,
QMouseEvent
*
ev
,
int
charLine
,
int
charColumn
);
void
mouseReleaseEvent
(
TerminalDisplay
*
td
,
QMouseEvent
*
ev
,
int
charLine
,
int
charColumn
);
void
keyPressEvent
(
TerminalDisplay
*
td
,
QKeyEvent
*
ev
,
int
charLine
,
int
charColumn
);
bool
keyPressEvent
(
TerminalDisplay
*
td
,
QKeyEvent
*
ev
,
int
charLine
,
int
charColumn
);
void
keyReleaseEvent
(
TerminalDisplay
*
td
,
QKeyEvent
*
ev
,
int
charLine
,
int
charColumn
);
void
leaveEvent
(
TerminalDisplay
*
td
,
QEvent
*
ev
);
...
...
src/widgets/TerminalDisplay.cpp
View file @
2f3d5f3b
...
...
@@ -3494,7 +3494,11 @@ void TerminalDisplay::keyPressEvent(QKeyEvent* event)
int
charLine
;
int
charColumn
;
getCharacterPosition
(
mapFromGlobal
(
QCursor
::
pos
()),
charLine
,
charColumn
,
!
_usesMouseTracking
);
_filterChain
->
keyPressEvent
(
this
,
event
,
charLine
,
charColumn
);
// Don't process it if the filterchain handled it for us
if
(
_filterChain
->
keyPressEvent
(
this
,
event
,
charLine
,
charColumn
))
{
return
;
}
}
if
(
!
_peekPrimaryShortcut
.
isEmpty
()
&&
_peekPrimaryShortcut
.
matches
(
QKeySequence
(
event
->
key
()
|
event
->
modifiers
())))
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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