未测试,且需要鼠标脚本(请自己找,找到后将下面脚本中的中文字替换为对应鼠标脚本的代码)
module Input [:press?, :trigger?, :repeat?].each do |name| old = method(name) define_singleton_method name do |sym| case sym when :B, 12 old.call || 鼠标右键被按下? when :C, 13 old.call || 鼠标左键被按下? else old.call end end end end
module Input
[:press?, :trigger?, :repeat?].each do |name|
old = method(name)
define_singleton_method name do |sym|
case sym
when :B, 12
old.call || 鼠标右键被按下?
when :C, 13
old.call || 鼠标左键被按下?
else
old.call
end
end
end
end
|