OLD | NEW |
---|---|
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 * Copyright (C) 2004, 2006, 2007 Apple Inc. All rights reserved. | 6 * Copyright (C) 2004, 2006, 2007 Apple Inc. All rights reserved. |
7 * Copyright (C) 2006-2009 Google Inc. | 7 * Copyright (C) 2006-2009 Google Inc. |
8 * | 8 * |
9 * Redistribution and use in source and binary forms, with or without | 9 * Redistribution and use in source and binary forms, with or without |
10 * modification, are permitted provided that the following conditions | 10 * modification, are permitted provided that the following conditions |
(...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
340 | 340 |
341 // Set stylus properties for events with a subtype of | 341 // Set stylus properties for events with a subtype of |
342 // NSTabletPointEventSubtype. | 342 // NSTabletPointEventSubtype. |
343 result.pointerType = blink::WebPointerProperties::PointerType::Pen; | 343 result.pointerType = blink::WebPointerProperties::PointerType::Pen; |
344 result.id = [event deviceID]; | 344 result.id = [event deviceID]; |
345 if (subtype == NSTabletPointEventSubtype) { | 345 if (subtype == NSTabletPointEventSubtype) { |
346 result.force = [event pressure]; | 346 result.force = [event pressure]; |
347 NSPoint tilt = [event tilt]; | 347 NSPoint tilt = [event tilt]; |
348 result.tiltX = lround(tilt.x * 90); | 348 result.tiltX = lround(tilt.x * 90); |
349 result.tiltY = lround(tilt.y * 90); | 349 result.tiltY = lround(tilt.y * 90); |
350 result.tangentialPressure = [event tangentialPressure]; | |
351 result.twist = [event rotation]; | |
mustaq
2017/01/03 19:09:24
The NSEvent spec doesn't specify the range at all,
lanwei
2017/01/05 16:13:40
Done. Yes, the value I saw is in this range.
| |
350 } | 352 } |
351 return result; | 353 return result; |
352 } | 354 } |
353 | 355 |
354 // WebMouseWheelEvent --------------------------------------------------------- | 356 // WebMouseWheelEvent --------------------------------------------------------- |
355 | 357 |
356 blink::WebMouseWheelEvent WebMouseWheelEventBuilder::Build( | 358 blink::WebMouseWheelEvent WebMouseWheelEventBuilder::Build( |
357 NSEvent* event, | 359 NSEvent* event, |
358 NSView* view) { | 360 NSView* view) { |
359 blink::WebMouseWheelEvent result; | 361 blink::WebMouseWheelEvent result; |
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
542 break; | 544 break; |
543 default: | 545 default: |
544 NOTIMPLEMENTED(); | 546 NOTIMPLEMENTED(); |
545 result.type = blink::WebInputEvent::Undefined; | 547 result.type = blink::WebInputEvent::Undefined; |
546 } | 548 } |
547 | 549 |
548 return result; | 550 return result; |
549 } | 551 } |
550 | 552 |
551 } // namespace content | 553 } // namespace content |
OLD | NEW |