Merge pull request #1065 from Jazzzny/betterthanzoe-keyboardfix

Enhancement - Implement injector kext to fix Function Keys on legacy units
This commit is contained in:
Mykola Grymalyuk
2023-05-18 13:56:16 -07:00
committed by GitHub
7 changed files with 35 additions and 4 deletions

View File

@@ -17,6 +17,8 @@
- Resolve kernel panic on wake for AMD TeraScale 1 and Nvidia Tesla 8000 series GPUs
- Resolve graphics corruption on wake for TeraScale 1
- Patch currently limited to Ventura and newer
- Restore Function Keys on MacBook5,2 and MacBook4,1
- Implementation by [@jazzzny](https://github.com/Jazzzny)
- Increment Binaries:
- PatcherSupportPkg 1.0.1 - release
- OpenCorePkg 0.9.2 - release

View File

@@ -91,6 +91,8 @@ To run the project from source, see here: [Build and run from source](./SOURCE.m
* Aid with Nvidia Web Driver research and development
* [joevt](https://github.com/joevt)
* [FixPCIeLinkrate](https://github.com/joevt/joevtApps)
* [Jazzzny](https://github.com/Jazzzny)
* Research and various contributions to the project
* Amazing users who've graciously donate hardware:
* [JohnD](https://forums.macrumors.com/members/johnd.53633/) - 2013 Mac Pro
* [SpiGAndromeda](https://github.com/SpiGAndromeda) - AMD Vega 64

View File

@@ -298,7 +298,8 @@ Below is an explanation of what Kexts OpenCore Legacy Patcher will inject into m
* Reason: Prevents AVXFSCompressionTypeZlib crash on pre AVX1.0 systems in 12.4+
* SimpleMSR
* Reason: Disables BD PROCHOT to prevent firmware throttling on Nehalem+ MacBooks
* LegacyKeyboardInjector
* Reason: Fixes function keys on MacBook4,1/MacBook5,2
:::

View File

@@ -1383,6 +1383,24 @@
<key>PlistPath</key>
<string>Contents/Info.plist</string>
</dict>
<dict>
<key>Arch</key>
<string>x86_64</string>
<key>BundlePath</key>
<string>LegacyKeyboardInjector.kext</string>
<key>Comment</key>
<string>Legacy Keyboard support for macOS 11+</string>
<key>Enabled</key>
<false/>
<key>ExecutablePath</key>
<string></string>
<key>MaxKernel</key>
<string></string>
<key>MinKernel</key>
<string>20.0.0</string>
<key>PlistPath</key>
<string>Contents/Info.plist</string>
</dict>
<dict>
<key>Arch</key>
<string>x86_64</string>

Binary file not shown.

View File

@@ -192,19 +192,20 @@ class BuildMiscellaneous:
Trackpad Handler
"""
# Pre-Force Touch trackpad support for macOS Ventura
# Pre-Force Touch trackpad & keyboard support for macOS Ventura
if smbios_data.smbios_dictionary[self.model]["CPU Generation"] < cpu_data.cpu_data.skylake.value:
if self.model.startswith("MacBook"):
# These units got force touch early, so ignore them
# These units got force touch & the new keyboard mapping early, so ignore them
if self.model not in ["MacBookPro11,4", "MacBookPro11,5", "MacBookPro12,1", "MacBook8,1"]:
support.BuildSupport(self.model, self.constants, self.config).enable_kext("AppleUSBTopCase.kext", self.constants.topcase_version, self.constants.top_case_path)
support.BuildSupport(self.model, self.constants, self.config).get_kext_by_bundle_path("AppleUSBTopCase.kext/Contents/PlugIns/AppleUSBTCButtons.kext")["Enabled"] = True
support.BuildSupport(self.model, self.constants, self.config).get_kext_by_bundle_path("AppleUSBTopCase.kext/Contents/PlugIns/AppleUSBTCKeyboard.kext")["Enabled"] = True
support.BuildSupport(self.model, self.constants, self.config).get_kext_by_bundle_path("AppleUSBTopCase.kext/Contents/PlugIns/AppleUSBTCKeyEventDriver.kext")["Enabled"] = True
support.BuildSupport(self.model, self.constants, self.config).enable_kext("AppleUSBMultitouch.kext", self.constants.multitouch_version, self.constants.multitouch_path)
# Legacy Trackpad support
# Legacy Trackpad & Keyboard support
if self.model in ["MacBook4,1", "MacBook5,2"]:
support.BuildSupport(self.model, self.constants, self.config).enable_kext("AppleUSBTrackpad.kext", self.constants.apple_trackpad, self.constants.apple_trackpad_path)
support.BuildSupport(self.model, self.constants, self.config).enable_kext("LegacyKeyboardInjector.kext", self.constants.legacy_keyboard, self.constants.legacy_keyboard_path) # Inject legacy personalities into AppleUSBTCKeyboard and AppleUSBTCKeyEventDriver
def _thunderbolt_handling(self) -> None:

View File

@@ -104,6 +104,9 @@ class Constants:
## https://github.com/flagersgit/KDKlessWorkaround
self.kdkless_version: str = "1.0.0"
## Jazzzny
self.legacy_keyboard: str = "1.0.0" # LegacyKeyboardInjector - Jazzzny
# Get resource path
self.current_path: Path = Path(__file__).parent.parent.resolve()
self.original_path: Path = Path(__file__).parent.parent.resolve()
@@ -496,6 +499,10 @@ class Constants:
@property
def apple_isight_path(self):
return self.payload_kexts_path / Path(f"Misc/LegacyUSBVideoSupport-v{self.apple_isight_version}.zip")
@property
def legacy_keyboard_path(self):
return self.payload_kexts_path / Path(f"Misc/LegacyKeyboardInjector-v{self.legacy_keyboard}.zip")
@property
def apple_raid_path(self):