* 仕様書

[REFS[
- [34] [CITE@en[UI Events]] ([TIME[2016-04-03 11:58:10 +09:00]] 版) 
<https://w3c.github.io/uievents/>
]REFS]

* 入力装置関係のイベントと API

[27] [[イベント]]や [[API]]:

[FIG(short list)[
- [CODE(DOMi)@en[[[MouseEvent]]]]
- [[Touch Events]]
- [[Pointer Events]]
- [[Gesture Events]]
- [[Mouse gesture events]]
- [CODE(DOMi)@en[[[KeyboardEvent]]]]
- [CODE(DOMi)@en[[[TextEvent]]]]
- [CODE(DOMi)@en[[[FocusEvent]]]], [CODE(HTMLa)@en[[[tabindex]]]], [CODE(CSS)@en[[[nav-*]]]]
- [CODE(HTMLa)@en[[[accesskey]]]], [CODE(CSS)@en[[[key-equivalent]]]]
- [[IndieUI]]
- [CODE(DOMa)@en[[[wiiremote]]]]
- [[IME API]]
- [CODE(HTMLa)@en[[[inputmode]]]]
- [CODE(CSS)@en[[[ime-mode]]]]
- [[Pointer Lock]]
]FIG]

[28] [[利用者インターフェイス]]操作:
[FIG(short list)[
- [[鍵盤操作 (Webブラウザー)]]
- [[マウス操作 (Webブラウザー)]]
-- [[クリック]]
-- [[ドラッグアンドドロップ]]
-- [[マウスジェスチャー]]
]FIG]

[51] [[利用者]]の操作に起因することを表す概念:
[FIG(short list)[
- [[triggered by user activation]]
- [[engagement gesture]]
]FIG]

[35] 操作は、[[プラットフォーム]]次第で、物理的な[[装置]]に由来することもあれば、
[[ソフトウェア]]によってエミュレートされている
([[ソフトウェアキーボード]]や[[アクセス可能性]]機能など。) こともあります。
あるいは、 [[WebDriver]] のような [[Webブラウザー]]操作機能に由来することもあります。

* 著者による利用者操作の妨害

[31] [[著者]]の[[スクリプト]]により次のような[[イベント]]の[[既定動作]]を[[取消]]するなどの方法で、
[[利用者]]の操作が妨害されることがあります。
[[Webブラウザー]]は、そのような妨害を受けずに[[利用者]]の操作を受け付ける方法を用意するべきです。

[FIG(list)[
- [CODE(DOMe)@en[[[contextmenu]]]] [[イベント]] - [[Webブラウザー]]の[[文脈メニュー]]の表示を妨害する
- [CODE(DOMe)@en[[[copy]]]] [[イベント]]、[CODE(DOMe)@en[[[cut]]]] [[イベント]]、
[CODE(DOMe)@en[[[paste]]]] [[イベント]] - [[クリップボード]]操作を拒絶する
- [CODE(DOMe)@en[[[select]]]] [[イベント]]、[CODE(DOMe)@en[[[selectstart]]]] [[イベント]]、[CODE(DOMe)@en[[[drag]]]] [[イベント]]、[CODE(DOMe)@en[[[dragstart]]]] [[イベント]] - [[選択]]操作を妨害する
- [[キーボードイベント]] - [[再読込]]、[[戻る]]などの操作を妨害する
- [[キーボードイベント]] [KBD[[KBD[[[Ctrl]]]] + [KBD[[[F]]]]]] - [[検索]]を (低品質に) 独自実装する
- [CODE(HTML)@en[[[<meta name=viewport>]]]] - [[拡大]]・[[縮小]]操作を拒絶する
- [CODE(CSS)@en[[[scrollbar-[VAR[*]]]]]] - [[スクロールバー]]を細くして[[利用者]]が操作しづらくする
- [CODE(CSS)@en[[[overflow]]: [[hidden]]]] - [[スクロール]]を拒絶する
- [CODE(DOMe)@en[[[pushState]]]]: [[履歴]]操作を妨害する
]FIG]

[32] [[著者]]は、こうした[[利用者]]の通常の閲覧操作に介入するべきではありません。

[49] [[Pointer Lock]] も[[利用者]]の妨害に使われる危険性がありますが、
できるだけ有害にならないよう、ある程度は配慮されています。

[EG[
[50] [[Dropbox]] の [[Webサイト]]は、[[マウス操作]] ([[選択]]など)、
[[キーボード操作]] ([KBD[Ctrl]] + 何かの[[キーボードショートカット]]など)、
[[文脈メニュー]]など [[Webブラウザー]]のあらゆる標準的な操作を取り消しし、
独自の [[UI]] の実装に当てています。おそらく[[ネイティブアプリケーション]]の使い勝手に合わせるためなのでしょうが、
[[Webアプリケーション]]としては当たり前の操作ができずに逆に使いにくいです。
例えば[[ファイル名]]の[[コピー]]もできません。
]EG]

[54] 他にも[[利用者]]の操作を妨害する方法はあります。例えば[[利用者]]の意思に反した[[スクロール]]を[[著者]]の[[スクリプト]]が強制するかもしれません。
[[Webブラウザー]]がそうした状況を判定して抑制するのは難しいかもしれません。

* [CODE(DOMi)@en[UIEvent]] インターフェイス (DOM)

** 仕様書

[REFS[
- [9] [CITE@en-US[Document Object Model (DOM) Level 3 Events Specification]] ([TIME[2012-10-25 23:58:38 +09:00]] 版) <http://dev.w3.org/2006/webapi/DOM-Level-3-Events/html/DOM3-Events.html#events-UIEvent>
- [8] [CITE@en[UI Events]] ([TIME[2013-05-08 13:22:50 +09:00]] 版) <https://dvcs.w3.org/hg/d4e/raw-file/tip/source_respec.htm#constructor-uievent>
]REFS]

** 状態

[36] [CODE(DOMi)@en[Event]] の共通の状態に加えて:
[FIG(list members)[
: [F[実際の指示装置由来かどうか]] :
[[ハイパーリンク接尾辞]]の決定に使われます。 [F[trusted]] と同義なのかどうかは定かではありません。
それに加えて[[鍵盤]]操作による擬似[[クリック]]を除外する意図もありそうです。
]FIG]

* 歴史

[17] 利用者界面イベント。外部機器 ([[マウス]], [[鍵盤]]等) による利用者の動作により発生する。 (''Document Object Model Events'' <http://www.w3.org/TR/DOM-Level-2-Events/events.html#Events-overview-terminology>)

[1] 【DOM】[[外部機器]] ([[マウス]], [[鍵盤]]等) 
による[[利用者]]の動作により発生する[[事象]]。UI Event。

[2] [[DOM2]] UI Events がその最初の仕様。ただし [[DOM0]] の [[on*]] 
属性/特性がその祖先に当たる。 (直接的には互換性はないが、
仕様策定上矛盾がないようには配慮されている。[WEAK[ちなみに、 on* 属性群の直接の子孫に当たるのが [[XMLEvent]]。つまり、事象の振る舞いとしての定義は DOM へ、記述方法としてのマークは XML Event が後継規格。]])

[3] DOM 2 が [[WinIE]] でなかなか実装されないのは [[Netscape]] 
の提案に大幅に基づいているからだという噂があるが、 UI 事象の部は特に 
Netscape の影響が強い。 M$ は 永遠に実装しない気だろうか?

** 旧 UI イベント仕様書

[5] [CITE@en[UI Events]]
( ([TIME[2013-02-10 17:04:08 +09:00]] 版))
<https://dvcs.w3.org/hg/d4e/raw-file/tip/source_respec.htm>

[REFS[
-[6] [CITE@en[Re: "DOM4 Events" name (was: RE: ReSpec BiblioDB Entry for DOM Level  4 Events)]]
( ([[Anne van Kesteren]] 著, [TIME[2013-01-08 03:57:19 +09:00]] 版))
<http://lists.w3.org/Archives/Public/www-dom/2013JanMar/0022.html>
-[7] [CITE@en[Re: ReSpec BiblioDB Entry for DOM Level 4 Events]]
( ([[Anne van Kesteren]] 著, [TIME[2013-01-05 20:55:32 +09:00]] 版))
<http://lists.w3.org/Archives/Public/www-dom/2013JanMar/0002.html>
]REFS]

[10] [CITE@en[UI Events]]
( ([TIME[2013-07-25 05:49:20 +09:00]] 版))
<http://www.w3.org/TR/2013/WD-uievents-20130725/>

[11] [CITE[IRC logs: freenode / #whatwg / 20131024]]
( ([TIME[2013-10-26 18:11:45 +09:00]] 版))
<http://krijnhoetmer.nl/irc-logs/whatwg/20131024>

[12] [CITE@en[UI Events]]
( ([TIME[2013-11-05 13:57:17 +09:00]] 版))
<http://www.w3.org/TR/2013/WD-uievents-20131105/>

[13] [CITE@en[UI Events]]
( ([[Anne van Kesteren]] 著, [TIME[2014-02-04 22:30:44 +09:00]] 版))
<http://lists.w3.org/Archives/Public/www-dom/2014JanMar/0064.html>

[14] [CITE@en[Re: Pointer Events spec and UIEvents reference]]
( ([[Кошмарчик]] 著, [TIME[2014-04-19 02:34:55 +09:00]] 版))
<http://lists.w3.org/Archives/Public/public-pointer-events/2014AprJun/0033.html>

[15] [CITE@en[Web input brainstorming face-to-face notes]]
( ([[Rick Byers]] 著, [TIME[2014-07-03 22:51:48 +09:00]] 版))
<http://lists.w3.org/Archives/Public/www-style/2014Jul/0050.html>

[16] [CITE[IRC logs: freenode / #whatwg / 20140729]]
( ([TIME[2014-07-30 09:45:34 +09:00]] 版))
<http://krijnhoetmer.nl/irc-logs/whatwg/20140729>

[18] [CITE[IRC logs: freenode / #whatwg / 20121128]]
( ([TIME[2012-12-09 02:18:35 +09:00]] 版))
<http://krijnhoetmer.nl/irc-logs/whatwg/20121128#l-1719>


[19] [CITE@en[Web Applications 1.0 r8697     Make sure places that use UIEvent define .detail and .view]]
( ([TIME[2014-08-02 07:04:00 +09:00]] 版))
<http://html5.org/r/8697>

[20] [CITE@en[RE: "DOM4 Events" name (was: RE: ReSpec BiblioDB Entry for DOM  Level 4 Events)]]
( ([[Travis Leithead]] 著, [TIME[2013-01-08 04:48:50 +09:00]] 版))
<http://lists.w3.org/Archives/Public/www-dom/2013JanMar/0025.html>

** D3E との統合

[21] [CITE@en[Re: CfC: publish WG Note of UI Events; deadline November 14]]
( ([[Anne van Kesteren]] 著, [TIME[2014-11-08 00:36:03 +09:00]] 版))
<http://lists.w3.org/Archives/Public/public-webapps/2014OctDec/0344.html>

[4] [CITE@en[''''''[''''''UIEvents'''''']'''''' telecon minutes 10 March 2015]]
([[Travis Leithead]] 著, [TIME[2015-03-11 10:03:54 +09:00]] 版)
<https://lists.w3.org/Archives/Public/public-webapps/2015JanMar/0776.html>

[22] [CITE@en[Re: CfC: publish WG Note of UI Events; deadline November 14]]
([[Arthur Barstow]] 著, [TIME[2015-03-12 22:23:52 +09:00]] 版)
<https://lists.w3.org/Archives/Public/public-webapps/2015JanMar/0786.html>

[23] [CITE@en[UI Events (Keyboard Extension)]]
([TIME[2015-03-12 01:03:08 +09:00]] 版)
<http://jay.w3.org/~plehegar/uievents-ext.html>

[24] [CITE@en-US[UI Events Specification (formerly DOM Level 3 Events)]]
([TIME[2015-03-12 06:17:38 +09:00]] 版)
<http://jay.w3.org/~plehegar/uievents.html>

[25] [CITE@en-US[UI Events (formerly DOM Level 3 Events)]]
( ([TIME[2015-03-19 05:12:23 +09:00]] 版))
<http://www.w3.org/TR/2015/WD-uievents-20150319/>

[26] <http://www.w3.org/TR/DOM-Level-3-Events/> も >>25 を指すようになりました。
[TIME[2015-03-20T01:50:20.500Z]]

[29] [CITE@en-US[UI Events (formerly DOM Level 3 Events)]]
( ([TIME[2015-04-25 02:33:53 +09:00]] 版))
<http://www.w3.org/TR/2015/WD-uievents-20150428/>

[30] [CITE@en[Update D3Events reference to UI Events · whatwg/html@9cbeb03]]
([TIME[2015-09-03 14:36:16 +09:00]] 版)
<https://github.com/whatwg/html/commit/9cbeb03959c06541651fcf2a8c3a00a665b79d26>

[33] [CITE@en[Fix #19: Remove majority of "DOM Event Architecture" section · w3c/uievents@6cb42db]]
([TIME[2016-03-08 18:11:37 +09:00]] 版)
<https://github.com/w3c/uievents/commit/6cb42db4054c5502d28c3f53c6ae64da5e475747>

[FIG(quote)[
[FIGCAPTION[
[37] [CITE@ja[Johnny's net]]
([TIME[2016-08-14 01:17:41 +09:00]])
<http://www.johnnys-net.jp/page?id=text&dataId=1110>
]FIGCAPTION]

> $(document).on("contextmenu",function(){return!1}),$(document).on("keydown",function(){if("undefined"===typeof KEY_ENABLE)return!1}

]FIG]


[38] [CITE@en[Infrastructure for actions dispatch and implementation for null and k…]]
([[jgraham]]著, [TIME[2016-09-13 05:57:58 +09:00]])
<https://github.com/w3c/webdriver/commit/e70ea24e65883b404f2a72166ddaa0d1211905a7>

[39] [CITE@en[UI Event Order]]
([TIME[2016-09-23 16:47:43 +09:00]])
<https://rawgit.com/garykac/event-order/master/index.html>

[40] [CITE@en[garykac/event-order]]
([TIME[2016-09-23 16:47:52 +09:00]])
<https://github.com/garykac/event-order>

[41] [CITE@en['''['''ui-events''']''' MouseEvent details]]
([[Anne van Kesteren]]著, [TIME[2013-02-13 00:07:13 +09:00]])
<https://lists.w3.org/Archives/Public/www-dom/2013JanMar/0128.html>

[42] [CITE@en[UI Events]]
([[Anne van Kesteren]]著, [TIME[2014-02-04 22:30:44 +09:00]])
<https://lists.w3.org/Archives/Public/www-dom/2014JanMar/0064.html>

[43] [CITE@en[When the events are fired seems strange · Issue #9 · w3c/input-events]]
([TIME[2016-09-29 11:00:09 +09:00]])
<https://github.com/w3c/input-events/issues/9>

[44] [CITE@en[Consider pointerup as user gesture by NavidZ · Pull Request #1875 · whatwg/html]]
([TIME[2016-10-13 13:00:12 +09:00]])
<https://github.com/whatwg/html/pull/1875>

[45] [CITE@en[Specify the Event Loop integration for various non-deprecated events, incl. hit testing · Issue #23 · w3c/uievents]]
([TIME[2016-10-21 16:16:57 +09:00]])
<https://github.com/w3c/uievents/issues/23>

[46] [CITE@en[Lack of interaction event specification · Issue #1927 · whatwg/html]]
([TIME[2016-10-21 16:17:15 +09:00]])
<https://github.com/whatwg/html/issues/1927>

[47] [CITE@en[Editorial: major cleanup around firing and dispatching events]]
([[annevk]]著, [TIME[2016-10-19 01:00:43 +09:00]])
<https://github.com/whatwg/html/commit/8ffbd146d4709057e45dd6cfc81e7a70897050c5>

[48] [CITE@en[Align activation behavior with changes to DOM Standard]]
([[annevk]]著, [TIME[2016-10-21 00:06:40 +09:00]])
<https://github.com/whatwg/html/commit/7beb920ba2e1a71246b81d86005f223a0d7ac8ab>

[52] [CITE@en[CFC: Move UI Events KeyboardEvent Code Values to CR · Issue #16 · w3c/uievents-code]]
([TIME[2017-03-11 14:32:11 +09:00]])
<https://github.com/w3c/uievents-code/issues/16>

[53] [CITE@en[CFC: Move UI Events KeyboardEvent Key Values to CR · Issue #42 · w3c/uievents-key]]
([TIME[2017-03-11 14:32:24 +09:00]])
<https://github.com/w3c/uievents-key/issues/42>

[55] [CITE@en[Re: Update on UI Events specs]]
([[Кошмарчик]]著, [TIME[2017-04-14 09:09:43 +09:00]])
<https://lists.w3.org/Archives/Public/public-webapps/2017AprJun/0030.html>

[56] [CITE@en[Synthetic click activation steps should state whether the event is composed or not · Issue #578 · w3c/webcomponents]]
([TIME[2017-09-09 16:19:42 +09:00]])
<https://github.com/w3c/webcomponents/issues/578>

[57] [CITE@en[Fix #159: Add '''['''Exposed''']''' to interfaces]]
([[garykac]]著, [TIME[2017-09-16 02:51:46 +09:00]])
<https://github.com/w3c/uievents/commit/1078d03d4a3539d16f22cc39dc31afb901f5a44f>

[58] [CITE@en[Merge pull request #163 from foolip/patch-1]]
([[garykac]]著, [TIME[2017-10-19 01:26:04 +09:00]])
<https://github.com/w3c/uievents/commit/0ebef2d9be3bdbf09288aae25841efe32cf90cec>

[59] [CITE@en[Merge pull request #178 from TakayoshiKochi/note]]
([[TakayoshiKochi]]著, [TIME[2018-05-15 15:56:44 +09:00]])
<https://github.com/w3c/uievents/commit/d507788644c8ed39ad762212c9a27510331fdee3>

[60] [CITE@en[Add a note about inheritance of UIEvent. by TakayoshiKochi · Pull Request #178 · w3c/uievents]]
([TIME[2018-05-16 14:06:23 +09:00]])
<https://github.com/w3c/uievents/pull/178>

[61] [CITE@en[Define each event type is composed or not, update the spec · Issue #61 · w3c/clipboard-apis]]
([TIME[2018-05-16 14:12:46 +09:00]])
<https://github.com/w3c/clipboard-apis/issues/61>


[62] 
[CITE@en[Pointerevents+UI events by plehegar · Pull Request #564 · w3c/pointerevents · GitHub]], [TIME[2026-01-23T01:34:01.000Z]] <https://github.com/w3c/pointerevents/pull/564>

