Made keymap more flexible.
This commit is contained in:
parent
6750ddca2a
commit
2463c5d209
|
@ -92,8 +92,11 @@ function keymap.on_mouse_wheel(delta, ...)
|
||||||
end
|
end
|
||||||
|
|
||||||
function keymap.on_mouse_pressed(button, x, y, clicks)
|
function keymap.on_mouse_pressed(button, x, y, clicks)
|
||||||
return not keymap.on_key_pressed((((clicks - 1) % config.max_clicks) + 1) .. button:sub(1,1) .. "click", x, y, clicks) and
|
local click_number = (((clicks - 1) % config.max_clicks) + 1)
|
||||||
keymap.on_key_pressed(button:sub(1,1) .. "click", x, y, clicks)
|
return not (keymap.on_key_pressed(click_number .. button:sub(1,1) .. "click", x, y, clicks) or
|
||||||
|
keymap.on_key_pressed(button:sub(1,1) .. "click", x, y, clicks) or
|
||||||
|
keymap.on_key_pressed(click_number .. "click", x, y, clicks) or
|
||||||
|
keymap.on_key_pressed("click", x, y, clicks))
|
||||||
end
|
end
|
||||||
|
|
||||||
function keymap.on_key_released(k)
|
function keymap.on_key_released(k)
|
||||||
|
|
Loading…
Reference in New Issue