Commit Graph
262 Commits
Author SHA1 Message Date
Christoph Leimbrock 6491b50ce8 feat: Add support for JIS keys 2021-01-06 18:06:55 +01:00
Christoph Leimbrock c987a00b0e fix: Properly initialise tables for HID and CG key code name lookups 2021-01-05 15:19:23 +01:00
C.W. Betts ddfa30fbcc Better NS_ERROR_ENUMs in a few places. 2020-12-01 03:56:00 -07:00
C.W. Betts 09fb633863 More usage of NS_ERROR_ENUM. 2020-11-19 23:09:45 -07:00
J-rg b045fa88dd Fix control button label localization
In OEControlsButtonSetupView, we use the label to get the localization from ControlLabels.string, so if a key also exists in Localizable.strings, the localization from ControlLabels.strings, which might be different to account for the restricted space, is ignored, as the key changed due to localizing it here.
2020-11-15 21:12:56 +01:00
J-rg d8b1a24062 Rename “Pause” control label to “Pause/Resume” 2020-11-15 20:02:45 +01:00
C.W. Betts 500feecbf6 Add NS_ENUM/NS_OPTIONS to OEHIDEvents.
Mark a couple enums as closed.
2020-11-04 15:09:03 -07:00
Daniele Cattaneo 0fe2412465 Avoid crashes when decoding OEEvent by not archiving the underlying NSEvent.
NSEvent is considered an user-interface-level API, so it is not safe to use it in a background thread.
Thread-safety related crashes were observed in -[NSEvent eventWithCGEvent:] on macOS Mojave 10.14.6 (18G6032).

The only effective change is that OEEvent no longer forwards invocations to the underlying NSEvent, but no explicit uses of this were found nor observed in the codebase.
2020-10-25 20:37:54 +01:00
Daniele Cattaneo 12080a6835 OESystemController: load systemIcons lazily.
Many plugins set the icon by overriding the systemIcon property in code. This change avoids lookups of null image names.
2020-10-25 20:24:55 +01:00
Daniele Cattaneo 459fcf0a75 Add support for a new key in the Info plist of system plugins for specifying alternate region-specific system names. 2020-10-21 21:35:39 +02:00
Stuart Carnie 60ef26a86d refactor: Use static O(1) lookip for HID / virtual key lookup tables 2020-10-18 17:11:04 -07:00
Stuart Carnie f4aff64d34 feat: Add fallback Controller-Database.plist for 3rd parties
Should consider removing Controller-Database.plist from OpenEmu
2020-10-18 16:22:14 -07:00
J-rg 1c414b72eb Remove SDK framework references, as CLANG_MODULES_AUTOLINK is enabled 2020-10-18 00:55:36 +02:00
J-rg 49a95defca Modernize Info.plist files 2020-10-18 00:47:22 +02:00
J-rg f9f0b6ee85 Remove empty InfoPlist.strings files 2020-10-18 00:47:22 +02:00
clobber f892b99f73 Support OESystemMedia in the system plugins. 2020-09-19 17:21:17 -05:00
clobber fff590bbf6 OESystemController: Update some documentation. 2020-09-19 00:24:44 -05:00
clobber 0a9a386002 Rename supportsDiscs property. 2020-09-18 15:28:13 -05:00
clobber 30a771e1b0 OEDiscDescriptor: handle parse errors with more detail 2020-09-08 22:44:59 -05:00
Stuart Carnie b68d8f2b43 Improve Swift interop 2020-08-19 17:37:43 -07:00
Stuart Carnie 99aada9a65 kVK_RightCommand is available in 10.14 SDK, which is our target version 2020-08-19 17:37:09 -07:00
Stuart Carnie b990e6496f chore: Fix compiler warnings about importing public headers 2020-07-26 07:45:00 -07:00
Stuart Carnie 547e4d4ca5 fix: Remove VALID_ARCH restriction to allow universal support 2020-07-06 17:44:47 -07:00
Stuart Carnie 82c34fd550 chore: Improve Swift ergonomics 2020-01-26 10:27:47 -07:00
Stuart Carnie 3dee7618ae feat: Swift API ergonomics 2020-01-15 22:50:05 -07:00
C.W. Betts f54c09396f Use NSBundle's imageForResource: it actually loads @2x images. 2020-01-14 16:54:23 -07:00
clobber 4ffaa87499 Clean up 2531e9d7aa 2020-01-08 14:13:57 -07:00
clobber 2531e9d7aa Add kHIDUsage_GD_SystemMainMenu element to the Generic Desktop buttons.
Used by the "Home" button on the Retro-Bit Official Sega Genesis/Saturn Bluetooth Controller 8-Button Arcade Pad
2020-01-08 14:11:53 -07:00
Daniele Cattaneo 5d351ed08f Work around a performance issue in IOHIDElementGetParent in macOS Catalina. 2020-01-05 19:20:18 +01:00
clobber 43151f5e05 Teach the parser about the two new controls handled by the system, they can either be triggers or buttons. 2020-01-03 13:07:28 +01:00
clobber 5890556da3 Add support for analogic brake and accelerator.
For now we limit our supports to those two and keeping this as a trial balloon. The HID specs specify that these values are dynamic (like an axis) but I've not seen enough of those to know if that's always the case or if they are sometimes used as a button. For now, we only mark them as a type of trigger if the difference between the minimum and maximum are greater than 1 which would be seen as a button. We also assume the minimum value is the resting point so they behave like triggers. Future improvements may include new supported element types or a complete separation of those types of controls into their own OEHIDEventType.
2020-01-03 06:18:27 +01:00
Daniele Cattaneo b632e05be9 Enlarge the minimum range of values required to enable auto-calibration. 2020-01-01 03:01:10 +01:00
Daniele Cattaneo 8ca6a436eb Fix handling of center value to restore behavior originally introduced in commit fbb49c7. Do not regress wrt commit 367241c by enabling/disabling auto-calibration independently on each axis direction. 2019-12-31 17:34:10 +01:00
Daniele Cattaneo 6dd2985318 Add some missing nullability annotations. 2019-12-15 00:52:48 +01:00
Daniele Cattaneo 1591205112 Allow disabling auto-calibration from the device database. 2019-12-15 00:43:11 +01:00
Daniele Cattaneo 5812663036 Minor cleanup and removal of duplicated code. 2019-12-14 23:28:02 +01:00
Daniele Cattaneo ae7ded2f2e Move the rest of the axis calibration logic from OEHIDEvent to OEDeviceHandler 2019-12-14 23:09:36 +01:00
Daniele Cattaneo 9d95603eb3 Disable auto-calibration for known controllers that don't need it. 2019-12-14 19:40:42 +01:00
Daniele Cattaneo 9ad60adfed Fix PS4 and PS3 controller identification which got accidentally mixed-up in commit 75d11f2. 2019-12-14 19:40:00 +01:00
Daniele Cattaneo 107bf6352d Refactor calibration methods in OESwitchProControllerHIDDeviceHandler to avoid name clashes with auto-calibration related methods. 2019-12-14 18:44:35 +01:00
Daniele Cattaneo 367241c7b7 Enable auto-calibration only when the range of inputs seen is larger than the deadzone.
Fixes controllers that exhibit some jitter when the sticks are resting (for example the PS4 controller)
2019-12-14 18:42:35 +01:00
Daniele Cattaneo 69a528a911 Fix a rare crash that could happen when quitting OpenEmu while a Switch Pro Controller is connected. 2019-12-13 23:00:38 +01:00
Daniele Cattaneo d1c1ea69ca Don't randomly disconnect Wiimote-like controllers when closing a game. 2019-12-13 22:45:52 +01:00
Daniele Cattaneo e0a3bcff5a Initialize auto-calibration with a plausible default for the Wii U Pro Controller. 2019-12-13 22:45:52 +01:00
Daniele Cattaneo 38974f7ad7 Expose methods to allow modification of the current state of the auto-calibration system. 2019-12-13 22:45:52 +01:00
Daniele Cattaneo c8f87cfbc4 Enable auto-calibration for Wiimote-like devices. 2019-12-13 22:45:52 +01:00
clobber a64f70d713 Support OESystemType in the system plugins. 2019-12-12 22:36:18 -07:00
clobber 730d9e593b GameCube controllers as exposed by Mayflash GameCube Controller adapter have 6 axes whose values all span from 0 to 255, they have 2 analog sticks (4 axes) and 2 triggers (2 axes), with our current algorithm it is impossible to know which is which. This patch adds a new heuristic to differentiate those axes. If we have 6 axes there's a good chance the controller does not have 3 analog sticks but 2 and 2 triggers, assume that the first 4 axes we find are analog sticks and the last 2 are triggers. 2019-12-10 23:34:15 -08:00
clobber e67bd42d09 Mayflash GameCube 2 port USB adapter declares two devices that look exactly the same with the same LocationID, the only thing that differentiates them is there kUSBInterfaceNumber. Use that in the -uniqueIdentifier which is what we use to differentiate devices to assign bindings. This patch also moves the hack to differentiate devices that do not have a LocationID from -locationID to -uniqueIdentifier where we also cache the identifier instead of regenerating it every time the method is called. 2019-12-10 23:29:58 -08:00
clobberandGitHub 95a72bac60 Merge pull request #25 from piki/piki/auto-calibrate
Automatically calibrate analog axes
2019-12-09 23:58:10 -06:00