Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2022-07-21WM: replace ISMOUSE with ISMOUSE_BUTTONCampbell Barton
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.
2022-07-14WM: Remove ASCII members from wmEvent & GHOST_TEventKeyDataCampbell Barton
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.
2022-07-04Cleanup: remove unused WM_event_is_last_mousemoveCampbell Barton
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.
2022-05-27Fix T97918: Crash when changing "Frame All" shortcut from context menuJulian Eisel
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.
2022-03-21Correct error in 3dc44f8c89acc082334034982ffc8bc802f23475Campbell Barton
The array for event.flag was too big, harmless but incorrect. Remove the size from the declaration as it's not needed.
2022-03-21Event System: improve event printingCampbell Barton
- 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).
2022-03-09Cleanup: rename wmEvent.prev_click_* to prev_press_*Campbell Barton
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.
2022-03-09Event System: drag events no longer default to the drag start locationCampbell Barton
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
2022-03-02Cleanup: rename direction enum as it's part of the key-map itemCampbell Barton
Also improve doc-strings for key-map item constants.
2022-03-02Event System: remove tweak events in favor of click-dragCampbell Barton
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
2022-03-02Event System: support "Release Confirms" for click-drag eventsCampbell Barton
2022-03-01Fix incorrect drag-event threshold when releasing modifiers earlyCampbell Barton
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.
2022-03-01Cleanup: move Event.is_repeat & is_direction_inverted to flagsCampbell Barton
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.
2022-02-25Cleanup: use flags for wmEvent modifier keysCampbell Barton
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.
2022-02-11File headers: SPDX License migrationCampbell Barton
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
2021-12-08Cleanup: move public doc-strings into headers for 'windowmanager'Campbell Barton
Ref T92709
2021-10-27WM: de-duplicate cursor motion checks for selection pickingCampbell Barton
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.
2021-10-21Cleanup: Use array utility for cursor eventsAaron Carlisle
2021-10-21Cleanup: use underscore separators for event struct membersCampbell Barton
Improve readability using underscores for separators, e.g. prev_click_time instead of prevclicktime.
2021-10-20Cleanup: use an array for wmEvent cursor position variablesAaron Carlisle
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
2021-10-12XR Controller Support Step 3: XR EventsPeter Kim
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
2021-09-23WM: gestures now activate immediately on mouse pressCampbell Barton
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.
2021-07-27Cleanup: add note from T85517 fixCampbell Barton
2021-07-26Fix T85517: Cannot type Space while holding Shift key in text-field like spaces.Himanshi Kalra
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
2021-07-23Cleanup: double spaces in stringsCampbell Barton
2021-07-07Cleanup: spelling in commentsCampbell Barton
2021-06-24Cleanup: comment blocks, trailing space in commentsCampbell Barton
2021-06-03WM: only use the tablet drag threshold for mouse button eventsCampbell Barton
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.
2021-04-13Fix snap gizmo flickering while draggingCampbell Barton
Ignore click-drag for non-mouse button drag events Alternative to fix issue detailed in D10886.
2021-03-02Fix click-drag regression in fix for T86116Campbell Barton
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.
2021-03-01WM: don't set event prevval/prevtype on cursor motionCampbell Barton
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.
2021-01-13Cleanup: rename enum for event value itemsCampbell Barton
This contains all value items (with overlapping values), name this to make it clear it contains all items.
2021-01-13Fix WM_event_print error printing tweak events valueCampbell Barton
2020-11-09macOS: follow system preference for natural trackpad scroll directionYevgeny Makarov
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
2020-09-30Cleanup: convert gforge task ID's to phabricator formatValentin
Cleanup old tracker task format to the new. e.g: [#34039] to T34039 Ref D8718
2020-05-14WM: include previous value, type in event printingCampbell Barton
2020-03-19Cleanup: `make format` after SortedIncludes changeDalai Felinto
2020-03-18Cleanup: Resolve HKEY conflictRay Molenkamp
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
2020-03-07WM: include repeat value in WM_event_printCampbell Barton
2020-01-21Cleanup: simplify wmEvent tablet data storage and namingBrecht Van Lommel
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.
2020-01-13Cleanup: remove hack that set operator id in the wmEventCampbell Barton
This can be replaced by passing an argument.
2020-01-10Cleanup: move public event queries into their own fileCampbell Barton
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.