added middle button

This commit is contained in:
Devaev Maxim 2019-09-30 07:36:50 +03:00
parent eb445ca45d
commit 5b8ac7ba70
3 changed files with 5 additions and 1 deletions

View File

@ -76,7 +76,7 @@ def valid_hid_mouse_move(arg: Any) -> int:
def valid_hid_mouse_button(arg: Any) -> str: def valid_hid_mouse_button(arg: Any) -> str:
return check_string_in_list(arg, "HID mouse button", ["left", "right"]) return check_string_in_list(arg, "HID mouse button", ["left", "right", "middle"])
def valid_hid_mouse_wheel(arg: Any) -> int: def valid_hid_mouse_wheel(arg: Any) -> int:

View File

@ -304,6 +304,9 @@
<div data-code="left" class="key wide-4 left small"><p>Mouse<br>Left</p></div> <div data-code="left" class="key wide-4 left small"><p>Mouse<br>Left</p></div>
<div data-code="left" class="modifier wide-2 left small"><p><b>&bull;</b><br>&larr; Hold</p></div> <div data-code="left" class="modifier wide-2 left small"><p><b>&bull;</b><br>&larr; Hold</p></div>
<div class="empty-key" style="width:10px"></div> <div class="empty-key" style="width:10px"></div>
<div data-code="middle" class="key wide-2 left small"><p>Mouse<br>Middle</p></div>
<div data-code="middle" class="modifier wide-2 left small"><p><b>&bull;</b><br>&larr; Hold</p></div>
<div class="empty-key" style="width:10px"></div>
<div data-code="right" class="modifier wide-2 right small"><p><b>&bull;</b><br>Hold &rarr;</p></div> <div data-code="right" class="modifier wide-2 right small"><p><b>&bull;</b><br>Hold &rarr;</p></div>
<div data-code="right" class="key wide-4 right small"><p>Mouse<br>Right</p></div> <div data-code="right" class="key wide-4 right small"><p>Mouse<br>Right</p></div>
</div> </div>

View File

@ -121,6 +121,7 @@ export function Mouse() {
switch (event.button) { switch (event.button) {
case 0: __keypad.emit("left", state); break; case 0: __keypad.emit("left", state); break;
case 2: __keypad.emit("right", state); break; case 2: __keypad.emit("right", state); break;
case 1: __keypad.emit("middle", state); break;
} }
}; };