OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserv ed. | 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserv ed. |
3 * Copyright (C) 2006 Alexey Proskuryakov (ap@webkit.org) | 3 * Copyright (C) 2006 Alexey Proskuryakov (ap@webkit.org) |
4 * Copyright (C) 2012 Digia Plc. and/or its subsidiary(-ies) | 4 * Copyright (C) 2012 Digia Plc. and/or its subsidiary(-ies) |
5 * | 5 * |
6 * Redistribution and use in source and binary forms, with or without | 6 * Redistribution and use in source and binary forms, with or without |
7 * modification, are permitted provided that the following conditions | 7 * modification, are permitted provided that the following conditions |
8 * are met: | 8 * are met: |
9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 2009 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2020 RETURN_WHEEL_EVENT_HANDLED(); | 2020 RETURN_WHEEL_EVENT_HANDLED(); |
2021 | 2021 |
2022 #undef RETURN_WHEEL_EVENT_HANDLED | 2022 #undef RETURN_WHEEL_EVENT_HANDLED |
2023 } | 2023 } |
2024 | 2024 |
2025 void EventHandler::defaultWheelEventHandler(Node* startNode, WheelEvent* wheelEv ent) | 2025 void EventHandler::defaultWheelEventHandler(Node* startNode, WheelEvent* wheelEv ent) |
2026 { | 2026 { |
2027 if (!startNode || !wheelEvent) | 2027 if (!startNode || !wheelEvent) |
2028 return; | 2028 return; |
2029 | 2029 |
2030 // Ctrl + scrollwheel is reserved for triggering zoom in/out actions in Chro mium. | 2030 // Method suppressScroll() is reserved for triggering zoom in/out actions in Chromium. |
tdresser
2014/11/27 15:06:09
Method suppressScroll() ->
When scrolling is suppr
lanwei
2014/12/02 15:48:10
Done.
| |
2031 if (wheelEvent->ctrlKey()) | 2031 if (wheelEvent->suppressScroll()) |
2032 return; | 2032 return; |
2033 | 2033 |
2034 Node* stopNode = m_previousWheelScrolledNode.get(); | 2034 Node* stopNode = m_previousWheelScrolledNode.get(); |
2035 ScrollGranularity granularity = wheelGranularityToScrollGranularity(wheelEve nt->deltaMode()); | 2035 ScrollGranularity granularity = wheelGranularityToScrollGranularity(wheelEve nt->deltaMode()); |
2036 | 2036 |
2037 // Break up into two scrolls if we need to. Diagonal movement on | 2037 // Break up into two scrolls if we need to. Diagonal movement on |
2038 // a MacBook pro is an example of a 2-dimensional mouse wheel event (where b oth deltaX and deltaY can be set). | 2038 // a MacBook pro is an example of a 2-dimensional mouse wheel event (where b oth deltaX and deltaY can be set). |
2039 if (scroll(ScrollRight, granularity, startNode, &stopNode, wheelEvent->delta X(), roundedIntPoint(wheelEvent->absoluteLocation()))) | 2039 if (scroll(ScrollRight, granularity, startNode, &stopNode, wheelEvent->delta X(), roundedIntPoint(wheelEvent->absoluteLocation()))) |
2040 wheelEvent->setDefaultHandled(); | 2040 wheelEvent->setDefaultHandled(); |
2041 | 2041 |
(...skipping 1817 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3859 unsigned EventHandler::accessKeyModifiers() | 3859 unsigned EventHandler::accessKeyModifiers() |
3860 { | 3860 { |
3861 #if OS(MACOSX) | 3861 #if OS(MACOSX) |
3862 return PlatformEvent::CtrlKey | PlatformEvent::AltKey; | 3862 return PlatformEvent::CtrlKey | PlatformEvent::AltKey; |
3863 #else | 3863 #else |
3864 return PlatformEvent::AltKey; | 3864 return PlatformEvent::AltKey; |
3865 #endif | 3865 #endif |
3866 } | 3866 } |
3867 | 3867 |
3868 } // namespace blink | 3868 } // namespace blink |
OLD | NEW |