Ported Veency to 3.x.
[veency.git] / Hook.mm
1 #include <dlfcn.h>
2 #include <objc/runtime.h>
3
4 extern "C" void TweakInitialize() {
5 if (Class star = objc_getClass("UIKeyboardLayoutStar")) {
6 Method method(class_getInstanceMethod(objc_getClass("UIKeyboardLayoutRoman"), @selector(handleHardwareKeyDownFromSimulator:)));
7 class_addMethod(star, @selector(handleHardwareKeyDownFromSimulator:), method_getImplementation(method), method_getTypeEncoding(method));
8 }
9 }