Next: , Previous: , Up: 入力イベント   [Contents][Index]


22.7.5 ドラッグイベント

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がキーバインディングをもたず、対応するクリックイベントにキーバインディングがあるようなドラッグイベントを受け取ると、この関数はそのドラッグイベントをドラッグ開始位置でのクリックイベントに変更します。これはもし望まなければクリックイベントとドラッグイベントを区別する必要がないことを意味します。

This page has generated for branch:master, commit:762705fb24fd90db318f2e51c1e762452d26f7e2 to check Japanese translation.