提问人:Karthi A 提问时间:10/3/2023 最后编辑:freedomn-mKarthi A 更新时间:10/3/2023 访问量:16
我需要使用 jquery 在英语键盘布局和日语键盘布局之间给出条件
I need to give condition between english keyboard layout and japanese keyboard layout using jquery
问:
以下代码条件是日语键盘键码,如果我更改英语键盘布局,它需要工作。
$('input,textarea,div#editorId').on('keydown', function(e) {
if ((e.shiftKey == false && e.keyCode == 220) || (e.shiftKey == false && e.keyCode == 226)) {
Swal.fire({
type: "info",
html: "BackSlash is not allowed",
confirmButtonClass: "btn btn-success"
})
} else if ((e.shiftKey == true && e.keyCode == 192) || (e.shiftKey == true && e.keyCode == 50) || (e.shiftKey == true && e.keyCode == 55)) {
Swal.fire({
type: "info",
html: "Double and Single Quotes are not allowed",
confirmButtonClass: "btn btn-success"
})
} else if (e.shiftKey == false && e.keyCode == 188) {
Swal.fire({
type: "info",
html: "Comma is not allowed",
confirmButtonClass: "btn btn-success"
})
}
});
答: 暂无答案
评论
input