24

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.

5

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.

| improve this answer | |
  • 1
    The feature has to be manually enabled each time you start the player though – user162573 Oct 8 '17 at 12:52
  • 1
    The package does not look not maintained, unfortunately. It used to work without needed manually enabling it. Now it won't work, I haven't checked why. I'll update my comment if I solve it. – galath Oct 11 '17 at 9:09
  • 1
    Tested with VLC 3.0.6 32bit running on Win7 64bit (no idea why I didn't install 64-bit VLC way-back-when, but too lazy to change it). Works like a charm and doesn't need re-enabling. (the opposite in fact, you need to restart the player once after setting up for the changes to take effect) – Tobl May 31 '19 at 10:24
  • 1
    github.com/nurupo/vlc-pause-click-plugin was updated 10 days ago. – Ryan Aug 12 '19 at 17:31
  • I guess the initial link was updated so that it sends not to the addon that needed enabling each time, but to the plugin ( nurupo / vlc-pause-click-plugin) that I detail in my answer. – cipricus Apr 3 at 7:22
3

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.

| improve this answer | |
  • 1
    Not a bad idea, although a bit overkill :). – alex Aug 5 '10 at 20:57
  • of course! but that's the only way i know of! – bryan Aug 5 '10 at 22:24
  • does that work in Vista, win7 and above? – user162573 Dec 7 '13 at 16:22
  • It worked in Vista and Windows 7. Have not tried in Windows 8 – bryan Dec 9 '13 at 19:01
3

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.

| improve this answer | |
  • 2
    It's ok, but not what I want. I want to left click and pause. – alex Aug 5 '10 at 20:56
  • just a related tip: drag with right mouse button in the direction of "play/pause" option instead. it's a bit faster and barely worse than single click play/pause – a13ph May 20 '14 at 22:16
3

I've created lua extension for doing exactly what you want to do. Please check project at github or videolan addons page

| improve this answer | |
  • 2
    Aaand... from the project page: "You need to tick it every time you open VLC. This is a limitation of VLC lua api." Why in the hell this has to be so hard ?! – Halil Özgür Oct 20 '13 at 23:57
  • @HalilÖzgür: as you noticed, "This is a limitation of VLC lua api." +1, but indeed, the need to tick it every time you open VLC is a big downside – user162573 Dec 7 '13 at 16:17
  • 3
    Why on earth it's so hard to bind primary click to play/pause in such a popular player? This shouldn't even need an extension. And then, the requirement of the extension is ridiculous, regardless of the origin. For this reason I'm using SMPlayer. – Halil Özgür Dec 7 '13 at 21:46
  • Even worse, this extension doesn't work with newer versions of vlc. The 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. – con-f-use Jan 2 '16 at 14:53
  • 3
    It's true, seems like there is no way to do this with lua anymore. Instead, take a look at nurupo's pause-click-plugin Worked for me some time ago. – 3demax Jan 9 '16 at 19:27
1

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.

enter image description here

Navigate further down to Interface > Control interfaces > Gestures.

enter image description here

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
| improve this answer | |
  • Sorry, but doesn't work (player v.2.2.4, win7) – Putnik Aug 5 '16 at 9:07
  • Works for me, Windows 10, VLC 2.2.x. Maybe this should be the accepted answer, because it's a native setting, which should work for most people. Thanks! – Simon Steinberger Oct 8 '17 at 12:51
  • @SimonSteinberger - In fact I don't find it very usable. As I said in the answer, one has to avoid the other very similar gestures (left/right backward/forward): but these are hard to avoid, at least with a mouse. Maybe it's easier with a touch screen or touchpad? – user162573 Oct 8 '17 at 12:57
1

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

| improve this answer | |
  • I am the author. I created the note for me in the linked site and felt it would be useful if put it here. Sorry if I make any mistake.. If there is a problem I could delete it. How can I disclose it as it is my work? – podcast Oct 27 '18 at 2:27
  • Just edit your answer again, and edit the last line to say something like “I previously posted this answer at ____”, and you’ll be fine. – Scott Oct 27 '18 at 2:43
  • Thanks for making the edit to your post. As you've determined, the disclosure requirements aren't intended to be onerous. When it's your own content, it's really pretty easy, just like you've done here. – Makyen Oct 27 '18 at 3:50
1

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.

| improve this answer | |
  • Nice workaround! – dirdi Oct 2 '19 at 13:05
1

UPDATE on some links posted under this question.

Nurupo'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

enter image description here

enter image description here

enter image description here

Here, for "Pause click" filter, multiple mouse button choices are available: left, right, middle click, and other options

enter image description here

enter image description here

Right mouse click is maybe the best option (while disabling context menu on right click) in case left-click interferes wit 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.)

| improve this answer | |
0

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.

| improve this answer | |

Not the answer you're looking for? Browse other questions tagged or ask your own question.