OLD | NEW |
1 {{+bindTo:partials.standard_nacl_article}} | 1 {{+bindTo:partials.standard_nacl_article}} |
2 | 2 |
3 <section id="view-change-focus-and-input-events"> | 3 <section id="view-change-focus-and-input-events"> |
4 <span id="view-focus-input-events"></span><h1 id="view-change-focus-and-input-ev
ents"><span id="view-focus-input-events"></span>View Change, Focus, and Input Ev
ents</h1> | 4 <span id="view-focus-input-events"></span><h1 id="view-change-focus-and-input-ev
ents"><span id="view-focus-input-events"></span>View Change, Focus, and Input Ev
ents</h1> |
5 <div class="contents local topic" id="contents"> | 5 <div class="contents local" id="contents" style="display: none"> |
6 <ul class="small-gap"> | 6 <ul class="small-gap"> |
7 <li><a class="reference internal" href="#overview" id="id2">Overview</a></li> | 7 <li><a class="reference internal" href="#overview" id="id2">Overview</a></li> |
8 <li><p class="first"><a class="reference internal" href="#handling-browser-event
s" id="id3">Handling browser events</a></p> | 8 <li><p class="first"><a class="reference internal" href="#handling-browser-event
s" id="id3">Handling browser events</a></p> |
9 <ul class="small-gap"> | 9 <ul class="small-gap"> |
10 <li><a class="reference internal" href="#didchangeview" id="id4">DidChangeView()
</a></li> | 10 <li><a class="reference internal" href="#didchangeview" id="id4">DidChangeView()
</a></li> |
11 <li><a class="reference internal" href="#didchangefocus" id="id5">DidChangeFocus
()</a></li> | 11 <li><a class="reference internal" href="#didchangefocus" id="id5">DidChangeFocus
()</a></li> |
12 </ul> | 12 </ul> |
13 </li> | 13 </li> |
14 <li><p class="first"><a class="reference internal" href="#handling-input-events"
id="id6">Handling input events</a></p> | 14 <li><p class="first"><a class="reference internal" href="#handling-input-events"
id="id6">Handling input events</a></p> |
15 <ul class="small-gap"> | 15 <ul class="small-gap"> |
16 <li><a class="reference internal" href="#registering-a-module-to-accept-input-ev
ents" id="id7">Registering a module to accept input events</a></li> | 16 <li><a class="reference internal" href="#registering-a-module-to-accept-input-ev
ents" id="id7">Registering a module to accept input events</a></li> |
17 <li><a class="reference internal" href="#determining-and-branching-on-event-type
s" id="id8">Determining and branching on event types</a></li> | 17 <li><a class="reference internal" href="#determining-and-branching-on-event-type
s" id="id8">Determining and branching on event types</a></li> |
18 <li><a class="reference internal" href="#threading-and-blocking" id="id9">Thread
ing and blocking</a></li> | 18 <li><a class="reference internal" href="#threading-and-blocking" id="id9">Thread
ing and blocking</a></li> |
19 </ul> | 19 </ul> |
20 </li> | 20 </li> |
21 </ul> | 21 </ul> |
22 </div> | 22 |
23 <p>This chapter describes view change, focus, and input event handling for a | 23 </div><p>This chapter describes view change, focus, and input event handling for
a |
24 Native Client module. The chapter assumes you are familiar with the | 24 Native Client module. The chapter assumes you are familiar with the |
25 material presented in the <a class="reference internal" href="/native-client/ove
rview.html"><em>Technical Overview</em></a>.</p> | 25 material presented in the <a class="reference internal" href="/native-client/ove
rview.html"><em>Technical Overview</em></a>.</p> |
26 <p>There are two examples used in this chapter to illustrate basic | 26 <p>There are two examples used in this chapter to illustrate basic |
27 programming techniques. The <code>input_events</code> example is used to | 27 programming techniques. The <code>input_events</code> example is used to |
28 illustrate how your module can react to keyboard and mouse input | 28 illustrate how your module can react to keyboard and mouse input |
29 event. The <code>mouse_lock</code> example is used to illustrate how your modul
e | 29 event. The <code>mouse_lock</code> example is used to illustrate how your modul
e |
30 can react to view change events. You can find these examples in the | 30 can react to view change events. You can find these examples in the |
31 <code>/examples/api/input_events</code> and <code>/examples/api/mouse_lock</code
> | 31 <code>/examples/api/input_events</code> and <code>/examples/api/mouse_lock</code
> |
32 directories in the Native Client SDK. There is also the | 32 directories in the Native Client SDK. There is also the |
33 ppapi_simple library that can be used to to implement most of the | 33 ppapi_simple library that can be used to to implement most of the |
(...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
336 <h3 id="threading-and-blocking">Threading and blocking</h3> | 336 <h3 id="threading-and-blocking">Threading and blocking</h3> |
337 <p><code>HandleInputEvent()</code> in this example runs on the main module threa
d. | 337 <p><code>HandleInputEvent()</code> in this example runs on the main module threa
d. |
338 However, the bulk of the work happens on a separate worker thread (see | 338 However, the bulk of the work happens on a separate worker thread (see |
339 <code>ProcessEventOnWorkerThread</code>). <code>HandleInputEvent()</code> puts e
vents in | 339 <code>ProcessEventOnWorkerThread</code>). <code>HandleInputEvent()</code> puts e
vents in |
340 the <code>event_queue_</code> and the worker thread takes events from the | 340 the <code>event_queue_</code> and the worker thread takes events from the |
341 <code>event_queue_</code>. This processing happens independently of the main | 341 <code>event_queue_</code>. This processing happens independently of the main |
342 thread, so as not to slow down the browser.</p> | 342 thread, so as not to slow down the browser.</p> |
343 </section></section></section> | 343 </section></section></section> |
344 | 344 |
345 {{/partials.standard_nacl_article}} | 345 {{/partials.standard_nacl_article}} |
OLD | NEW |