Comments (9)
看起来还是官方的补丁有问题,不仅与inputevent冲突,还把所有OSC脚本的进度条拖动功能给破坏了
from input-event.
OSC进度条拖动已经修复了 mpv-player/mpv@0509e5b ,但还是与inputevent冲突
from input-event.
mp.add_forced_key_binding(
"MBTN_LEFT",
"MBTN_LEFT",
function(e)
print(e.event)
end,
{ complex = true }
)
拖动时立刻打印 down, up , mpv那边改成 down,drag 或者其他方式通知 drag 事件才能修。
今天 shinchiro 的自动编译没出来,过两天再看看
我现在 uosc 的进度条不能拖
from input-event.
zhongfly的构建比较快 2024-06-06 12:10,进度条拖动应该没问题了。
与脚本按键绑定冲突的原因 mpv-player/mpv#14251 (comment) ,
已经修复还没合并,加了一个取消标记,可以先下载这个自动构建 mpv-player/mpv#14311 (comment) 。
我试了一下,这样改可以
function InputEvent:bind()
self.exec_debounced = debounce(function() self:exec() end, self.duration)
mp.add_forced_key_binding(self.key, self.key, function(e)
if e.canceled and self.key:upper() == "MBTN_LEFT" then
self.queue = {}
return
end
self:handler(e.event)
end, { complex = true })
end
本来想只用if e.canceled
一个条件的,测试发现可能会丢失release操作,
比如当按住a保持不动,再去按其他键,此时a会被打断,触发一次up事件并且canceled=true,如果直接抛弃的话会把release操作吞掉。
只抛弃左键的取消,影响应该是最小的,就是太硬编码了,
你有其他更优雅的方式也可以试试,根据我的测试canceled=true好像只与up事件一起出现,一个键被其他操作打断时触发。
from input-event.
盲改的,我有空试一试 @drag
正不正常
from input-event.
我觉得@drag
没啥太大意义,而且仅凭鼠标取消信号就判断为拖动是不准确的
- 在菜单打开状态下,使用左键关闭菜单,也会触发
- 按住鼠标保持不动,再按其他键打断鼠标,也会触发
from input-event.
补丁已经合并了,最新的zhongfly和shinchiro构建都能直接用了。
想到个不错的方案,碰到取消信号时忽略@click
,类似获取焦点时那样,
最大的优点:在菜单打开状态下,使用双击依旧可以切换全屏,因为第一次的取消信号只忽略@click
,不影响第二次触发@double_click
小缺点:如果拖动时间极短,然后紧接着一个单击,也会触发全屏,不算什么很影响使用的问题,基本可忽略
function(e)
if e.canceled then self:ignore('click', self.duration) end
self:handler(e.event)
end
from input-event.
改了下,我试了下感觉没什么问题
from input-event.
fixed b9fb2bd
from input-event.
Related Issues (20)
- 允许通过脚本配置文件设置绑定 HOT 12
- Supports mutiple input command perfixes HOT 1
- Re-think: event ignore HOT 1
- Bring back the default behavior via repeat ignore HOT 1
- Inline bind/unbind HOT 1
- Improve `command.split(";")` HOT 1
- Update document
- Delay on Click Commands HOT 2
- Weird behavior with `#@press` when triggering another command at the same time HOT 2
- It broke scroll-list.lua functionality HOT 10
- [REQUEST] 'Long' press event HOT 2
- [Question] How to write ignore statement in json conf HOT 2
- Remove "Left-click will be ignored for a short time after the focus window" HOT 13
- Re-think "How to integrate with other scripts"
- Support mpv.net v7 HOT 1
- Is there a way to not play/pause while dragging ? HOT 4
- I need to click 3 times to get double click. HOT 10
- Move array like command to string converter to constructor
- Use "event:" to replace "@" as a prefix
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from input-event.