dojo keys鍵盤按鍵

2022-09-01 11:12:12 字數 1519 閱讀 1638

dojo/keys定義常用的鍵盤鍵值表,是常量。

簡介:通常用法為:在按鍵事件中(onkeydown(event)),可以獲取到按鍵值(event.charorcode

),通過dojo/keys判斷是否為需要的按鍵。

屬性:

backspace: 8,

tab: 9,

clear: 12,

enter: 13,

shift: 16,

ctrl: 17,

alt: 18,

meta: has("webkit") ? 91 : 224, //

pause: 19,

caps_lock: 20,

escape: 27,

space: 32,

page_up: 33,

page_down: 34,

end: 35,

home: 36,

left_arrow: 37,

up_arrow: 38,

right_arrow: 39,

down_arrow: 40,

insert: 45,

delete: 46,

help: 47,

left_window: 91,

right_window: 92,

select: 93,

numpad_0: 96,

numpad_1: 97,

numpad_2: 98,

numpad_3: 99,

numpad_4: 100,

numpad_5: 101,

numpad_6: 102,

numpad_7: 103,

numpad_8: 104,

numpad_9: 105,

numpad_multiply: 106,

numpad_plus: 107,

numpad_enter: 108,

numpad_minus: 109,

numpad_period: 110,

numpad_divide: 111,

f1: 112,

f2: 113,

f3: 114,

f4: 115,

f5: 116,

f6: 117,

f7: 118,

f8: 119,

f9: 120,

f10: 121,

f11: 122,

f12: 123,

f13: 124,

f14: 125,

f15: 126,

num_lock: 144,

scroll_lock: 145,

up_dpad: 175,

down_dpad: 176,

left_dpad: 177,

right_dpad: 178,

使用方法:

switch

(charorcode)

模擬鍵盤按鍵

模擬全域性按鍵可以用keybd event,sendinput來完成,下面是模擬一次caps lock 按鍵時兩個api函式的實現方法 keybd event keybd event vk capital,0,keyeventf extendedkey 0,0 key down keybd even...

模擬鍵盤按鍵

textbox1.focus sendkeys.send v 模擬鍵盤按鍵ctrl v 貼上 鍵 backspace 或或break caps lock del或delete 或向下鍵 endenter 或 esc help home ins或insert 或向左鍵 num lock page do...

linux修改鍵盤按鍵

我的電腦 fedora 19 uname a linux localhost.localdomain 3.11.10 200.fc19.i686 1 smp mon dec 2 20 48 22 utc 2013 i686 i686 i386 gnu linux 使用xmodmap工具進行修改,使用...