| Index: sky/engine/public/platform/WebInputEvent.h
|
| diff --git a/sky/engine/public/platform/WebInputEvent.h b/sky/engine/public/platform/WebInputEvent.h
|
| index 61cec7c9407974e36d3850f575558cefbd1cf039..ea2df82622f2ff0ebfb74f839d4aafbb39c49128 100644
|
| --- a/sky/engine/public/platform/WebInputEvent.h
|
| +++ b/sky/engine/public/platform/WebInputEvent.h
|
| @@ -121,6 +121,8 @@ public:
|
| GesturePinchEnd,
|
| GesturePinchUpdate,
|
| GestureTypeLast = GesturePinchUpdate,
|
| +
|
| + WheelEvent,
|
| };
|
|
|
| enum Modifiers {
|
| @@ -170,18 +172,21 @@ public:
|
| return PointerTypeFirst <= type && type <= PointerTypeLast;
|
| }
|
|
|
| - // Returns true if the WebInputEvent |type| is a keyboard event.
|
| static bool isKeyboardEventType(int type)
|
| {
|
| return KeyboardTypeFirst <= type && type <= KeyboardTypeLast;
|
| }
|
|
|
| - // Returns true if the WebInputEvent is a gesture event.
|
| static bool isGestureEventType(int type)
|
| {
|
| return GestureTypeFirst <= type && type <= GestureTypeLast;
|
| }
|
|
|
| + static bool isWheelEventType(int type)
|
| + {
|
| + return type == WheelEvent;
|
| + }
|
| +
|
| protected:
|
| explicit WebInputEvent(unsigned sizeParam)
|
| {
|
| @@ -238,32 +243,35 @@ public:
|
| // what is returned by the Windows API. For example, it should
|
| // store VK_SHIFT instead of VK_RSHIFT. The location information
|
| // should be stored in |modifiers|.
|
| - int key;
|
| + int key = 0;
|
|
|
| // |charCode| is the text generated by this keystroke. |unmodifiedCharCode|
|
| // is |charCode|, but unmodified by an concurrently-held modifiers (except
|
| // shift). This is useful for working out shortcut keys.
|
| - WebUChar charCode;
|
| - WebUChar unmodifiedCharCode;
|
| -
|
| - WebKeyboardEvent()
|
| - : WebInputEvent(sizeof(WebKeyboardEvent))
|
| - , key(0)
|
| - , charCode(0)
|
| - , unmodifiedCharCode(0)
|
| - {
|
| - }
|
| + WebUChar charCode = 0;
|
| + WebUChar unmodifiedCharCode = 0;
|
| +
|
| + WebKeyboardEvent() : WebInputEvent(sizeof(WebKeyboardEvent)) {}
|
| +};
|
| +
|
| +// WebWheelEvent --------------------------------------------------------------
|
| +
|
| +class WebWheelEvent : public WebInputEvent {
|
| +public:
|
| + float x = 0;
|
| + float y = 0;
|
| + float offsetX = 0;
|
| + float offsetY = 0;
|
| +
|
| + WebWheelEvent() : WebInputEvent(sizeof(WebWheelEvent)) {}
|
| };
|
|
|
| -// WebGestureEvent --------------------------------------------------------------
|
| +// WebGestureEvent ------------------------------------------------------------
|
|
|
| class WebGestureEvent : public WebInputEvent {
|
| public:
|
| - int x;
|
| - int y;
|
| - int globalX;
|
| - int globalY;
|
| - WebGestureDevice sourceDevice;
|
| + float x = 0;
|
| + float y = 0;
|
|
|
| union {
|
| // Tap information must be set for GestureTap, GestureTapUnconfirmed,
|
| @@ -320,10 +328,6 @@ public:
|
|
|
| WebGestureEvent()
|
| : WebInputEvent(sizeof(WebGestureEvent))
|
| - , x(0)
|
| - , y(0)
|
| - , globalX(0)
|
| - , globalY(0)
|
| {
|
| memset(&data, 0, sizeof(data));
|
| }
|
|
|