浏览代码

WebContent: Switch scroll direction on shift modifier

Dmitry Petrov 3 年之前
父节点
当前提交
2616b61eee
共有 1 个文件被更改,包括 3 次插入0 次删除
  1. 3 0
      Userland/Libraries/LibWeb/Page/EventHandler.cpp

+ 3 - 0
Userland/Libraries/LibWeb/Page/EventHandler.cpp

@@ -117,6 +117,9 @@ bool EventHandler::handle_mousewheel(const Gfx::IntPoint& position, unsigned int
     if (!layout_root())
         return false;
 
+    if (modifiers & KeyModifier::Mod_Shift)
+        swap(wheel_delta_x, wheel_delta_y);
+
     // FIXME: Support wheel events in subframes.
 
     auto result = layout_root()->hit_test(position, Layout::HitTestType::Exact);