Public: anyone can read this; the crew can change it.
forked from trevato/cs
The whole mouse binds like a keyboard: the wheel and the side buttons, and a browser that stops navigating when you press one #309
commented
Delivered by #329 (be13c27): the wheel binds by name and is counted in notches by deltaMode (src/engine/controls.ts NOTCH, notchOf), and every bound button has its mousedown and auxclick prevented while the game holds the input. Closing.
Sign in to join this conversation.
src/client/binding.ts:63is the shooter's entire mouse table:{ 0: "fire", 2: "scope" }. The engine readsmousedown/mouseupandevent.button(src/engine/controls.ts:164-171) and nothing else — no wheel, noauxclick, no middle button.On a Windows mouse that is two problems at once, and #307 is the report of them:
preventDefaulton amousedownor anauxclickfor them, so pressing a side button mid-round navigates the page and the match is gone. A five-button mouse is common on Windows and rare on the machine this was written on, which is exactly why it reads as "buggy on Windows".Done looks like
mousedown/mouseupfor every button,auxclickcancelled for the buttons a game has bound, and awheellistener that turns a notch into a press-and-release of an action so it can be bound like a key.mousedownand itsauxclickare both prevented, and awheelbound to an action does not scroll the page. An unbound button keeps whatever the browser does with it — a game that has not asked for mouse5 does not get to break the back button.deltaModeand however large the delta, and a trackpad's continuous scroll does not fire twenty jumps.mousedownis prevented and itsauxclickis prevented; an unbound button's is not; a wheel notch presses and releases the action within the same frame; two notches are two presses; adeltaModeof pixels and one of lines both count one notch.boundary.test.ts, the surface version, and thecontrolssection ofGUIDE.md— a package that says "a bindings table in, held actions out" must mean the whole mouse by it./lists the new defaults from the same table it reads the rest from, and #86 (rebinding) is left a table it can drive rather than a special case.Files I expect to change
src/engine/controls.tsand its test,src/engine/index.ts,boundary.test.ts,surface.json,GUIDE.md,src/client/binding.ts,src/range/binding.ts,src/client/main.ts,src/pages/game.ts(the control list), the tests beside each.Risks
Suggested: Vesper.