MPV OSC not working on attached window with --wid option - osc

I run mpv.exe "video.mp4" --wid="hwnd of a notepad window" and the video played on the notepad window well. But I was noticed that OSC is not working. I moved mouse cursor on the window and pressed some keyboard shortcut but nothing worked. How can I summon and use osc on the attached window..? I am using mpv-0.33.0-x86_64.

i am late, but i found a way. directly send or post mouse input you catched to window. Then osc will be appeared if you did not off osc. the doc said the window being played by mpv with wid option do not take mouse or keyboard input. so you should manage it by your own hand.

Related

Autohotkey Key for hiding current window

I try to close a window with the below configuration when pressing Ctrl and h.
Unfortunately it does not work.
E.g. in Chrome it opens the little window as if you press alt+space, when I focus the address bar in Chrome it works.
What do I do wrong?
;Hide a window
^h:: Send !{Space}n
Return
I managed to get a solution which fixes my issue:
I now use Kinto, which itself uses AutoHotkey, and it has the key action I want right from the start using the Mac OS Layout from the Kinto Installation Options.
Kinto itself uses AutoHotkey, you can find the AutoHotkey-file on Github.

Autohotkey - Enable all mouse click functionality and also play a sound

I have this autohotkey script, I want to play a sound on mouse click. But this script doesn't let me drag windows or resize window or highlighting text using mouse left click.
Any idea how I can have all mouse left click functionality and also play the Error.wav sound on every click?
LButton::
MouseClick, Left
SoundPlay, C:\Windows\media\Error.wav
return
Your current script is not only listening for a mouse click, but also emulating a second click with MouseClick, Left. It seems that's not what you want. Also use ~ to ensure that
When the hotkey fires, its key's native function will not be blocked
(hidden from the system)
~LButton::SoundPlay, C:\Windows\media\Error.wav
See Hotkeys documentation.

What's the difference between Send and ControlSend?

AutoHotkey's official documentation lists two different sets of commands for sending simulated keyboard input to a window.
Send / SendRaw / SendInput / SendPlay / SendEvent
Sends simulated keystrokes and mouse clicks to the active window.
ControlSend / ControlSendRaw
Sends simulated keystrokes to a window or control.
What's the difference between Send and ControlSend?
Is there a reason to use one over the other?
Send/SendXXX commands send input to the active window. That is the window that currently has focus, usually by clicking it with your mouse, tabbing to it, or when a window sets focus to itself.
If your AHK script were to target a Notepad window that you have open, and you were to click on another window such as Chrome, your inputs would now be sent to Chrome.
On the flipside, using ControlSend/ControlSendXXX commands will send input to a specified window or control. A control might be a textbox, button, or similar interactive elements.
Here, the above example would still output to Notepad even if you switched focus to another window such as Chrome. The downside is that you must specify which control to send to.

Sending keystrokes and mouse clicks using Scala

I've previously used AutoHotkey to send keystrokes and mouse clicks to automate interaction with GUIs and browsers. How do I send keystrokes and mouse clicks this time using Scala?
You can use java.awt.Robot.
val robot = new java.awt.Robot
robot.mouseMove(100,100) // Cursor will jump to the top left of your screen
Note that you have to enter text keycode by keycode (see java.awt.event.KeyEvent). This is pretty annoying, but you can write code to automate the pressing and releasing of keys. (You do need to release every key you press! It's emulating the keyboard....)
JNA + Windows API
I had to send input to a background window and it worked really well for me.

Autohotkey - capture extra mouse buttons

Can autohotkey capture nonstandard mouse buttons? I use a five-button mouse (Microsoft Wireless Laser Mouse 6000).
XButton1 and XButton2 according to the documentation on autohotkey.com.
The following URLs show how to have autohotkey log all keyboard and mouse events, and how to look at the log autohotkey generates of those events.
http://www.autohotkey.com/docs/commands/_InstallMouseHook.htm
http://www.autohotkey.com/docs/KeyList.htm#SpecialKeys (special keys section)
Based on this, you can find out about all mouse and keyboard events by creating an autohotkey script as such:
#InstallKeybdHook
#InstallMouseHook
Once you run the script, you can double click on the tray icon for that script, then go to View > Key History and Script Info (Ctrl K)
Based on this information, I figured out that my mouse driver is already redefining the extra mouse buttons to other keys. However, I can re-map those keys by going to Control Panel > Mouse, selecting the desired button, and using the "Macro..." option in the mouse configuration (this is a special configuration only for the Microsoft Wireless Laser Mouse 6000 v2). In the macro dialog, I can define keystrokes for those mouse buttons to send (only one per mouse button). Next, I can use AutoHotkey to watch for whatever keystrokes I have defined, and perform specific actions based on those keystrokes.
You need to capture the scancode of the key and then use that. You can find a script in 5th post of this thread, written by Skan, which will allow you to do this. Just run that and click on the GUI with the mouse button you wish to determine the scancode. Then use the scancode in place of the normal key when you create the hotkey.
There is also a built in method of retrieving keys which is documented at the bottom of this page under the heading "Special Keys". Essentially, AHK logs your key presses and automatically records the scancodes for you.
To use the scancode as a hotkey, you just do the following:
SC###:: ;Your code here
Where ### is replaced with the code of your key (or mouse button).