--- src/wxterminal/wxt_gui.cpp.orig
+++ src/wxterminal/wxt_gui.cpp
@@ -1003,11 +1003,16 @@ void wxtPanel::OnRightUp( wxMouseEvent& event )
 /* mouse wheel event */
 void wxtPanel::OnMouseWheel( wxMouseEvent& event )
 {
-	UpdateModifiers(event);
+	int mouse_button;
 
-	wxt_exec_event(GE_buttonpress, 0, 0, 
-			event.GetWheelRotation() > 0 ? 4 : 5, 
-			0, this->GetId());
+	UpdateModifiers(event);
+	mouse_button = (event.GetWheelRotation() > 0 ? 4 : 5);
+#if wxCHECK_VERSION(2, 9, 0)
+	/* GetWheelAxis: 0 is the Y axis, 1 is the X axis. */
+	if (event.GetWheelAxis() > 0)
+	    mouse_button += 2;
+#endif
+	wxt_exec_event(GE_buttonpress, 0, 0, mouse_button, 0, this->GetId());
 }
 
 /* the state of the modifiers is checked each time a key is pressed instead of
