<h1>AOM Input Event Types</h1>

<pre class="metadata">
Shortname: aom-input-events
Level:
Group: webplatform
Status: UD
TR: https://wicg.github.io/aom/spec/input-events.html
ED: https://wicg.github.io/aom/spec/input-events.html
Repository: wicg/aom
Editor: Alice Boxhall, Google, aboxhall@google.com
Editor: Gary Kacmarcik, Google, garykac@google.com
Abstract:
	This specification defines additional {{inputType}} values for the {{beforeinput}} and
	{{input}} events that are required for the Accessibility Object Model [[!AOM]].
	This specification builds on the UI events spec [UI-EVENTS].
Status Text: <p> <strong>Changes to this document may be tracked at <a href="https://github.com/wicg/aom">https://github.com/wicg/aom</a>.</strong> </p>
</pre>

<pre class="anchors">
urlPrefix: http://www.w3.org/TR/uievents/#interface-; type: interface; spec: uievents;
	text: KeyboardEvent
urlPrefix: http://www.w3.org/TR/uievents/#event-type-; type: interface; spec: uievents;
	text: beforeinput
	text: input
urlPrefix: http://www.w3.org/TR/uievents-code/#code-; type: dfn; spec: uievents-code;
	text: ArrowUp
	text: ArrowDown
	text: ArrowLeft
	text: ArrowRight
</pre>

<pre class="biblio">
{
	"AOM": {
		"title": "Accessibility Object Model",
		"href": "https://wicg.github.io/aom/spec/",
		"authors": [ "A. Boxhall", "J. Craig", "D. Mazzoni", "A. Surkov" ]
	}
}
</pre>

<h2 id="secintro">Introduction</h2>

	<i>This section is non-normative.</i>

	Input events will be triggered by certain user interactions,
        in certain contexts,
        as well as via assistive technology interactions.

<h2 id="Cases">Use Cases</h2>

	<i>This section is non-normative.</i>

	<h3 id="use-case-1">Implementing an ARIA slider</h3>
	
		TODO: Use case
		
<h2 id="input-events">Input Events</h2>

	The [[UIEVENTS]] specification defines the {{InputEvent}} type which is used by the 
	{{beforeinput}} and {{input}} events.
	
	<h3 id="input-event-interfaces">Input event interfaces</h3>

		The {{InputEvent}} interface extends the {{Event}} interface.

		<div id="inputevent-idl">

		<pre class="idl" data-highlight="webidl">
		partial interface InputEvent : UIEvent {
		  readonly attribute DOMString? inputType;
		  <!-- TODO: add AOM-specific attributes here -->
		};
		</pre>

		: <dfn for="InputEvent">inputType</dfn>
		:: A {{DataTransfer}} object to hold data and meta data related to the event.

		Note: The IDL for {{inputType}} should be moved into [[UIEVENTS]] so that
		it can be shared between this spec and the
		<a href="https://www.w3.org/TR/input-events-2/">Input Events Level 2</a> spec.
		</div>

	<h3 id="aom-input-event-types"><dfn>Input Event Types</dfn></h3>

		<h4 id="type-action-increment"><dfn>actionIncrement</dfn></h4>

			An {{InputEvent}} event with {{inputType}} set to [=actionIncrement=] fires in
			response to an input action that increments a control. For example, as a
			result of a [=ArrowRight=] or [=ArrowUp=] key press.

			This event type is valid for the following roles:
			* "progressbar"
			* "scrollbar"
			* "slider"
			* "spinbutton"

		<h4 id="type-action-decrement"><dfn>actionDecrement</dfn></h4>

			An {{InputEvent}} event with {{inputType}} set to [=actionDecrement=] fires in
			response to an input action that increments a control. For example, as a
			result of a [=ArrowLeft=] or [=ArrowDown=] key press.

			This event type is valid for the following roles:
			* "progressbar"
			* "scrollbar"
			* "slider"
			* "spinbutton"

		<h4 id="type-action-dismiss"><dfn>actionDismiss</dfn></h4>

			An {{InputEvent}} event with {{inputType}} set to [=actionDismiss=] fires when
			a dialog or other dismissable ACTION element is closed.

			This event type is valid for the following roles:			
			* "menu"
			* "dialog"
			* "alertdialog"

		<h4 id="type-action-scrollpageup"><dfn>actionScrollPageUp</dfn></h4>

			An {{InputEvent}} event with {{inputType}} set to [=actionScrollPageUp=] fires
			when user requests the current content to scroll up (or right) by a "page",
			where a page of data is typically equal to one screen.
			
			This type differs from [=actionIncrement=] in that it applies only to scrollable
			content.

			This event type is intended for scrollable content, but is valid for all
			roles (since it can bubble up to the `body` element, which is scrollable).

		<h4 id="type-action-scrollpagedown"><dfn>actionScrollPageDown</dfn></h4>

			An {{InputEvent}} event with {{inputType}} set to [=actionScrollPageDown=] fires
			when user requests the current content to scroll down (or left) by a "page",
			where a page of data is typically equal to one screen.
			
			This type differs from [=actionDecrement=] in that it applies only to scrollable
			content.

			This event type is intended for scrollable content, but is valid for all
			roles (since it can bubble up to the `body` element, which is scrollable).

<h2 id="security">Security Considerations</h2>

	Not applicable. This specification simply adds new possible values for an
	existing {{InputEvent}} attribute.
	
<h2 id="privacy">Privacy Considerations</h2>

	Not applicable. This specification defines new {{inputType}} values that will be
	sent for all users, not just those with accessibility features enabled.

<h2 id="acknowledge">Acknowledgements</h2>

	<em>This section is non-normative</em>

	We would like to acknowledge the contributions made by the following:

        Dominic Mazzoni,
        Ian Pouncey,
	James Craig,
        James Teh,
        Jeffrey Yasskin,
	and Léonie Watson.
