iCab doesn't support the key events at all. Many thanks to Hallvord Steen for his summary of the key events in Windows browsers; his page saved me quite a bit of work. Detecting the user's keystrokes turns out to be a rather specialised branch of event handling. This page details some of the more obnoxious problems, and gives the inevitable compatibility table. The first problem is that there is n
イベントリスナの登録 document.addEventListener('keydown', function (e) { // 処理 }, false); 他にkeypressってのもあるけど、keydownをお勧め。 理由は確かGoogle chromeでkeypressにすると、Ctrl+a(全て選択)のようにデフォルトで別動作が定義されていた場合にそちらが先に動いてしまうため(だったはず)。 押されたキーの取得 var shortcutKey = 'a'; document.addEventListener('keydown', function (e) { var pressed = String.fromCharCode(e.which).toLowerCase(); pressed = (e.ctrlKey ? 'C-' : '') + (e.altKey ? 'A-' :
Note: I have stopped updating this page. At this point nearly all popular browsers are have achieved a good level of compatibility on most of these features, and their behavior with respect to them just isn't changing much anymore. The only thing web designers really need to still watch out for is IE8, which is lingering due to the fact that it is the best version of IE that works on windows XP. (
Despite the many JavaScript libraries that are available today, I cannot find one that makes it easy to add keyboard shortcuts(or accelerators) to your javascript app. This is because keyboard shortcuts where only used in JavaScript games - no serious web application used keyboard shortcuts to navigate around its interface. But Google apps like Google Reader and Gmail changed that. So, I have crea
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く