OscarGodson / jKey

Key shortcuts made simple
http://oscargodson.github.com/jKey/
185 stars 40 forks source link

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 #32

Open shansmec opened 8 years ago

shansmec commented 8 years ago

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

OscarGodson commented 8 years ago

If you're using alerts I don't think it'll work. This has been reported a couple times, but I'm not sure I have the ability to fix this because of the fact when you use an alert the focus and key presses are swallowed up by the browser. So it would be like if you were pressing alt+s and then your keyboard messed up, you let go of the keys and pressed s again. Your keyboard never knows that you lifted up on the alt key.

https://github.com/OscarGodson/jKey/issues/13

shansmec commented 8 years ago

Actually i used alert in separate save function only i didn't used in the callback refer below code . I don't know how to overcome this. Is there any way to do this. any ways to reset the keys or any other. any suggestions please.

$(document).jkey('alt+s', function () { var btnCancel = document.getElementById('btnCancel'); btnCancel.click(); });

shansmec commented 8 years ago

is there any ways to reset the alt key pressed. or release the key at end .

OscarGodson commented 8 years ago

Maybe, I haven't actually written code for this since 2011. A lot has changed. If you do figured it out feel free to send a PR