| OLD | NEW |
| 1 {{+bindTo:partials.standard_nacl_api}} | 1 {{+bindTo:partials.standard_nacl_api}} |
| 2 | 2 |
| 3 <section id="view-change-focus-and-input-events"> | 3 <section id="view-change-focus-and-input-events"> |
| 4 <h1 id="view-change-focus-and-input-events">View Change, Focus, and Input Events
</h1> | 4 <h1 id="view-change-focus-and-input-events">View Change, Focus, and Input Events
</h1> |
| 5 <div class="contents local" id="contents" style="display: none"> | 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 | 22 |
| 23 </div><p>This chapter describes view change, focus, and input event handling for
a | 23 </div><p>This section 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 section 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 section 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 |
| 34 boiler plate. The <code>pi_generator</code> example in | 34 boiler plate. The <code>pi_generator</code> example in |
| 35 <code>/examples/demo/pi_generator</code> uses ppapi_simple to manage view | 35 <code>/examples/demo/pi_generator</code> uses ppapi_simple to manage view |
| 36 change events and 2D graphics.</p> | 36 change events and 2D graphics.</p> |
| (...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 334 <h3 id="threading-and-blocking">Threading and blocking</h3> | 334 <h3 id="threading-and-blocking">Threading and blocking</h3> |
| 335 <p><code>HandleInputEvent()</code> in this example runs on the main module threa
d. | 335 <p><code>HandleInputEvent()</code> in this example runs on the main module threa
d. |
| 336 However, the bulk of the work happens on a separate worker thread (see | 336 However, the bulk of the work happens on a separate worker thread (see |
| 337 <code>ProcessEventOnWorkerThread</code>). <code>HandleInputEvent()</code> puts e
vents in | 337 <code>ProcessEventOnWorkerThread</code>). <code>HandleInputEvent()</code> puts e
vents in |
| 338 the <code>event_queue_</code> and the worker thread takes events from the | 338 the <code>event_queue_</code> and the worker thread takes events from the |
| 339 <code>event_queue_</code>. This processing happens independently of the main | 339 <code>event_queue_</code>. This processing happens independently of the main |
| 340 thread, so as not to slow down the browser.</p> | 340 thread, so as not to slow down the browser.</p> |
| 341 </section></section></section> | 341 </section></section></section> |
| 342 | 342 |
| 343 {{/partials.standard_nacl_api}} | 343 {{/partials.standard_nacl_api}} |
| OLD | NEW |