primefaces-extensions / primefaces-extensions.github.com

Organization repo, only for homepage, wiki and issue tracker
https://primefaces-extensions.github.io/
70 stars 22 forks source link

KeyFilter Turkish Keyboard Problem #341

Closed tolgaonbay closed 8 years ago

tolgaonbay commented 9 years ago

Hi,

We found a bug in keyFilter component that is AFAIK only valid in Turkish keyboards. Some of the special characters (e.g. #, $, @, ...) can be used even if they are filtered out in the component with a valid regex. Those characters that I mentioned are generated with an AltGr key. Some of the mappings include:

AltGr + 3 => #
AltGr + 4 => $
AltGr + Q => @
AltGr + ] => ~

For example with below definition, users can enter #, $, @ characters in a Turkish keyboard.

<pe:keyFilter for="vkn" regEx="/[0-9]/i" preventPaste="false" />

You can look at the Turkish keyboard layout from http://ascii-table.com/keyboard.php/179

At the below line, e.ctrlKey and e.altKey are both true for the specified key strokes. I don't think it is a right solution, but if I remove the if condition from the script, it works like a charm. If you could tell me what this if condition is written for, I can create a fix and send it back to you guys.

https://github.com/primefaces-extensions/core/blob/master/src/main/resources/META-INF/resources/primefaces-extensions/keyfilter/0-jquery.keyfilter.js#L104

Thanks

ova2 commented 9 years ago

Thomas, what do you think, would be the patch ok?

tolgaonbay commented 9 years ago

@tandraschko @ova2 any idea?

tandraschko commented 9 years ago

Hi,

the jquery plugin is a external plugin. There is also a newer version available AFAICS: https://github.com/akzhan/jquery-keyfilter/

Could you try 1.8? If it sill doesn't work, please consider to create a issue in their github repo.

tandraschko commented 9 years ago

Any news on this?