Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-gpu
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc-gpu
Commits
a1b21996
Commit
a1b21996
authored
Sep 10, 2006
by
Clément Stenac
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Handle more hotkeys
Prevent the volume slider from stealing the focus
parent
c0354099
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
10 deletions
+32
-10
modules/gui/qt4/main_interface.cpp
modules/gui/qt4/main_interface.cpp
+32
-10
No files found.
modules/gui/qt4/main_interface.cpp
View file @
a1b21996
...
@@ -76,6 +76,8 @@ MainInterface::MainInterface( intf_thread_t *_p_intf ) : QVLCMW( _p_intf )
...
@@ -76,6 +76,8 @@ MainInterface::MainInterface( intf_thread_t *_p_intf ) : QVLCMW( _p_intf )
ui
.
volLowLabel
->
installEventFilter
(
h
);
ui
.
volLowLabel
->
installEventFilter
(
h
);
ui
.
volHighLabel
->
installEventFilter
(
h
);
ui
.
volHighLabel
->
installEventFilter
(
h
);
ui
.
volumeSlider
->
setFocusPolicy
(
Qt
::
NoFocus
);
QVLCMenu
::
createMenuBar
(
menuBar
(),
p_intf
);
QVLCMenu
::
createMenuBar
(
menuBar
(),
p_intf
);
timeLabel
=
new
QLabel
(
0
);
timeLabel
=
new
QLabel
(
0
);
...
@@ -171,6 +173,7 @@ void MainInterface::resizeEvent( QResizeEvent *e )
...
@@ -171,6 +173,7 @@ void MainInterface::resizeEvent( QResizeEvent *e )
void
MainInterface
::
keyPressEvent
(
QKeyEvent
*
e
)
void
MainInterface
::
keyPressEvent
(
QKeyEvent
*
e
)
{
{
int
i_vlck
=
0
;
int
i_vlck
=
0
;
/* Handle modifiers */
if
(
e
->
modifiers
()
&
Qt
::
ShiftModifier
)
i_vlck
|=
KEY_MODIFIER_SHIFT
;
if
(
e
->
modifiers
()
&
Qt
::
ShiftModifier
)
i_vlck
|=
KEY_MODIFIER_SHIFT
;
if
(
e
->
modifiers
()
&
Qt
::
AltModifier
)
i_vlck
|=
KEY_MODIFIER_ALT
;
if
(
e
->
modifiers
()
&
Qt
::
AltModifier
)
i_vlck
|=
KEY_MODIFIER_ALT
;
if
(
e
->
modifiers
()
&
Qt
::
ControlModifier
)
i_vlck
|=
KEY_MODIFIER_CTRL
;
if
(
e
->
modifiers
()
&
Qt
::
ControlModifier
)
i_vlck
|=
KEY_MODIFIER_CTRL
;
...
@@ -179,30 +182,49 @@ void MainInterface::keyPressEvent( QKeyEvent *e )
...
@@ -179,30 +182,49 @@ void MainInterface::keyPressEvent( QKeyEvent *e )
fprintf
(
stderr
,
"After modifiers %x
\n
"
,
i_vlck
);
fprintf
(
stderr
,
"After modifiers %x
\n
"
,
i_vlck
);
bool
found
=
false
;
bool
found
=
false
;
fprintf
(
stderr
,
"Qt %x
\n
"
,
e
->
key
()
);
fprintf
(
stderr
,
"Qt %x
\n
"
,
e
->
key
()
);
/* Look for some special keys */
#define HANDLE( qt, vk ) case Qt::qt : i_vlck |= vk; found = true;break
switch
(
e
->
key
()
)
switch
(
e
->
key
()
)
{
{
case
Qt
:
:
Key_Left
:
i_vlck
|=
KEY_LEFT
;
found
=
true
;;
break
;
HANDLE
(
Key_Left
,
KEY_LEFT
);
case
Qt
:
:
Key_Right
:
i_vlck
|=
KEY_RIGHT
;
found
=
true
;
break
;
HANDLE
(
Key_Right
,
KEY_RIGHT
);
HANDLE
(
Key_Up
,
KEY_UP
);
HANDLE
(
Key_Down
,
KEY_DOWN
);
HANDLE
(
Key_Space
,
KEY_SPACE
);
HANDLE
(
Key_Escape
,
KEY_ESC
);
HANDLE
(
Key_Enter
,
KEY_ENTER
);
HANDLE
(
Key_F1
,
KEY_F1
);
HANDLE
(
Key_F2
,
KEY_F2
);
HANDLE
(
Key_F3
,
KEY_F3
);
HANDLE
(
Key_F4
,
KEY_F4
);
HANDLE
(
Key_F5
,
KEY_F5
);
HANDLE
(
Key_F6
,
KEY_F6
);
HANDLE
(
Key_F7
,
KEY_F7
);
HANDLE
(
Key_F8
,
KEY_F8
);
HANDLE
(
Key_F9
,
KEY_F9
);
HANDLE
(
Key_F10
,
KEY_F10
);
HANDLE
(
Key_F11
,
KEY_F11
);
HANDLE
(
Key_F12
,
KEY_F12
);
HANDLE
(
Key_PageUp
,
KEY_PAGEUP
);
HANDLE
(
Key_PageDown
,
KEY_PAGEDOWN
);
HANDLE
(
Key_Home
,
KEY_HOME
);
HANDLE
(
Key_End
,
KEY_END
);
HANDLE
(
Key_Insert
,
KEY_INSERT
);
HANDLE
(
Key_Delete
,
KEY_DELETE
);
}
}
fprintf
(
stderr
,
"After keys %x
\n
"
,
i_vlck
);
fprintf
(
stderr
,
"After keys %x
\n
"
,
i_vlck
);
if
(
!
found
)
if
(
!
found
)
{
{
fprintf
(
stderr
,
"Not found
\n
"
);
/* Force lowercase */
if
(
e
->
key
()
>=
Qt
::
Key_A
&&
e
->
key
()
<=
Qt
::
Key_Z
)
if
(
e
->
key
()
>=
Qt
::
Key_A
&&
e
->
key
()
<=
Qt
::
Key_Z
)
{
fprintf
(
stderr
,
"Alphabet
\n
"
);
i_vlck
+=
e
->
key
()
+
32
;
i_vlck
+=
e
->
key
()
+
32
;
}
/* Rest of the ascii range */
/* Rest of the ascii range */
else
if
(
e
->
key
()
>=
Qt
::
Key_Space
&&
e
->
key
()
<=
Qt
::
Key_AsciiTilde
)
else
if
(
e
->
key
()
>=
Qt
::
Key_Space
&&
e
->
key
()
<=
Qt
::
Key_AsciiTilde
)
{
fprintf
(
stderr
,
"Yeh !
\n
"
);
i_vlck
+=
e
->
key
();
i_vlck
+=
e
->
key
();
}
}
}
if
(
i_vlck
>=
0
)
if
(
i_vlck
>=
0
)
{
{
fprintf
(
stderr
,
"Setting key-pressed %i
\n
"
,
i_vlck
);
var_SetInteger
(
p_intf
->
p_vlc
,
"key-pressed"
,
i_vlck
);
var_SetInteger
(
p_intf
->
p_vlc
,
"key-pressed"
,
i_vlck
);
e
->
accept
();
e
->
accept
();
}
}
...
...
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