Git Product home page Git Product logo

Comments (5)

d07RiV avatar d07RiV commented on July 29, 2024

I'm not a fan of blocking all keyboard shortcuts but maybe this is the right time to do it. I'll put it in and see if it causes any issues.

from diabloweb.

d07RiV avatar d07RiV commented on July 29, 2024

Okay, preventing default on all keypresses was a disaster. Limiting it to Backspace and F1/F5 for now.

What is the purpose for mapping F5-F8 to numpad?

from diabloweb.

kunKun-tx avatar kunKun-tx commented on July 29, 2024

oh, didn't realize you prevent default on all keypresses. I wrote a tampermonkey script to prevent it only for f1, f5, and backspace and haven't have any issue.

F5-F8 were used as hotkey to switch skills. As you would suspect, only f6 and f8 work flawlessly, f5 will refresh the page and f7 will call out a firefox window.

from diabloweb.

kunKun-tx avatar kunKun-tx commented on July 29, 2024

I tried using KeyboardEvent to remap F5-F8 w/o any success. I suspect it's not allowed for security reasons (see quote from MDN below). Besides, even if it works, it would still trigger as Browser's shortcut. Is there a way to change the key binding inside complied devilution wasm files? Numpad 1 - 4 will work well for this.

Manually firing an event does not generate the default action associated with that event. For example, manually firing a key event does not cause that letter to appear in a focused text input. In the case of UI events, this is important for security reasons, as it prevents scripts from simulating user actions that interact with the browser itself.

from diabloweb.

d07RiV avatar d07RiV commented on July 29, 2024

Ah, right. Thought you meant mapping the other way. Extended it to F1-F8 plus backspace.

from diabloweb.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.