Overview
Comment: | Add OHGamepad |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA3-256: |
c45b04b1f8f1033d61ecd69bc28fee03 |
User & Date: | js on 2024-06-04 23:51:18 |
Other Links: | manifest | tags |
Context
2024-06-08
| ||
19:18 | ObjFWHID: Restore XInput support check-in: 5f0cc05894 user: js tags: trunk | |
2024-06-04
| ||
23:51 | Add OHGamepad check-in: c45b04b1f8 user: js tags: trunk | |
2024-06-03
| ||
19:53 | Compile OHEvdevGameController separately check-in: 82da883fa6 user: js tags: trunk | |
Changes
Modified src/OFHostAddressResolver.m from [3978a3f46f] to [1f05972ec7].
︙ | |||
111 112 113 114 115 116 117 | 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 | - + | object: exception repeats: false]; [[OFRunLoop currentRunLoop] addTimer: timer forMode: runLoopMode]; } } |
︙ |
Modified src/OFTarArchive.m from [300800373d] to [0a16baeb97].
︙ | |||
73 74 75 76 77 78 79 | 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 | - + | } - (instancetype)of_initWithArchive: (OFTarArchive *)archive stream: (OFStream *)stream entry: (OFTarArchiveEntry *)entry; @end |
︙ |
Modified src/hid/Makefile from [c92a9269e5] to [f964e9ff82].
︙ | |||
11 12 13 14 15 16 17 18 | 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 | + - + + - + + | SRCS = OHGameController.m \ OHGameControllerAxis.m \ OHGameControllerButton.m \ OHGameControllerDirectionalPad.m \ OHGameControllerElement.m \ OHGameControllerProfile.m \ OHGamepad.m \ ${USE_SRCS_EVDEV} |
︙ |
Modified src/hid/OHEvdevGameController.h from [95f3f59293] to [10dbd16290].
︙ | |||
30 31 32 33 34 35 36 | 30 31 32 33 34 35 36 37 38 39 40 41 | - - + + | bool _discardUntilReport; unsigned long *_evBits, *_keyBits, *_absBits; uint16_t _vendorID, _productID; OFString *_name; OHGameControllerProfile *_rawProfile; } |
Modified src/hid/OHEvdevGameController.m from [4aad12f123] to [f6abf87a47].
︙ | |||
27 28 29 30 31 32 33 34 35 36 37 38 39 40 | 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 | + | #import "OFArray.h" #import "OFDictionary.h" #import "OFFileManager.h" #import "OFLocale.h" #import "OFNumber.h" #import "OHEvdevGamepad.h" #import "OHGameControllerAxis.h" #import "OHGameControllerButton.h" #import "OHGameControllerProfile.h" #include <sys/ioctl.h> #include <linux/input.h> |
︙ | |||
48 49 50 51 52 53 54 | 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 | - + | { @public int32_t _minValue, _maxValue; } @end @interface OHEvdevGameControllerProfile: OHGameControllerProfile |
︙ | |||
112 113 114 115 116 117 118 | 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 | - + - + - + - + | case BTN_MODE: return @"Mode"; case BTN_THUMBL: return @"Thumb L"; case BTN_THUMBR: return @"Thumb R"; case BTN_DPAD_UP: |
︙ | |||
282 283 284 285 286 287 288 | 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 | - + | if (![device hasPrefix: @"event"]) continue; path = [@"/dev/input" stringByAppendingPathComponent: device]; @try { controller = [[[OHEvdevGameController alloc] |
︙ | |||
304 305 306 307 308 309 310 | 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 | - + | [controllers makeImmutable]; objc_autoreleasePoolPop(pool); return controllers; } |
︙ | |||
411 412 413 414 415 416 417 | 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 | - + - + | [axes setObject: axis forKey: axisName]; } } } [axes makeImmutable]; _rawProfile = [[OHEvdevGameControllerProfile alloc] |
︙ | |||
452 453 454 455 456 457 458 | 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 | - + | } - (OFNumber *)productID { return [OFNumber numberWithUnsignedShort: _productID]; } |
︙ | |||
545 546 547 548 549 550 551 | 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 | - + | requestedLength: sizeof(event) errNo: errno]; } if (_discardUntilReport) { if (event.type == EV_SYN && event.value == SYN_REPORT) { _discardUntilReport = false; |
︙ | |||
590 591 592 593 594 595 596 597 598 599 600 601 602 603 | 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 | + + + + + + + + + + | axis.value = scale(event.value, axis->_minValue, axis->_maxValue); break; } } } - (OHGamepad *)gamepad { @try { return [[[OHEvdevGamepad alloc] initWithController: self] autorelease]; } @catch (OFInvalidArgumentException *e) { return nil; } } - (OFComparisonResult)compare: (OHEvdevGameController *)otherController { unsigned long long selfIndex, otherIndex; if (![otherController isKindOfClass: [OHEvdevGameController class]]) @throw [OFInvalidArgumentException exception]; |
︙ | |||
615 616 617 618 619 620 621 | 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 | - + | } @end @implementation OHEvdevGameControllerAxis @end @implementation OHEvdevGameControllerProfile |
︙ |
Added src/hid/OHEvdevGamepad.h version [f433593f5a].
|
Added src/hid/OHEvdevGamepad.m version [a03c43c125].