mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-12-28 14:31:10 +00:00
[broadway] clean up input sending js
This commit is contained in:
parent
65d4edbd5b
commit
8f9c6eb1a9
@ -296,22 +296,23 @@ function handleLoad(event)
|
||||
}
|
||||
}
|
||||
|
||||
function on_mouse_move (ev) {
|
||||
function send_input(cmd, args)
|
||||
{
|
||||
if (input_socket != null) {
|
||||
input_socket.send("m" + ev.pageX + "," + ev.pageY + "," + ev.timeStamp);
|
||||
input_socket.send(cmd + args.join(","));
|
||||
}
|
||||
}
|
||||
|
||||
function on_mouse_move (ev) {
|
||||
send_input ("m", [ev.pageX, ev.pageY, ev.timeStamp])
|
||||
}
|
||||
|
||||
function on_mouse_down (ev) {
|
||||
if (input_socket != null) {
|
||||
input_socket.send("b" + ev.pageX + "," + ev.pageY + "," + ev.button + "," + ev.timeStamp);
|
||||
}
|
||||
send_input ("b", [ev.pageX, ev.pageY, ev.button, ev.timeStamp])
|
||||
}
|
||||
|
||||
function on_mouse_up (ev) {
|
||||
if (input_socket != null) {
|
||||
input_socket.send("B" + ev.pageX + "," + ev.pageY + "," + ev.button + "," + ev.timeStamp);
|
||||
}
|
||||
send_input ("B", [ev.pageX, ev.pageY, ev.button, ev.timeStamp])
|
||||
}
|
||||
|
||||
function connect()
|
||||
|
Loading…
Reference in New Issue
Block a user