Is it possible to play/pause a movie just by clicking on the window?
I really miss this feature from Media Player Classic, but from what I could find, it's not possible in VLC.
Super User is a question and answer site for computer enthusiasts and power users. It only takes a minute to sign up.
Sign up to join this communityNurupo's vlc-pause-click-plugin plugin — already mentioned, now fully implements the desired feature (unlike the addon also mentioned here and comming with a requirement of manually enabling it each time, which made it an improbable solution).
The vlc-pause-click-plugin is cross-platform and works with 2.1, 2.2, 3.0 and even nightly 4.x builds.
Installation depends on the platform.
Some settings are needed after installation under Advanced Preferences
Here, for "Pause click" filter, multiple mouse button choices are available: left, right, middle click, and other options
Right mouse click is maybe the best option (while disabling context menu on right click) in case left-click interferes with DVD menus as some people claimed.
As for the difficulty of installing the plugin and accessing the advanced options (like mentioned under this question), that is probably either caused by not following the installation instructions or by not using the latest versions. (I have enabled this feature without any problems with VLC 3.0.8, 64-bit on Windows, Linux and Mac; on Mac I have also tested versions 2.1 and 2.2, and only the last one didn't work.)
This extension of VLC does pause/play with a single click on the screen. It works with versions 2.1, 2.2 and 3.0.
If you right click on the VLC window a menu list comes up with play, pause and more yepon it. I use this all the time.
I've created lua extension for doing exactly what you want to do. Please check project at github or videolan addons page
vlc.var.add_callback
method has been removed from the lua API. I am unaware of another way to bind functions in a lua extension to a key.
Jan 2, 2016 at 14:53
A funny alternative to left-click would be mouse gestures, as indicated here:
- enable mouse gestures in VLC
- select left mouse button
- left-click & a quick left-right (or right-left) movement to play/pause.
The result is real... but you have to avoid other two very similar gestures:
Move left: Navigate 10 seconds backward
Move right: Navigate 10 seconds forward
DETAILS:
Go to Tools > Preferences [CTRL + P].
Click on All under show settings to go to Advanced settings.
Navigate to Interface > Control interfaces.
Check the option that says Mouse gestures control interface.
Navigate further down to Interface > Control interfaces > Gestures.
To toggle play or pause: click the mouse button you selected and move left and then right: (Also works if you move right and then left)
But the mouse gestures are not customizable (and you cannot chose to disable some of those you don't need). Therefore, avoid other moves like up and down to avoid making other gestures and trigger other actions like down and then left which quits the player
For reference, the list of all gestures:
Move left: Navigate 10 seconds backward
Move right: Navigate 10 seconds forward
Move up: Increase volume
Move down: Decrease volume
Move left and then right: Toggle play or pause (Also works if you move right and then left)
Move up and then down: Mute volume (Also works if you move down and then up)
Move left and then up: Slow down playing speed
Move right and then up: Increase playing speed
Move left and then down: Play previous track of playlist
Move right and then down: Play next track in playlist
Move up and then right: Switch the audio track
Move down and then right: Switch the subtitle track
Move up and then left: Enables full screen
Move down and then left: Exit VLC media player
Note: As of 2021 October, the link below gets redirected to track.vcdc.com
. Use caution.
There is a tool called Nifty Windows, it allows you to associate an action with a press of the mouse. These actions can be key combinations, or execution of a program.
Hope this helps.
I am using X-mouse button control and it does exactly what you are asking.
Only be sure to use "simulated keys" {SPACE} and untick "block original mouse input" to allow double clicking.
Apparently the question is still valid.
My workaround - simple and working - is the one using xdotool
and xinput
.
You need to create a script myVlc
(or alias vlc) like this:
#!/bin/bash
xinput set-button-map DEV_ID 1 2 10 4 5 6 7 8 9
vlc "$@"
xinput set-button-map DEV_ID 1 2 3 4 5 6 7 8 9
It rebinds right_mouse_button into Button10
. For middle button just use 1 10 3 4…. To be sure double check with xev
.
You have to replace DEV_ID with your mouse id. See xinput
.
Or you may grep
it as well:
xinput | grep -i mouse -m 1 | sed -E 's/.*id=([0-9]*).*/\1/'
So the script will be:
#!/bin/bash
xinput set-button-map $(xinput | grep -i mouse -m 1 | sed -E 's/.*id=([0-9]*).*/\1/') 1 2 10 4 5 6 7 8 9
vlc "$@"
xinput set-button-map $(xinput | grep -i mouse -m 1 | sed -E 's/.*id=([0-9]*).*/\1/') 1 2 3 4 5 6 7 8 9
Then rebind Button10 of your WM into space
. For Openbox it goes like that (rc.xml):
<context name="Client">
<mousebind button="Button10" action="Click">
<action name="Execute">
<command>xdotool key space</command>
</action>
</mousebind>
</context>
Actually one could rebind RMB or MMB directly into space, but that would conflict with default RMB/MMB behaviour. And usually we don't want that.
Using myVlc
RMB/MMB will be rebound only while running vlc.
This solution developed and tested by me in Ubuntu 18.04 with VLC 3.
To be able to pause/play VLC player by mouse button, I have created a script file. It runs every time the related mouse button clicked. The script check if the active window title contains "VLC media player". If true, then send "space" key.
Script file content:
wintitle=$(xdotool getwindowfocus getwindowname);
p=" - VLC media player$" ;
if [[ $wintitle =~ $p ]]; then
xte 'key space'
fi
xbindkeys needs to be installed to catch and configure mouse events. I edited ~/.xbindkeysrc file and added some codes as follow:
"bash /home/user/test/control_by_mouse.sh"
b:8 #mouse back button
After that, the following command should be run
xbindkeys
So, every time I press the back button on mouse, the specified script file run.
To get mouse buttons numbers:
xev
The folowing packages needed for this work on my Ubuntu system:
sudo apt install xbindkeys xautomation xev xdotool
Previously I posted this note at https://mim.mbirgin.com/?c=posts&id=105