Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
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
Commits
e3511f67
Commit
e3511f67
authored
Feb 27, 2012
by
Francois Cartegnie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Qt: handle special mouse buttons
parent
aeb250f7
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
43 additions
and
0 deletions
+43
-0
modules/gui/qt4/components/preferences_widgets.cpp
modules/gui/qt4/components/preferences_widgets.cpp
+8
-0
modules/gui/qt4/components/preferences_widgets.hpp
modules/gui/qt4/components/preferences_widgets.hpp
+1
-0
modules/gui/qt4/main_interface.cpp
modules/gui/qt4/main_interface.cpp
+12
-0
modules/gui/qt4/main_interface.hpp
modules/gui/qt4/main_interface.hpp
+1
-0
modules/gui/qt4/util/customwidgets.cpp
modules/gui/qt4/util/customwidgets.cpp
+20
-0
modules/gui/qt4/util/customwidgets.hpp
modules/gui/qt4/util/customwidgets.hpp
+1
-0
No files found.
modules/gui/qt4/components/preferences_widgets.cpp
View file @
e3511f67
...
...
@@ -1614,3 +1614,11 @@ void KeyInputDialog::wheelEvent( QWheelEvent *e )
keyValue
=
i_vlck
;
}
void
KeyInputDialog
::
mousePressEvent
(
QMouseEvent
*
e
)
{
int
i_vlck
=
qtMouseEventToVLCKey
(
e
);
selected
->
setText
(
qtr
(
"Key: "
)
+
VLCKeyToString
(
i_vlck
)
);
checkForConflicts
(
i_vlck
);
keyValue
=
i_vlck
;
}
modules/gui/qt4/components/preferences_widgets.hpp
View file @
e3511f67
...
...
@@ -485,6 +485,7 @@ private:
void
checkForConflicts
(
int
i_vlckey
);
void
keyPressEvent
(
QKeyEvent
*
);
void
wheelEvent
(
QWheelEvent
*
);
void
mousePressEvent
(
QMouseEvent
*
);
bool
b_global
;
};
#endif
modules/gui/qt4/main_interface.cpp
View file @
e3511f67
...
...
@@ -1314,6 +1314,18 @@ void MainInterface::wheelEvent( QWheelEvent *e )
e
->
accept
();
}
void
MainInterface
::
mousePressEvent
(
QMouseEvent
*
e
)
{
int
i_vlckey
=
qtMouseEventToVLCKey
(
e
);
if
(
i_vlckey
>
0
)
{
var_SetInteger
(
p_intf
->
p_libvlc
,
"key-pressed"
,
i_vlckey
);
e
->
accept
();
}
else
e
->
ignore
();
}
void
MainInterface
::
closeEvent
(
QCloseEvent
*
e
)
{
// hide();
...
...
modules/gui/qt4/main_interface.hpp
View file @
e3511f67
...
...
@@ -101,6 +101,7 @@ protected:
virtual
void
closeEvent
(
QCloseEvent
*
);
virtual
void
keyPressEvent
(
QKeyEvent
*
);
virtual
void
wheelEvent
(
QWheelEvent
*
);
virtual
void
mousePressEvent
(
QMouseEvent
*
);
private:
/* Main Widgets Creation */
...
...
modules/gui/qt4/util/customwidgets.cpp
View file @
e3511f67
...
...
@@ -286,6 +286,26 @@ int qtWheelEventToVLCKey( QWheelEvent *e )
return
i_vlck
;
}
int
qtMouseEventToVLCKey
(
QMouseEvent
*
e
)
{
int
i_vlck
=
0
;
switch
(
e
->
button
()
)
{
case
Qt
:
:
MidButton
:
i_vlck
|=
KEY_MOUSEBUTTON_MID
;
break
;
case
Qt
:
:
XButton1
:
i_vlck
|=
KEY_MOUSEBUTTON_X1
;
break
;
case
Qt
:
:
XButton2
:
i_vlck
|=
KEY_MOUSEBUTTON_X2
;
default:
break
;
}
if
(
i_vlck
>
0
)
i_vlck
|=
qtKeyModifiersToVLC
(
e
);
return
i_vlck
;
}
QString
VLCKeyToString
(
unsigned
val
)
{
char
*
base
=
vlc_keycode2str
(
val
);
...
...
modules/gui/qt4/util/customwidgets.hpp
View file @
e3511f67
...
...
@@ -179,6 +179,7 @@ class QInputEvent;
int
qtKeyModifiersToVLC
(
QInputEvent
*
e
);
int
qtEventToVLCKey
(
QKeyEvent
*
e
);
int
qtWheelEventToVLCKey
(
QWheelEvent
*
e
);
int
qtMouseEventToVLCKey
(
QMouseEvent
*
e
);
QString
VLCKeyToString
(
unsigned
val
);
#endif
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