Tags: dalyIsaac/Whim
Tags
Remove obsolete code usage from core (#1139) - Replaced all usages of obsolete methods and classes in the core with transforms and pickers. - Removed all usages of obsolete methods and classes in the tests for the core. - Cleaned up `ActivateWorkspaceTransform` by removing some unnecessary transform dispatches. - Added the ability for the `StoreWrapper` test utility to intercept transform dispatches and perform custom functions. - This was used when replacing `NSubstitute` returns with store interactions. - Updated nullable syntax and collections to match the latest C# standards.
C# exceptions are too slow (#1131) This pull request replaces DotNext's `Result` type with a new `Result` type from within Whim itself. The reason for this was that `DotNext.Result` relied on `Exception`s for error handling, or an `Error` enum. `Exception`s are slow (can take up to a second to create) and are not suitable for performance-sensitive code. The new `Result` type maintains much of the same API, but accepts a `WhimError` type for errors, which includes a `string` message and an optional `Exception` for library code which provide any errors. `DotNext` has been removed as a dependency.
Support arbitrary modifier keys (#1123) This pull request introduces significant updates to the keybinding system, transitioning from the use of the `KeyModifiers` enum to a more flexible `IEnumerable<VIRTUAL_KEY>` approach. These changes impact documentation, implementation, and testing. The most important updates include improving the clarity of keybinding documentation, refactoring the `Keybind` class to use the new structure, and updating tests to align with the new design. ### Documentation Updates * Updated `docs/configure/core/keybinds.md` to clarify that keybind modifiers are now expressed as a list of `VIRTUAL_KEY` values, and emphasized the use of keys that are less likely to conflict with other purposes. Removed references to the `VK*` prefix in the virtual key enum. * Refactored examples in `docs/script/core/keybinds.md` and `docs/script/core/commands.md` to use the new `IEnumerable<VIRTUAL_KEY>` syntax for modifiers. ### Code Refactoring * Refactored the `Keybind` class to replace the `KeyModifiers` enum with a more flexible `IEnumerable<VIRTUAL_KEY>` for modifiers, allowing for non-standard combinations. Updated the `ToString` method to handle multiple modifiers and added a constructor that sorts modifiers internally. * Marked the `KeyModifiers` enum and related methods as obsolete and replaced their usage throughout the codebase. ### Test Updates * Updated unit tests in `KeyModifiersTests.cs` to align with the new `IEnumerable<VIRTUAL_KEY>` structure, including replacing inline test data with `TheoryData` for better readability. * Added comprehensive tests in `KeybindTests.cs` to validate the new `Keybind` behavior, including equality checks, hash code generation, and handling of non-standard modifier combinations. * Updated `KeybindHookTests.cs` to ensure the new keybinding system integrates correctly with the low-level keyboard hook implementation.
PreviousNext