prismarine-web-client
prismarine-web-client copied to clipboard
solve ctrl+w problem
people try to use ctrl+w for sprinting
what can we do to make this less confusing?
related #87
As a first line of defense we should probably add a beforeunload
event handler checking if Ctrl is pressed and saving users from accidentally closing the tab
yes I agree, good idea let's do it
https://developer.mozilla.org/en-US/docs/Web/API/Window/beforeunload_event
https://stackoverflow.com/a/19538231/1658314
An other solution is to change how sprint work. In vanilla you can also double tap w to toggle sprint, so we could implement that and disable ctrl.
and disable ctrl
that's the problem, we can't
maybe displaying a warning in the loading screen "don't press ctrl+w to sprint" could do the trick I guess...
and disable ctrl
that's the problem, we can't
I meant disabling sprinting with ctrl (not using it)
yeah I understand but users try and exit the window
yeah I understand but users try and exit the window
If ctrl does nothing they will try once and not again when they see it doesn't work. The problem is because the feature is there, people will try to use it.
We could just put a warning while loading and then use the beforeunload stuff
I need to read all of the comments before I do because you guys said that
and disable ctrl
that's the problem, we can't
but you can display the (browser standard) confirmation dialog. So the User wont instantly quit and also close 10 other Tabs :) You could set Sprint to another Key and also detecting Double W.
btw. Thanks for this great work here, I really like it!
and disable ctrl
that's the problem, we can't
but you can display the (browser standard) confirmation dialog. So the User wont instantly quit and also close 10 other Tabs :)
You could set Sprint to another Key and also detecting Double W.
btw. Thanks for this great work here, I really like it!
We tried doing that and it looked ugly.
yeah preventing closing the page feel like "ad popup" people should be able to just close it
yeah preventing closing the page feel like "ad popup" people should be able to just close it
Last time it didn't track the state of Ctrl and W keys
if/when you add keybindings to the site, this wouldn’t be a problem. ctrl just wouldn’t be a valid sprint key
The issue isn’t really not having a way to sprint. We could change the keybind to something else today if we wanted to. However, it’s much more difficult to correct muscle memory—most, if not all of the people on the dev team have been playing MC JE for years, and have pressing control-w to sprint as a habit.
On Fri, Jun 25, 2021 at 03:13, radiish @.***> wrote:
if/when you add keybindings to the site, this wouldn’t be a problem. ctrl just wouldn’t be a valid sprint key
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/PrismarineJS/prismarine-web-client/issues/117#issuecomment-868279318, or unsubscribe https://github.com/notifications/unsubscribe-auth/AMVK4MVH56OCJPHHUQUM5LDTUQUCRANCNFSM4ZNFOAMA .
Maybe pressing ctrl could enable sprint until the W key is depressed. This would be similar to vanilla behavior (i.e. you can walk and then tap ctrl to start sprinting) but also enable you to sprint somewhat normally (tap ctrl and then hold w).
im gonna try to do this
*fix
K I think I got it.
https://github.com/PrismarineJS/prismarine-web-client/pull/239
Adding alt as a key for sprinting could work (looks like #239 is trying to do this now). Keeping control around can be considered for non-QWERTY keyboards and also Electron where Control-W can be disabled.
You can actually disable CTRL+W in your browser (if you use Chrome). You can install this extension (https://chrome.google.com/webstore/detail/disable-keyboard-shortcut/aidbmcboeighgdnilpdljbedbbiocphj) and go to chrome://extensions/shortcuts and click on the pen and safely do CTRL+W and then you can sprint in the game!
We know that ctrl+W can be re-binded with a chrome extension. However, this will not be accepted, as mentioned here: https://github.com/PrismarineJS/prismarine-web-client/pull/239#pullrequestreview-799596125
I just found this experimental feature: https://developer.mozilla.org/en-US/docs/Web/API/Keyboard/lock - might be useful when implemented?
I just found this experimental feature: developer.mozilla.org/en-US/docs/Web/API/Keyboard/lock - might be useful when
Hi! You're absolutely right!! This is the only way to cancel ctrl+w as you handle all keyboard interactions (except for long-esc, btw google remote desktop uses this API). The lock can be acquired when you go fullscreen, so I implemented the following:
- When you press F11 - always fullscreen & acquire full keyboard access
- When you press ESC from the pause menu - do the same only if setting Auto Fullscreen is enabled
Also, acquiring full keyboard access can fix ua errors when re-requesting pointerlock (the pointer is not locked when you double press esc too fast without fullscreen)
Btw another annoying thing that I've found is mouse acceleration but it was to fix with Mouse Raw Input (setting), which btw is enabled by default in java version. And also I managed to fix all known control usability issues, so please let me know if there are any problems...
All this fancy stuff is supported only in Chromium browsers, so I don't recommend using others like Firefox...
All this fancy stuff is supported only in Chromium browsers, so I don't recommend using others like Firefox...
I mean... there are pretty good reasons to use FF instead of Chromium-based browsers. In fact, not supporting as many APIs is one of the reasons to use it, since Google has been known to use its dominant market share to do some pretty unethical stuff.
Nonetheless, in this case, IDK why Firefox doesn't support it. I can't think of any good reason.