]> git.cameronkatri.com Git - tweaks.git/commitdiff
Add HapticKeyboard
authorCameron Katri <me@cameronkatri.com>
Sun, 8 Aug 2021 20:37:36 +0000 (16:37 -0400)
committerCameron Katri <me@cameronkatri.com>
Sun, 8 Aug 2021 20:37:36 +0000 (16:37 -0400)
HapticKeyboard/HapticKeyboard.plist [new file with mode: 0644]
HapticKeyboard/Makefile [new file with mode: 0644]
HapticKeyboard/Tweak.x [new file with mode: 0644]
HapticKeyboard/control [new file with mode: 0644]

diff --git a/HapticKeyboard/HapticKeyboard.plist b/HapticKeyboard/HapticKeyboard.plist
new file mode 100644 (file)
index 0000000..e5c60ee
--- /dev/null
@@ -0,0 +1 @@
+{ Filter = { Bundles = ( "com.apple.UIKit" ); }; }
diff --git a/HapticKeyboard/Makefile b/HapticKeyboard/Makefile
new file mode 100644 (file)
index 0000000..e71a51e
--- /dev/null
@@ -0,0 +1,13 @@
+TARGET := iphone:clang:latest:7.0
+INSTALL_TARGET_PROCESSES = SpringBoard
+
+ARCHS := arm64 arm64e
+
+include $(THEOS)/makefiles/common.mk
+
+TWEAK_NAME = HapticKeyboard
+
+HapticKeyboard_FILES = Tweak.x
+HapticKeyboard_CFLAGS = -fobjc-arc
+
+include $(THEOS_MAKE_PATH)/tweak.mk
diff --git a/HapticKeyboard/Tweak.x b/HapticKeyboard/Tweak.x
new file mode 100644 (file)
index 0000000..847cb80
--- /dev/null
@@ -0,0 +1,17 @@
+@interface UIKeyboardLayoutStar : UIView
+@property (nonatomic, retain) UIImpactFeedbackGenerator *feedback;
+@end
+
+%hook UIKeyboardLayoutStar
+%property (nonatomic, retain) UIImpactFeedbackGenerator *feedback;
+
+-(void)touchDownWithKey:(id)arg1 withTouchInfo:(id)arg2 atPoint:(CGPoint)arg3 executionContext:(id)arg4
+{
+       %orig;
+       if (!self.feedback)
+               self.feedback = UIImpactFeedbackGenerator.alloc.init;
+       [self.feedback prepare];
+       [self.feedback impactOccurred];
+}
+
+%end
diff --git a/HapticKeyboard/control b/HapticKeyboard/control
new file mode 100644 (file)
index 0000000..b416885
--- /dev/null
@@ -0,0 +1,9 @@
+Package: com.cameronkatri.haptickeyboard
+Name: HapticKeyboard
+Version: 0.0.1
+Architecture: iphoneos-arm
+Description: An awesome MobileSubstrate tweak!
+Maintainer: Cameron Katri <me@cameronkatri.com>
+Author: Cameron Katri <me@cameronkatri.com>
+Section: Tweaks
+Depends: mobilesubstrate (>= 0.9.5000)