Giter Site home page Giter Site logo

Comments (6)

OscarGodson avatar OscarGodson commented on August 30, 2024

We would like to add support for other keyboards through a 4th parameter called localization where you can give it a key or a whole entire new set and it'll overwrite the others.

Once I get this working would you be up for sending me a new JSON packet with German keys so I could include a separate directory containing other layouts? :)

from jkey.

propercroc avatar propercroc commented on August 30, 2024

Of course, gladly. And some other european ones, as well.

from jkey.

OscarGodson avatar OscarGodson commented on August 30, 2024

Great! I'll try to implement that tomorrow, or maybe sometime this week and ping ya again :)

from jkey.

OscarGodson avatar OscarGodson commented on August 30, 2024

So, i finally added it in, but I'm not 100% sure about the syntax. It'd look like this:

$(window).jkey('?',callback,{'?':223})

Or, my suggestion would be to use it like:
var localization = {'?':223,'a':224,'b':225,'c':226}
$(window).jkey('?',callback,localization)
$(window).jkey('a+b,c',callback,localization)

Basically, we setup a var with all the new key mappings and then pass with each call you wanna overwrite it with. What do you think? It's working now and if you think it works I can push an update!

from jkey.

propercroc avatar propercroc commented on August 30, 2024

Well, one could argue the need of passing in the localization var over and over again, it could be bothering when the locale var is out of scope for instance. I would pass it into the jkey config in some kind of constructor of init method.
Otherwise I think the above is a good idea. Do we have a source to easily find out the key numbers? Is it possible they differ among user agents?
I tried your code as-is without any success.

from jkey.

propercroc avatar propercroc commented on August 30, 2024

Ah, you can try out here what your keyboard code js has detected, and this also leeds to a new bug, this time in FF. On http://www.webonweboff.com/tips/js/event_key_codes.aspx#instant-test you can test your input. Safari will give back '189', while FF states '0' as keyboard code. Could also be a bug in those script running on webonweboff, though.

Where can I pull the code that enables me to use the upper syntax you suggested? Is it available already or could you send me a patch?

from jkey.

Related Issues (19)

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.