Giter Site home page Giter Site logo

jkey's Introduction

jkey's People

Contributors

bnvk avatar botandrose avatar johnnymugs avatar oscargodson avatar twoer avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

jkey's Issues

jKey - Double Digit Support

Hi there. Great plug-in but missing the functionality I'm looking for.

I have numbered tables and I want a user to be able to select and highlight the data for say row number 22 just using the keyboard.

Is there anyway I can have some very short time delay in there to say if two keys are pressed 'in sequence' within a few milliseconds apart, treat this as a double digit key press?

Thanks,

Peter

Key patterns (like the konami code)

Can you add support for key chaining? For example to fire when user presses up,up,alt+shift+m ...or something more complicated like the konami code.

Add support to allow event bubbling.

If you bind the up/down keys to window, you lose page scroll capabilities, I think it would be a good idea to add support for event bubbling so the event still makes it up the chain.

You can do this by passing a "bubble" Boolean into the function.

e.g.

$(window).jkey("up", true, function(key){ //do stuff with the up key}

When set the Key combination of alt+s. It show an alert correctly. after i press s key in page it shows as same alert inappropriately

This Plugin is really awesome and i like it very much. i am facing some issues in this .
When set the Key combination of alt+s. It show an alert correctly. after that i press S key in page it shows as same alert inappropriately. i didnt place the alert in jkey callback function. alert in save button it shows a mandatory. is there any way. Kindly fix this issue as soon as possible

Thanks

Rajesh.S

Command key on OS X prevents keyup (Safari, Chrome, FF)

If you bind a combo like ctrl+enter on OS X, hold down the commend key and any other button (enter for example) you are able to “freeze” that button jKey's activeKeys array:
Let go of the enter button while still holding the command button; you'll notice that no keyup event was fired for the enter button. Thus the activeKeys array within still contains the pressed enter key.
Now you can trigger the ctrl+enter combo callback whenever you hit ctrl – no need to hit enter anymore, since it's registered as 'activeKey' forever... well until you hit enter again.

$(document).jkey('ctrl+enter',function(){
  jkey.log('You pressed the enter+ctrl key.');
});

That also makes combos with the command button impossible.
I also noticed that jkey binds the keyCode 224 for the command button but it's different in all the browsers:

Firefox: 224
Opera: 17
WebKit (Safari/Chrome): 91 (Left Apple) or 93 (Right Apple)

Internet Explorer trouble

I was using it to detect if a letter d is clicked like so

$(window).jkey('d',true,function(){alert('you clicked d');});

but it doesn't work in ie.

shift + '?' on german keyboard not working in FF 3.6.13

$(window).jkey('shift+?',function(){
    console.log('key pressed');
});

Does not work in Firefox 3.6.13 / Mac OS X with a german keyboard. The keyUp-Code that jquery receives when I press the ?-Button is 223. Sadly, I couldnt find any assigned key name at the beginning of the jkey source.

Otherwise, thank you for the good script. Just what I needed.

Michael

Error when combining with other javascript

Everything works fine for me, except that when I combine my javascript files into one, I get this cryptic error:

http://grab.by/8zCA

Do you have any idea what might cause this? I had the same problem with jquery.hotkeys, which is why I wanted to try and use jkey.

I'm using some custom javascript (so it may be my fault) and these:

<script src="//ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script> <script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.8.4/jquery-ui.min.js"></script>

Any help would be very much appreciated. I'm really stuck.

Numeric keyboard

Hi guys,

The keypress doesn't get registered for a number, if I press it on the numeric keyboard.
Am I missing something?

Thanks :)

Unbind should proceed bind

Lines 197 and 248 should be as follows, respectively:

$this.unbind('keydown').bind('keydown',function(e){
}).unbind('keyup').bind('keyup',function(e) {

This will allow for re-applying the jKey class on ajax added elements.

alert()s and confirms() break jKey if they are invoked with it

In the simplified example below, if I press a or b separately, nothing happens (expected).
If I press a and b and the same time, then the event fires (expected).
But after that point, the event fires every time I press a or b.

Behavior is reproducible in Chrome 13 and Firefox 6 and IE9
Am I doing something wrong?

Thanks!

<!doctype html>  
<html>
<head>
   <script type="text/javascript" src="jquery-1.6.2.min.js"></script>
   <script type="text/javascript" src="jquery.jkey-1.2.js"></script>

  <script type="text/javascript">
  $(function() {
  $(document).jkey('a+b',function() { alert('a and b pressed together!');});
  });
  </script>
</head>
<body>
</body>

Unbinding jKey events

Hi there,

I'd just wanted to point out that there's no explanation on how to unbind a jKey event, although I found it easily looking at your code, it may be something good to just write it somewhere in the README file or maybe making a more "clean" way to do it.
For now I made it this way

$(element).unbind('keydown.jkey');

For me it's all right, but it implies that I unbind every key event associated to element
If you're ok with patches I'd be pleased to write one in order to implement some way to make it possible to unbind specifical key events, in order to do something like that :

$(element).jkey('unbind', 'left, right');

Thanks for the plug, works really well!

Cheers

Key Combos Firing when one key is pressed

First I would like to thank you for this plugin, it saved me tons of time and headaches.
My issue is i am tracking when someone pastes into an input field. The key combo i set up is 'crtl+v' which works the first time you press it. Then after that anytime you press a v or crtl it will fire the callback function.

I made a fiddle for you with my code.

http://jsfiddle.net/cfletcher1856/zTPtv/

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.