168 Commits

Author SHA1 Message Date
Seth Hillbrand
a7e6fa8198 Allow panning with selectable key
Add optins to mouse dialog to allow modifier key-based mouse movement
panning

Fixes https://gitlab.com/kicad/code/kicad/-/issues/2492
2025-08-11 13:21:22 -07:00
Wayne Stambaugh
e09b095533 Common folder housekeeping part 3. 2025-01-16 11:50:08 -05:00
Sam Schweigel
373d9c9281 Disable touch events on OSX only, allowing them on GTK and Windows
Fixes https://gitlab.com/kicad/code/kicad/-/issues/14374
2025-01-09 23:00:53 +00:00
Seth Hillbrand
0b2d4d4879 Revise Copyright statement to align with TLF
Recommendation is to avoid using the year nomenclature as this
information is already encoded in the git repo.  Avoids needing to
repeatly update.

Also updates AUTHORS.txt from current repo with contributor names
2025-01-01 14:12:04 -08:00
John Beard
9c9542deea Bind multiply-modified scroll events to the increment action
Implemented as handling un-consumed scroll events that the
WX_VIEW_CONTROLS doesn't want because it has too many mods
set. Then dispatch these as TA_MOUSE_WHEEL events.

The default action from the selection tools is to run the
'increment' ACTION, which is implemented differently in the
various tools: eeschema can increment labels, symedit
does pin names and numbers, and fpedit does pad numbers.
2024-10-26 16:00:58 +08:00
Mike Williams
53022ab347 mouse settings: add reverse zoom option
Fixes: https://gitlab.com/kicad/code/kicad/-/issues/18583
2024-09-23 17:09:44 +00:00
Jon Evans
74517856ca Make touchscreen events Windows-only
They break things on macOS and probably also on GTK
according to the wxWidgets documentation.
2024-06-09 13:18:32 -04:00
Alex Shvartzkop
7bca6cdea7 Make crosshair follow view movement when using pan/zoom gestures. 2024-06-09 18:46:42 +03:00
Alex Shvartzkop
832393b07c Remove debug line. 2024-06-08 17:25:49 +03:00
Alex Shvartzkop
8f8a68229c Handle touchscreen gesture events for zoom/pan. 2024-06-08 16:00:34 +03:00
Marek Roszko
e9fde0051f Don't let CaptureCursor fight modal dialog 2024-05-24 18:57:24 -04:00
John Beard
ce758adca3 Enable horizontal scroll panning
Allow a horizontal scroll event to fall through to the panning branch.

This still restricts zooming to use only the vertical axis, but it
(re-?)enables the horizontal pan function that currently doesn't work
even if the user has set "allow horizontal panning", as the horizontal
scroll doesn't have a modifier, which is the default for vertical scroll
zoom, and thus it skips over the whole panning branch.

If the user has not set horizontal panning, the earlier early return
means that there is no handling of any horizontal scroll event, so this
won't change anything for these users.
2024-05-20 19:23:23 +08:00
Marek Roszko
b2115445cc Make screenCenter a VECTOR2D for now to silence c++ 20 build error 2024-04-12 21:55:19 -04:00
Alex Shvartzkop
463b609993 Disable infinite panning when using XWayland.
Cursor warping doesn't work properly in this scenario.

https://gitlab.com/kicad/code/kicad/-/issues/14109
2024-03-12 10:31:23 +03:00
Seth Hillbrand
6633eadfc8 Enclose wxCHECK* macros in braces
The macros are if/else statements without enclosing structures which
leads to unexpected evaluation when expanding in an existing conditional
that does not have braces already.
2023-10-29 10:52:05 -07:00
Alex Shvartzkop
3ee2086f95 Don't freak out when can't warp the pointer. 2023-09-22 05:10:42 +03:00
Alex Shvartzkop
768d4a6782 Wayland: fix cursor warping on KDE and Weston, add logging. 2023-09-18 12:56:54 +00:00
Alex Shvartzkop
06463fd35a Fixes for Wayland cursor warping:
- Emulate the mouse position, since no motion events are sent after warp
- Do not call wl_surface_commit to prevent an assert
- Re-organize code a bit
2023-09-18 12:56:54 +00:00
Clément Saccoccio
ad62b165fe Fixed infinite mouse-drag with fast movement on Wayland. 2023-09-18 12:56:54 +00:00
Marek Roszko
7505fd0f37 Profile can live in core 2023-09-07 07:47:01 -04:00
Seth Hillbrand
db8e15ce88 Require wxWidgets 3.2
Removes old defines and work arounds for earlier wx versions and adds a
CMake requirement to use at least 3.2 (or the minimum matching wxPython
version)
2023-08-23 22:02:56 +00:00
Rastersoft
5936960c1e Allow to reverse the mouse wheel movement
This MR adds a CheckBox in the preferences window to reverse the
horizontal pan direction
2023-08-17 19:17:50 +00:00
Rastersoft
43fe1eec84 Unify mouse movements 2023-08-17 18:20:22 +00:00
mitxela
12be115c78 Prevent horizontal scrolling while zoom modifier is held 2023-07-10 19:37:46 +00:00
Alex Shvartzkop
7b5e725b98 Improve GAL panel refresh logic.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/15041
2023-07-03 02:15:05 +03:00
Ian McInerney
8b8586f54b Add case to ignore the unused scroll events in the view framework 2023-06-29 23:21:15 +01:00
Alex
c1ea90abc6 Handle view centering properly when drag-panning and zooming. 2023-01-02 14:20:43 +05:00
Seth Hillbrand
4f6b853756 Don't use modifiers when moving with keyboard
The modifier keys on the keyboard control the motion spacing (Ctrl) and
shouldn't be confused with the modifier key used to disable grid
snapping when moving with the mouse (also Ctrl)

Fixes https://gitlab.com/kicad/code/kicad/issues/13027
2022-11-28 11:05:12 -08:00
Alex
c5c5a3fe91 Use a single-shot timer for auto-panning.
Fixes https://gitlab.com/kicad/code/kicad/issues/11425
2022-11-17 05:30:55 +05:00
Mike Williams
6c43ace018 common: fix build (missing return) 2022-10-31 10:29:50 -04:00
dsa-t
01572c0f7d ADDED: Focus follows mouse between SCH and PCB editors (option). 2022-09-30 18:32:06 +00:00
Marek Roszko
89310bc403 "Cleaner" pan fix and add internal setter on state 2022-09-07 07:19:39 -04:00
Marek Roszko
59e9225619 Remove accidental debug code 2022-09-06 23:09:07 -04:00
Marek Roszko
971a8489b3 Hackfix the autopan on Windows
Autopanning is kinda doesn't jive with how events work on Windows
This is a hackfix for testing

Kinda fix https://gitlab.com/kicad/code/kicad/-/issues/11425
2022-09-06 23:07:59 -04:00
Jeff Young
895a8a8dbc Work around focus issues for status popups.
Autoscroll wasn't working on Mac because the status popup's panel
has the focus.  This *may* also fix a problem on MSW of the auto-scroll
not being cancel-able.

Fixes https://gitlab.com/kicad/code/kicad/issues/11425
2022-09-04 21:08:01 +01:00
Seth Hillbrand
a118f20464 Hide cursor while warping on Wayland
Based on https://gitlab.freedesktop.org/xorg/xserver/-/issues/734 we
hide the window cursor prior to warping, which allows XWayland to
reposition the cursor.  This is only performed when Wayland is detected;
all other configurations call the standard warp routine

Fixes https://gitlab.com/kicad/code/kicad/issues/9785
2022-06-24 09:56:43 -07:00
Jeff Young
23fb4c7433 Uniformly use a single facility for location-less prime events.
Also implements a uniform mechanism for avoiding auto-scroll after
a prime event or dialog which results in a mouse position at the
edge of the canvas.

Fixes https://gitlab.com/kicad/code/kicad/issues/11057
2022-05-16 23:43:00 +01:00
Seth Hillbrand
110728af48 Prevent focus stealing in some Linux WMs
OnEnter events will only raise the windows within KiCad rather than
between applications

Fixes https://gitlab.com/kicad/code/kicad/issues/10809
2022-05-12 11:06:30 -07:00
dsa-t
68655540eb Clamp cursor to limits of coordinates representation
Also improves large distance handling.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/8846
2022-02-11 16:42:52 +00:00
markus-bonk
47603fbc76 Wx_view_controls: Allow two input devices to simultaneously pan & zoom
Instead of the mouse move and zoom algorithms calculating the new
position or scale values relative to a starting value, the new values
are calculated relative to the current values. This allows the user to
use a second input device to move or zoom the view at the same time
without its change being undone by the mouse.
2022-01-28 12:21:42 +00:00
Jon Evans
014bad7b28 Add profile counters for PCB mouse and paint events 2021-12-05 15:16:08 -05:00
Wayne Stambaugh
bcd6bddfd4 Start expunging NULL.
Given that KiCad is a C++ project, we should really be using nullptr
instead of NULL.
2021-07-15 15:44:45 -04:00
Jeff Young
8f0104f921 Fix case of CLion getting a little carried away. 2021-07-04 16:23:57 +01:00
Jeff Young
c11ee69499 Save 3D prefs after editing, and load some of them into FP Props.
Fixes https://gitlab.com/kicad/code/kicad/issues/8712
2021-07-04 13:20:55 +01:00
luz paz
f968fc8719 Fix source comment / documentation typos 2021-06-09 19:32:58 +00:00
Marek Roszko
69d7a23e1c Start cleaning out wx/wx.h in cpp files 2021-06-07 18:20:47 -04:00
jean-pierre charras
0427bda768 Remove useless wx/wx.h include, that create sometimes compil warnings on msys.
wx/wx.h includes all wxWidgets .h files, and sometimes creates collision
names in #define between kicad and windows headers
Moreover, blindly including a lot of useless files is compil time consuming
2021-05-01 19:32:15 +02:00
jean-pierre charras
1bfa3dc6a5 Fix an annoying issue (wxMSW specific) about X_VIEW_CONTROLS::CaptureCursor()
On MSW, CaptureMouse() was sometimes called event if the GAL panel has
captured the mouse (that was not accepted by wxMSW), although HasCapture()
returns false.
(Perhaps some race condition between events)
The fix add a flag to avoid calling twice CaptureMouse() after only one
wxEVT_MOUSE_CAPTURE_LOST event was received.
Fixes #8239
https://gitlab.com/kicad/code/kicad/issues/8239
2021-04-19 21:23:07 +02:00
Jon Evans
cc8413c841 Tweak default zoom settings for Windows
Acceleration seems to be worse than constant on many
systems, so let's turn it off by default.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/5434
2021-03-21 19:46:23 -04:00
mitxela
886cad43bd Cancel drag action when focus is lost 2021-01-27 03:33:22 +00:00