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
7149e064
Commit
7149e064
authored
Apr 13, 2007
by
Jean-Baptiste Kempf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
qt4 - Mousewheel (2)
parent
9f2f3e7e
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
37 additions
and
15 deletions
+37
-15
modules/gui/qt4/components/preferences_widgets.cpp
modules/gui/qt4/components/preferences_widgets.cpp
+18
-5
modules/gui/qt4/components/preferences_widgets.hpp
modules/gui/qt4/components/preferences_widgets.hpp
+2
-0
modules/gui/qt4/main_interface.cpp
modules/gui/qt4/main_interface.cpp
+1
-9
modules/gui/qt4/util/customwidgets.cpp
modules/gui/qt4/util/customwidgets.cpp
+13
-0
modules/gui/qt4/util/customwidgets.hpp
modules/gui/qt4/util/customwidgets.hpp
+3
-1
No files found.
modules/gui/qt4/components/preferences_widgets.cpp
View file @
7149e064
...
...
@@ -986,16 +986,13 @@ KeyInputDialog::KeyInputDialog( QList<module_config_t*>& _values,
l
->
addLayout
(
l2
);
}
void
KeyInputDialog
::
keyPressEvent
(
QKeyEvent
*
e
)
void
KeyInputDialog
::
checkForConflicts
(
int
i_vlckey
)
{
if
(
e
->
key
()
==
Qt
::
Key_Tab
)
return
;
int
i_vlck
=
qtEventToVLCKey
(
e
);
selected
->
setText
(
VLCKeyToString
(
i_vlck
)
);
conflicts
=
false
;
module_config_t
*
p_current
=
NULL
;
foreach
(
p_current
,
values
)
{
if
(
p_current
->
value
.
i
==
i_vlck
&&
strcmp
(
p_current
->
psz_text
,
if
(
p_current
->
value
.
i
==
i_vlck
ey
&&
strcmp
(
p_current
->
psz_text
,
keyToChange
)
)
{
p_current
->
value
.
i
=
0
;
...
...
@@ -1010,5 +1007,21 @@ void KeyInputDialog::keyPressEvent( QKeyEvent *e )
QString
(
p_current
->
psz_text
)
+
"
\"
"
);
}
else
warning
->
setText
(
""
);
}
void
KeyInputDialog
::
keyPressEvent
(
QKeyEvent
*
e
)
{
if
(
e
->
key
()
==
Qt
::
Key_Tab
)
return
;
int
i_vlck
=
qtEventToVLCKey
(
e
);
selected
->
setText
(
VLCKeyToString
(
i_vlck
)
);
checkForConflicts
(
i_vlck
);
keyValue
=
i_vlck
;
}
void
KeyInputDialog
::
wheelEvent
(
QWheelEvent
*
e
)
{
int
i_vlck
=
qtWheelEventToVLCKey
(
e
);
selected
->
setText
(
VLCKeyToString
(
i_vlck
)
);
checkForConflicts
(
i_vlck
);
keyValue
=
i_vlck
;
}
modules/gui/qt4/components/preferences_widgets.hpp
View file @
7149e064
...
...
@@ -393,7 +393,9 @@ public:
int
keyValue
;
bool
conflicts
;
private:
void
checkForConflicts
(
int
i_vlckey
);
void
keyPressEvent
(
QKeyEvent
*
);
void
wheelEvent
(
QWheelEvent
*
);
QLabel
*
selected
;
QLabel
*
warning
;
const
char
*
keyToChange
;
...
...
modules/gui/qt4/main_interface.cpp
View file @
7149e064
...
...
@@ -553,15 +553,7 @@ void MainInterface::keyPressEvent( QKeyEvent *e )
void
MainInterface
::
wheelEvent
(
QWheelEvent
*
e
)
{
int
i_vlckey
=
0
;
if
(
e
->
delta
()
>
0
)
i_vlckey
=
KEY_MOUSEWHEELUP
;
else
i_vlckey
=
KEY_MOUSEWHEELDOWN
;
/* Handle modifiers */
i_vlckey
|=
qtKeyModifiersToVLC
(
e
);
int
i_vlckey
=
qtWheelEventToVLCKey
(
e
);
var_SetInteger
(
p_intf
->
p_libvlc
,
"key-pressed"
,
i_vlckey
);
e
->
accept
();
}
...
...
modules/gui/qt4/util/customwidgets.cpp
View file @
7149e064
...
...
@@ -30,6 +30,7 @@
#include <QColorGroup>
#include <QRect>
#include <QKeyEvent>
#include <QWheelEvent>
#include <vlc_keys.h>
...
...
@@ -157,6 +158,18 @@ int qtEventToVLCKey( QKeyEvent *e )
return
i_vlck
;
}
int
qtWheelEventToVLCKey
(
QWheelEvent
*
e
)
{
int
i_vlck
=
0
;
/* Handle modifiers */
i_vlck
|=
qtKeyModifiersToVLC
(
e
);
if
(
e
->
delta
()
>
0
)
i_vlck
|=
KEY_MOUSEWHEELUP
;
else
i_vlck
|=
KEY_MOUSEWHEELDOWN
;
return
i_vlck
;
}
QString
VLCKeyToString
(
int
val
)
{
QString
r
=
""
;
...
...
modules/gui/qt4/util/customwidgets.hpp
View file @
7149e064
...
...
@@ -86,8 +86,10 @@ signals:
};
class
QKeyEvent
;
class
QWheelEvent
;
int
qtKeyModifiersToVLC
(
QInputEvent
*
e
);
int
qtEventToVLCKey
(
QKeyEvent
*
e
);
int
qtWheelEventToVLCKey
(
QWheelEvent
*
e
);
QString
VLCKeyToString
(
int
val
);
int
qtKeyModifiersToVLC
(
QInputEvent
*
e
);
#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