Next: ボタンダウンイベント, Previous: クリックイベント, Up: 入力イベント [Contents][Index]
Emacsでは特別なことをしなくてもドラッグイベントを取得できます。ドラッグイベント(drag event)はユーザーがマウスボタンを押下して、ボタンをリリースする前にマウスを異なる文字位置に移動すると毎回発生します。すべてのマウスイベントと同じように、ドラッグイベントはLispではリストで表現されます。このリストは以下のように開始マウス位置と最終位置ぼ両方を記録します:
(event-type start-position end-position)
For a drag event, the name of the symbol event-type contains the
prefix ‘drag-’. For example, dragging the mouse with button 2 held
down generates a drag-mouse-2
event. The second and third elements
of the event, start-position and end-position in the foregoing
illustration, are set to the start and end positions of the drag as mouse
position lists (see クリックイベント). You can access the second element of
any mouse event in the same way. However, the drag event may end outside
the boundaries of the frame that was initially selected. In that case, the
third element’s position list contains that frame in place of a window.
‘drag-’プレフィクスは、その後に‘C-’や‘M-’のような修飾キープレフィクスが続きます。
read-key-sequence
がキーバインディングをもたず、対応するクリックイベントにキーバインディングがあるようなドラッグイベントを受け取ると、この関数はそのドラッグイベントをドラッグ開始位置でのクリックイベントに変更します。これはもし望まなければクリックイベントとドラッグイベントを区別する必要がないことを意味します。