File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed
atom/common/native_mate_converters Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -77,6 +77,21 @@ struct Converter<blink::WebInputEvent::Type> {
77
77
}
78
78
};
79
79
80
+ template <>
81
+ struct Converter <blink::WebMouseEvent::Button> {
82
+ static bool FromV8 (v8::Isolate* isolate, v8::Handle <v8::Value> val,
83
+ blink::WebMouseEvent::Button* out) {
84
+ std::string button = base::StringToLowerASCII (V8ToString (val));
85
+ if (button == " left" )
86
+ *out = blink::WebMouseEvent::Button ::ButtonLeft;
87
+ else if (button == " middle" )
88
+ *out = blink::WebMouseEvent::Button ::ButtonMiddle;
89
+ else if (button == " right" )
90
+ *out = blink::WebMouseEvent::Button ::ButtonRight;
91
+ return true ;
92
+ }
93
+ };
94
+
80
95
template <>
81
96
struct Converter <blink::WebInputEvent::Modifiers> {
82
97
static bool FromV8 (v8::Isolate* isolate, v8::Handle <v8::Value> val,
@@ -176,6 +191,7 @@ bool Converter<blink::WebMouseEvent>::FromV8(
176
191
return false ;
177
192
if (!dict.Get (" x" , &out->x ) || !dict.Get (" y" , &out->y ))
178
193
return false ;
194
+ dict.Get (" button" , &out->button );
179
195
dict.Get (" globalX" , &out->globalX );
180
196
dict.Get (" globalY" , &out->globalY );
181
197
dict.Get (" movementX" , &out->movementX );
You can’t perform that action at this time.
0 commit comments