Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Motion actuation failure #845

Merged
merged 20 commits into from
Sep 12, 2019
Merged
Show file tree
Hide file tree
Changes from 14 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 61 additions & 0 deletions techniques/general/GXX_motionactuationfailure.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
<head>
<title>Failure due to inability to deactivate motion actuation</title>
<link rel="stylesheet" type="text/css" href="../../css/editors.css"/>
</head>
<body>
<h1>Failure due to inability to deactivate motion actuation</h1>
<section id="meta">
<h2>Metadata</h2>
<p id="id"></p>
<p id="technology"></p>
<p id="type"></p>
</section>
<section id="applicability">
<h2>Applicability</h2>
<p>Content using technologies that can support the detection of device or user motion such as shaking or tilting and use these motions as a means of input.</p>
</section>
<section id="description">
<h2>Description</h2>
<p>This describes the failure condition that results when motion actuation can not be deactivated. People who may accidentally activate sensors due to tremors or other motor impairments need the ability to turn off motion actuation to prevent such accidental triggering of functions. </p>
patrickhlauke marked this conversation as resolved.
Show resolved Hide resolved
<p>The type of motion covered by the <a href="../../guidelines/sc/21/motion-actuation.html">Motion Actuation Success Criterion</a> does not relate to the movement of users through space as registered by geolocation sensors or beacons, or events observed by the device other than intentional gesturing by the user. It also does not cover indirect motion associated with operating a keyboard, pointer, or assistive technology.</p>

</section>
<section id="examples">
<h2>Examples</h2>

<section class="example">
<h3>Motion Activated Slider</h3>
<p>Description</p>
<code>Code sample</code>
<p class="working-example"><a href="../../working-examples/motion-actuation-failure/">Working example of a motion activated slider that can not be deactivated</a></p>
</section>
</section>
<section id="tests">
<h2>Tests</h2>
<section class="test-procedure">
<h3>Procedure</h3>
<p>For each function that is triggered by a motion sensor:</p>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@awkawk I updated the procedure to account for the exceptions in the SC text, if it impacts what you were going to look at for the other failures?

<ol>
<li>Check if the use of a motion sensor is essential.</li>
<li>Check if there is an accessibility supported interface to trigger the function.</li>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@patrickhlauke I'm not entirely sure I understand what an accessibility interface for this would be, does the procedure for motion actuation make sense? (Mainly item 2)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

some OSs offer some accessibility options that can fake motion (mapped to a button or similar instead), i believe. might be that sort of thing this is referring/alluding to?

<li>Check if there is a user setting which disables the motion detection.<li>
</ol>
</section>
<section class="test-results">
<h3>Expected Results</h3>
<ul>
<li>If #1, 2 and 3 are false then the control fails this success criteria. </li>
</ul>

</section>
</section>
<section id="related">
<h2>Related Techniques</h2>
<ul>
<li>GX213: Provide conventional controls and an application setting for motion activated input</li>
</ul>
</section>
</body>
</html>
55 changes: 55 additions & 0 deletions working-examples/device-motion-sensor-input-failure/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
<!DOCTYPE html>
<html>
<head>
<style type="text/css">

.slidecontainer {
width:100%;
}
</style>

<title>WCAG Failure Example of Motion Sensor</title>
</head>
<body>

<pre class="output"></pre>

<h1>Slider Motion Sensor Failure Example </h1>

<p>Open this slider on a device with a motion sensor, such as a smart phone or tablet. Tilt the device to the right and left to adjust the slider value. The decrease and increase buttons also adjust the value. There is no way to deactivate the motion sensor. </p>
<p>Note: This example may not work across all browsers.</p>

<div class="slidecontainer">
<button type="button" name="decrease" onclick="decreaseFunction()">Decrease Value</button>
<input type="range" min="1" max="100" value="50" class="slider" id="motionSlider">
<button type="button" name="increase" onclick="increaseFunction()">Increase Value</button>
<p aria-live="polite">Slider Value: <span id="demo"></span></p>
</div>

<script>

//slider behavior
var slider = document.getElementById("motionSlider");
var output = document.getElementById("demo");
output.innerHTML = slider.value;
slider.oninput = function() {
output.innerHTML = this.value;
}

function increaseFunction() {slider.value++; output.innerHTML = slider.value;}
function decreaseFunction() {slider.value--; output.innerHTML = slider.value;}

//slider motion detection
function handleOrientation(event) {

var x = event.gamma;

if (x > 20) {slider.value++; output.innerHTML = slider.value;}
else if (x < -20) {slider.value--; output.innerHTML = slider.value;} }


window.addEventListener('deviceorientation', handleOrientation);

</script>
</body>
</html>