OLD | NEW |
1 /* Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 /* Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 * Use of this source code is governed by a BSD-style license that can be | 2 * Use of this source code is governed by a BSD-style license that can be |
3 * found in the LICENSE file. | 3 * found in the LICENSE file. |
4 */ | 4 */ |
5 | 5 |
6 /** | 6 /** |
7 * This file defines the API for receiving input events from the browser. | 7 * This file defines the API for receiving input events from the browser. |
8 */ | 8 */ |
9 | 9 |
10 label Chrome { | 10 label Chrome { |
11 M14 = 0.1 | 11 M14 = 0.1 |
12 }; | 12 }; |
13 | 13 |
14 [version=0.1, macro="PPP_INPUT_EVENT_INTERFACE"] | 14 [version=0.1, macro="PPP_INPUT_EVENT_INTERFACE"] |
15 interface PPP_InputEvent { | 15 interface PPP_InputEvent { |
16 /** | 16 /** |
17 * Function for receiving input events from the browser. | 17 * Function for receiving input events from the browser. |
18 * | 18 * |
19 * In order to receive input events, you must register for them by calling | 19 * In order to receive input events, you must register for them by calling |
20 * PPB_InputEvent.RequestInputEvents() or RequestFilteringInputEvents(). By | 20 * PPB_InputEvent.RequestInputEvents() or RequestFilteringInputEvents(). By |
21 * default, no events are delivered. | 21 * default, no events are delivered. |
22 * | 22 * |
23 * If the event was handled, it will not be forwarded to the web page or | 23 * If the event was handled, it will not be forwarded to the default handlers |
24 * browser. If it was not handled, it will bubble according to the normal | 24 * in the web page. If it was not handled, it may be dispatched to a default |
25 * rules. So it is important that an instance respond accurately with whether | 25 * handler. So it is important that an instance respond accurately with |
26 * event propagation should continue. | 26 * whether event propagation should continue. |
27 * | 27 * |
28 * Event propagation also controls focus. If you handle an event like a mouse | 28 * Event propagation also controls focus. If you handle an event like a mouse |
29 * event, typically the instance will be given focus. Returning false from | 29 * event, typically the instance will be given focus. Returning false from |
30 * a filtered event handler or not registering for an event type means that | 30 * a filtered event handler or not registering for an event type means that |
31 * the click will be given to a lower part of the page and your instance will | 31 * the click will be given to a lower part of the page and your instance will |
32 * not receive focus. This allows an instance to be partially transparent, | 32 * not receive focus. This allows an instance to be partially transparent, |
33 * where clicks on the transparent areas will behave like clicks to the | 33 * where clicks on the transparent areas will behave like clicks to the |
34 * underlying page. | 34 * underlying page. |
35 * | 35 * |
36 * In general, you should try to keep input event handling short. Especially | 36 * In general, you should try to keep input event handling short. Especially |
(...skipping 17 matching lines...) Expand all Loading... |
54 * @return PP_TRUE if the event was handled, PP_FALSE if not. If you have | 54 * @return PP_TRUE if the event was handled, PP_FALSE if not. If you have |
55 * registered to filter this class of events by calling | 55 * registered to filter this class of events by calling |
56 * RequestFilteringInputEvents, and you return PP_FALSE, the event will | 56 * RequestFilteringInputEvents, and you return PP_FALSE, the event will |
57 * be forwarded to the page (and eventually the browser) for the default | 57 * be forwarded to the page (and eventually the browser) for the default |
58 * handling. For non-filtered events, the return value will be ignored. | 58 * handling. For non-filtered events, the return value will be ignored. |
59 */ | 59 */ |
60 PP_Bool HandleInputEvent([in] PP_Instance instance, | 60 PP_Bool HandleInputEvent([in] PP_Instance instance, |
61 [in] PP_Resource input_event); | 61 [in] PP_Resource input_event); |
62 }; | 62 }; |
63 | 63 |
OLD | NEW |