Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
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-2-2
Commits
98de0c4b
Commit
98de0c4b
authored
Sep 03, 2006
by
Clément Stenac
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Start grabbing hotkeys in Qt. Unfinished
parent
9dcb15a1
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
48 additions
and
1 deletion
+48
-1
include/vlc_playlist.h
include/vlc_playlist.h
+0
-1
modules/gui/qt4/main_interface.cpp
modules/gui/qt4/main_interface.cpp
+46
-0
modules/gui/qt4/main_interface.hpp
modules/gui/qt4/main_interface.hpp
+2
-0
No files found.
include/vlc_playlist.h
View file @
98de0c4b
...
...
@@ -70,7 +70,6 @@ struct playlist_item_t
#define PLAYLIST_RO_FLAG 0x0008
/**< Write-enabled ? */
#define PLAYLIST_REMOVE_FLAG 0x0010
/**< Remove this item at the end */
#define PLAYLIST_EXPANDED_FLAG 0x0020
/**< Expanded node */
#define PLAYLIST_PREFCAT_FLAG 0x0040
/**< Prefer category */
/**
* Playlist status
...
...
modules/gui/qt4/main_interface.cpp
View file @
98de0c4b
...
...
@@ -31,7 +31,9 @@
#include <assert.h>
#include <QPushButton>
#include <QStatusBar>
#include <QKeyEvent>
#include "menus.hpp"
#include <vlc_keys.h>
#ifdef WIN32
#define PREF_W 410
...
...
@@ -52,6 +54,8 @@ MainInterface::MainInterface( intf_thread_t *_p_intf ) : QVLCMW( _p_intf )
setWindowTitle
(
QString
::
fromUtf8
(
_
(
"VLC media player"
)
)
);
ui
.
setupUi
(
centralWidget
()
);
setFocusPolicy
(
Qt
::
StrongFocus
);
slider
=
new
InputSlider
(
Qt
::
Horizontal
,
NULL
);
ui
.
hboxLayout
->
insertWidget
(
0
,
slider
);
ui
.
prevButton
->
setText
(
""
);
...
...
@@ -164,6 +168,48 @@ void MainInterface::resizeEvent( QResizeEvent *e )
p_intf
->
p_sys
->
p_video
->
updateGeometry
()
;
}
void
MainInterface
::
keyPressEvent
(
QKeyEvent
*
e
)
{
int
i_vlck
=
0
;
if
(
e
->
modifiers
()
&
Qt
::
ShiftModifier
)
i_vlck
|=
KEY_MODIFIER_SHIFT
;
if
(
e
->
modifiers
()
&
Qt
::
AltModifier
)
i_vlck
|=
KEY_MODIFIER_ALT
;
if
(
e
->
modifiers
()
&
Qt
::
ControlModifier
)
i_vlck
|=
KEY_MODIFIER_CTRL
;
if
(
e
->
modifiers
()
&
Qt
::
MetaModifier
)
i_vlck
|=
KEY_MODIFIER_META
;
fprintf
(
stderr
,
"After modifiers %x
\n
"
,
i_vlck
);
bool
found
=
false
;
fprintf
(
stderr
,
"Qt %x
\n
"
,
e
->
key
()
);
switch
(
e
->
key
()
)
{
case
Qt
:
:
Key_Left
:
i_vlck
|=
KEY_LEFT
;
found
=
true
;;
break
;
case
Qt
:
:
Key_Right
:
i_vlck
|=
KEY_RIGHT
;
found
=
true
;
break
;
}
fprintf
(
stderr
,
"After keys %x
\n
"
,
i_vlck
);
if
(
!
found
)
{
fprintf
(
stderr
,
"Not found
\n
"
);
if
(
e
->
key
()
>=
Qt
::
Key_A
&&
e
->
key
()
<=
Qt
::
Key_Z
)
{
fprintf
(
stderr
,
"Alphabet
\n
"
);
i_vlck
+=
e
->
key
()
+
32
;
}
/* Rest of the ascii range */
else
if
(
e
->
key
()
>=
Qt
::
Key_Space
&&
e
->
key
()
<=
Qt
::
Key_AsciiTilde
)
{
fprintf
(
stderr
,
"Yeh !
\n
"
);
i_vlck
+=
e
->
key
();
}
}
if
(
i_vlck
>=
0
)
{
fprintf
(
stderr
,
"Setting key-pressed %i
\n
"
,
i_vlck
);
var_SetInteger
(
p_intf
->
p_vlc
,
"key-pressed"
,
i_vlck
);
e
->
accept
();
}
else
e
->
ignore
();
}
void
MainInterface
::
stop
()
{
playlist_Stop
(
THEPL
);
...
...
modules/gui/qt4/main_interface.hpp
View file @
98de0c4b
...
...
@@ -29,6 +29,7 @@
#include "util/qvlcframe.hpp"
class
QCloseEvent
;
class
QKeyEvent
;
class
QLabel
;
class
InputManager
;
class
InputSlider
;
...
...
@@ -50,6 +51,7 @@ protected:
Ui
::
MainInterfaceUI
ui
;
friend
class
VolumeClickHandler
;
private:
virtual
void
keyPressEvent
(
QKeyEvent
*
);
VideoWidget
*
videoWidget
;
InputManager
*
main_input_manager
;
QLabel
*
timeLabel
;
...
...
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