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 2044 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2055 | 2055 |
2056 return false; | 2056 return false; |
2057 #undef RETURN_WHEEL_EVENT_HANDLED | 2057 #undef RETURN_WHEEL_EVENT_HANDLED |
2058 } | 2058 } |
2059 | 2059 |
2060 void EventHandler::defaultWheelEventHandler(Node* startNode, WheelEvent* wheelEv
ent) | 2060 void EventHandler::defaultWheelEventHandler(Node* startNode, WheelEvent* wheelEv
ent) |
2061 { | 2061 { |
2062 if (!startNode || !wheelEvent) | 2062 if (!startNode || !wheelEvent) |
2063 return; | 2063 return; |
2064 | 2064 |
2065 // Ctrl + scrollwheel is reserved for triggering zoom in/out actions in Chro
mium. | 2065 // When the wheelEvent do not scroll, we trigger zoom in/out instead. |
2066 if (wheelEvent->ctrlKey()) | 2066 if (!wheelEvent->canScroll()) |
2067 return; | 2067 return; |
2068 | 2068 |
2069 Node* stopNode = m_previousWheelScrolledNode.get(); | 2069 Node* stopNode = m_previousWheelScrolledNode.get(); |
2070 ScrollGranularity granularity = wheelGranularityToScrollGranularity(wheelEve
nt); | 2070 ScrollGranularity granularity = wheelGranularityToScrollGranularity(wheelEve
nt); |
2071 | 2071 |
2072 // Break up into two scrolls if we need to. Diagonal movement on | 2072 // Break up into two scrolls if we need to. Diagonal movement on |
2073 // a MacBook pro is an example of a 2-dimensional mouse wheel event (where b
oth deltaX and deltaY can be set). | 2073 // a MacBook pro is an example of a 2-dimensional mouse wheel event (where b
oth deltaX and deltaY can be set). |
2074 if (scroll(ScrollRight, granularity, startNode, &stopNode, wheelEvent->delta
X(), roundedIntPoint(wheelEvent->absoluteLocation()))) | 2074 if (scroll(ScrollRight, granularity, startNode, &stopNode, wheelEvent->delta
X(), roundedIntPoint(wheelEvent->absoluteLocation()))) |
2075 wheelEvent->setDefaultHandled(); | 2075 wheelEvent->setDefaultHandled(); |
2076 | 2076 |
(...skipping 1829 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3906 unsigned EventHandler::accessKeyModifiers() | 3906 unsigned EventHandler::accessKeyModifiers() |
3907 { | 3907 { |
3908 #if OS(MACOSX) | 3908 #if OS(MACOSX) |
3909 return PlatformEvent::CtrlKey | PlatformEvent::AltKey; | 3909 return PlatformEvent::CtrlKey | PlatformEvent::AltKey; |
3910 #else | 3910 #else |
3911 return PlatformEvent::AltKey; | 3911 return PlatformEvent::AltKey; |
3912 #endif | 3912 #endif |
3913 } | 3913 } |
3914 | 3914 |
3915 } // namespace blink | 3915 } // namespace blink |
OLD | NEW |