Age | Commit message (Collapse) | Author |
|
The ISMOUSE macro was used in situations only button events
needed to be checked.
The only functional difference would be MOUSEMOVE events were
previously accepted for these checks.
|
|
The `ascii` member was only kept for historic reason as some platforms
didn't support utf8 when it was first introduced.
Remove the `ascii` struct members since many checks used this as a
fall-back for utf8_buf not being set which isn't needed.
There are a few cases where it's convenient to access the ASCII value
of an event (or nil) so a function has been added to do that.
*Details*
- WM_event_utf8_to_ascii() has been added for the few cases an events
ASCII value needs to be accessed, this just avoids having to do
multi-byte character checks in-line.
- RNA Event.ascii remains, using utf8_buf[0] for single byte characters.
- GHOST_TEventKeyData.ascii has been removed.
- To avoid regressions non-ASCII Latin1 characters from GHOST are
converted into multi-byte UTF8, when building X11 without
XInput & X_HAVE_UTF8_STRING it seems like could still occur.
|
|
This was part of walk-mode logic that implemented it's own cursor-grab,
now this has been moved to use GHOST's cursor grabbing,
it's no longer needed.
|
|
After removing the default 'Home' shortcut for "Frame All", a NDOF (3D
Mouse) default shortcut was still available for the operator. The event
filtering introduced in 4357fb63db77 was missing the NDOF filtering
logic. So while the context menu correctly found the NDOF keymap item,
its actual shortcut change/removal code incorrectly filtered out the
NDOF keymap items and thus failed to find the item.
|
|
The array for event.flag was too big, harmless but incorrect.
Remove the size from the declaration as it's not needed.
|
|
- Use set-style printing of modifier flags instead of booleans.
- Include event.flag.
- Print on a single line (so output can be more easily filtered).
|
|
At the time of naming these members only some event types generated
click events so it made some sense to differentiate a click.
Now all buttons support click & drag it's more logical to use the
prefix "prev_press_" as any press event will set these values.
Also update doc-strings.
|
|
This avoids transform jumping which is a problem when tweaking values a
small amount. A fix for T40549 was made box-select used the location
when the key was pressed.
While it's important for box-select or any operator where it's expected
the drag-start location is used, this is only needed in some cases.
Since the event stores the click location and the current location,
no longer overwrite the events real location. Operators that depend on
using the drag-start can use this location if they need.
In some cases the region relative cursor location (Event.mval) now needs
to be calculated based on the click location.
- Added `WM_event_drag_start_mval` for convenient access to the region
relative drag-start location (for drag events).
- Added `WM_event_drag_start_xy` for window relative coordinates.
- Added Python property Event.mouse_prev_click_x/y
Resolves T93599.
Reviewed By: Severin
Ref D14213
|
|
Also improve doc-strings for key-map item constants.
|
|
Supporting two kinds of dragging is redundant, remove tweak events as
they only supported 3 mouse buttons and added complexity from using the
'value' to store directions.
Support only click-drag events (KM_CLICK_DRAG) which can be used with
any keyboard or mouse button.
Details:
- A "direction" member has been added to keymap items and events which
can be used when the event value is set to KM_CLICK_DRAG.
- Keymap items are version patched.
- Loading older key-maps are also updated.
- Currently the key-maps stored in ./release/scripts/presets/keyconfig/
still reference tweak events & need updating. For now they are updated
on load.
Note that in general this wont impact add-ons as modal operators don't
receive tweak events.
Reviewed By: brecht
Ref D14214
|
|
|
|
db4313610cab18933c1b1b1348720ea241b9d91e added support for modifier
keys to be released while dragging.
The key release events set wmEvent.prev_type which is used select the
drag threshold, causing the wrong threshold to be used.
Add wmEvent.prev_click_type which is only set when the drag begins.
|
|
Use a flag for events to avoid adding struct members every time a new
kind of tag is needed - so events remain small.
This also simplifies copying settings as flags can be copied at once
with a mask.
|
|
Using flags makes checking multiple modifiers at once more convenient
and avoids macros/functions such as IS_EVENT_MOD & WM_event_modifier_flag
which have been removed. It also simplifies checking if modifier keys
have changed.
|
|
Use a shorter/simpler license convention, stops the header taking so
much space.
Follow the SPDX license specification: https://spdx.org/licenses
- C/C++/objc/objc++
- Python
- Shell Scripts
- CMake, GNUmakefile
While most of the source tree has been included
- `./extern/` was left out.
- `./intern/cycles` & `./intern/atomic` are also excluded because they
use different header conventions.
doc/license/SPDX-license-identifiers.txt has been added to list SPDX all
used identifiers.
See P2788 for the script that automated these edits.
Reviewed By: brecht, mont29, sergey
Ref D14069
|
|
Ref T92709
|
|
Replace local static mouse coordinate storage with a single function.
also resolve inconsistencies.
- Edit-mesh selection used equality check (ignoring `U.move_threshold`).
- Motion to clear tooltips checked the value without scaling by the DPI.
Also prevent the unlikely case of the previous motion check matching
a different area by resetting the value when the active region changes.
|
|
|
|
Improve readability using underscores for separators, e.g.
prev_click_time instead of prevclicktime.
|
|
Use arrays for wmEvent coordinates, this quiets warnings with GCC11.
- `x, y` -> `xy`.
- `prevx, prevy` -> `prev_xy`.
- `prevclickx, prevclicky` -> `prev_click_xy`.
There is still some cleanup such as using `copy_v2_v2_int()`,
this can be done separately.
Reviewed By: campbellbarton, Severin
Ref D12901
|
|
Integrates XR input actions with the WM event system. With this commit,
all VR action functionality (operator execution, pose querying, haptic
application), with the exception of custom drawing, is enabled.
By itself, this does not bring about any changes for regular users,
however it is necessary for the upcoming VR add-on update that will
expose default controller actions to users.
For add-on developers, this updates the Python API with access to XR
event data (input states, controller poses, etc.), which can be
obtained via the "xr" property added to the bpy.types.Event struct.
For XR events, this property will be non-null and the event will have
the type XR_ACTION.
Further details:
XR-type window events are queued to the regular window queues after
updating and interpreting VR action states. An appropriate window is
found by either using the window the VR session was started in or a
fallback option.
When handling XR events, mouse-specific processing is skipped and
instead a dedicated XR offscreen area and region (see 08511b1c3de0) is
used to execute XR event operators in the proper context.
Reviewed By: Severin
Differential Revision: https://developer.blender.org/D10944
|
|
Some gestures were activating immediately on tweak events,
extend this to mouse-press and click-drag.
Without this change, box-select for example wouldn't be automatically
activated on mouse-press.
|
|
|
|
Fix for T85517
Bug: Couldn't type space while holding down the shift key in text spaces (e.g. when saving a file, changing the name of object).
Changes: Removing the key combination of Shift + space in `WM_event_is_ime_switch` method.
Reviewed By: harley, mont29
Maniphest Tasks: T85517
Differential Revision: https://developer.blender.org/D10452
|
|
|
|
|
|
|
|
Keyboard click-drag events now use the "Drag Threshold".
This resolves a problem where keyboard click drag events
used a much smaller threshold when using a tablet.
|
|
Ignore click-drag for non-mouse button drag events
Alternative to fix issue detailed in D10886.
|
|
1638af109e46522a1a24645289016922bb9ca977 &
bfc70a6a958b9c35bde765ea8a02e8b1fd36db8b
caused a regression with click-drag (not tweak which has it's own logic).
Restore some changes from these commits with added comments.
Minor changes from previous functionality from
39919e35326c732141bfd2d740b19000b6bc1d51.
- `prevval` & `prevtype` are now set for all kinds of new events
in the queue previously this was not done for some kinds of events
(mouse wheel, ndof - for example).
- Set `prevval` & `prevtype` for other windows for mouse buttons.
|
|
Currently the intended behavior regarding prevval/prevtype isn't
handled consistently. However, including cursor motion causes events
in `wm->queue` and `wm->eventstate` to behave differently,
where `wm->eventstate` ignores motion (necessary for click detection).
This makes checks from `wm->eventstate` to events in the queue fail.
This reverts 39919e35326c732141bfd2d740b19000b6bc1d51,
using the `event.type` instead of it's previous type.
This works as it includes mouse button release events.
|
|
This contains all value items (with overlapping values),
name this to make it clear it contains all items.
|
|
|
|
And remove Blender preference, which was expected to be set to match the system
preference for correct behavior. Instead just handle this automatically.
Differential Revision: https://developer.blender.org/D9402
|
|
Cleanup old tracker task format to the new. e.g: [#34039] to T34039
Ref D8718
|
|
|
|
|
|
Both the MS headers and blender headers define the HKEY
which gives all kind of inclusion order issues.
This diff renames all *KEY constants to EVT_*KEY to resolve
this conflict.
Reviewed By: brecht , dfelinto
Differential Revision: http://developer.blender.org/D7164
|
|
|
|
Removing meaningless distinction between NULL pointer and EVT_TABLET_NONE,
and initialize pressure and tilt to 1.0 and 0.0 respectively when no tablet
is used.
|
|
This can be replaced by passing an argument.
|
|
event_system.c has been collecting a lot of different functionality,
move generic query/access functions into their own file,
since these are used by operators and other parts of the windowing code
and aren't part of low level event handling.
Also move public last-property API to wm_operators.c.
|