OLD | NEW |
1 .. _view_focus_input_events: | 1 .. _view_focus_input_events: |
2 | 2 |
3 :template: standard_nacl_api | 3 :template: standard_nacl_api |
4 | 4 |
5 #################################### | 5 #################################### |
6 View Change, Focus, and Input Events | 6 View Change, Focus, and Input Events |
7 #################################### | 7 #################################### |
8 | 8 |
9 .. contents:: | 9 .. contents:: |
10 :local: | 10 :local: |
11 :backlinks: none | 11 :backlinks: none |
12 :depth: 2 | 12 :depth: 2 |
13 | 13 |
14 This chapter describes view change, focus, and input event handling for a | 14 This section describes view change, focus, and input event handling for a |
15 Native Client module. The chapter assumes you are familiar with the | 15 Native Client module. The section assumes you are familiar with the |
16 material presented in the :doc:`Technical Overview <../../overview>`. | 16 material presented in the :doc:`Technical Overview <../../overview>`. |
17 | 17 |
18 There are two examples used in this chapter to illustrate basic | 18 There are two examples used in this section to illustrate basic |
19 programming techniques. The ``input_events`` example is used to | 19 programming techniques. The ``input_events`` example is used to |
20 illustrate how your module can react to keyboard and mouse input | 20 illustrate how your module can react to keyboard and mouse input |
21 event. The ``mouse_lock`` example is used to illustrate how your module | 21 event. The ``mouse_lock`` example is used to illustrate how your module |
22 can react to view change events. You can find these examples in the | 22 can react to view change events. You can find these examples in the |
23 ``/pepper_<version>/examples/api/input_event`` and | 23 ``/pepper_<version>/examples/api/input_event`` and |
24 ``/pepper_<version>/examples/api/mouse_lock`` directories in the Native Client | 24 ``/pepper_<version>/examples/api/mouse_lock`` directories in the Native Client |
25 SDK. There is also the ppapi_simple library that can be used to to implement | 25 SDK. There is also the ppapi_simple library that can be used to to implement |
26 most of the boiler plate. The ``pi_generator`` example in | 26 most of the boiler plate. The ``pi_generator`` example in |
27 ``/pepper_<version>/examples/demo/pi_generator`` uses ppapi_simple to manage | 27 ``/pepper_<version>/examples/demo/pi_generator`` uses ppapi_simple to manage |
28 view change events and 2D graphics. | 28 view change events and 2D graphics. |
(...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
325 | 325 |
326 Threading and blocking | 326 Threading and blocking |
327 ---------------------- | 327 ---------------------- |
328 | 328 |
329 ``HandleInputEvent()`` in this example runs on the main module thread. | 329 ``HandleInputEvent()`` in this example runs on the main module thread. |
330 However, the bulk of the work happens on a separate worker thread (see | 330 However, the bulk of the work happens on a separate worker thread (see |
331 ``ProcessEventOnWorkerThread``). ``HandleInputEvent()`` puts events in | 331 ``ProcessEventOnWorkerThread``). ``HandleInputEvent()`` puts events in |
332 the ``event_queue_`` and the worker thread takes events from the | 332 the ``event_queue_`` and the worker thread takes events from the |
333 ``event_queue_``. This processing happens independently of the main | 333 ``event_queue_``. This processing happens independently of the main |
334 thread, so as not to slow down the browser. | 334 thread, so as not to slow down the browser. |
OLD | NEW |