最近キーボードショートカットの実装をしようと思ってキー入力によるイベント周りについて調べてみたのだけれど、日本語でまとまった情報が見つからなかったので、キーボードショートカットの実装に必要そうな内容を簡単にまとめておこうと思う。 キーボードショートカットに限らず、キー入力によるイベント周りの何かをする場合には参考になると思う。 本記事では、DOM 3 Events spec の 2012-09-06 の版を参照しており、将来の版では変更されている可能性がある。 最新の版は下記リンクから確認のこと。 Document Object Model (DOM) Level 3 Events Specification (DOM 3 Events spec の最新安定板) keydown イベント、keypress イベント、keyup イベントについて keydown イベント は、キーが押された
「キーボード配列QWERTYの謎」という本を読んだ。タイプライターのキー配列がQWERTY配列になっていく過程と、QWERTY配列をめぐる嘘がなぜ広まったかを描いている。 私はこの本を、現在に重ね合わせながら読んだ。本書はQWERTY配列の誕生をめぐるデマを否定するために、タイプライターが発明され普及していくまでを詳細に論じているのだが、この部分が、19世紀末のメディア産業をめぐるテクノロジー競争の紹介にもなっている。 例えば、タイプライターの発明者でありながら主導権をとれず、それでも一生をタイプライターの改良に捧げたクリストファー・レイサム・ショールズは1840年、18歳の時にウィスコンシン準州グリーン・ベイのウィスコンシン・デモクラット紙の編集者として出発し、後に自ら創刊したサウスポート・テレグラフ紙の編集長となった新聞人だ。ショールズがタイプライターの開発を始めたのは、新聞製作の効率
この記事はVim Advent Calendar 2012の153日目の記事です。 152日目はmanga_osyoさんによるVim で現在の検索位置を表示するでした。 vimをある程度使うようになると、ある操作(機能)を素早く呼び出すためなどでキーマップを設定するようになります。 ですが、数あるキーの中でどのキーに機能を割り当てるか結構頭を悩ませることが多いかと思います。 ちゃんと既存のキーの機能を意識して割り当てられれば良いですが、たまに「えっ、そのキー潰しちゃうの?」と思うような キーを潰しているのを見かけます(出典:vimrc読書会にて)。 意図してやっているならいいですが、わからぬまま重要なキーを潰してその機能を全く使わないという結構もったいないものです。 そこで、キーマッピングする際に考えたほうがいいことを記述したいと思います。 いつキーマッピングするか? まずはどういう時にキ
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く