summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCameron Katri <me@cameronkatri.com>2021-08-08 16:37:36 -0400
committerCameron Katri <me@cameronkatri.com>2021-08-08 16:37:36 -0400
commit027b91b5542974670fc4186a717634d347c98df2 (patch)
tree0c065a054a3400e35402ed6fcddf2e6c26d78384
parentc014bf2300cc36b313a05745cc3f286dc906a813 (diff)
downloadtweaks-027b91b5542974670fc4186a717634d347c98df2.tar.gz
tweaks-027b91b5542974670fc4186a717634d347c98df2.tar.zst
tweaks-027b91b5542974670fc4186a717634d347c98df2.zip
Add HapticKeyboard
-rw-r--r--HapticKeyboard/HapticKeyboard.plist1
-rw-r--r--HapticKeyboard/Makefile13
-rw-r--r--HapticKeyboard/Tweak.x17
-rw-r--r--HapticKeyboard/control9
4 files changed, 40 insertions, 0 deletions
diff --git a/HapticKeyboard/HapticKeyboard.plist b/HapticKeyboard/HapticKeyboard.plist
new file mode 100644
index 0000000..e5c60ee
--- /dev/null
+++ b/HapticKeyboard/HapticKeyboard.plist
@@ -0,0 +1 @@
+{ Filter = { Bundles = ( "com.apple.UIKit" ); }; }
diff --git a/HapticKeyboard/Makefile b/HapticKeyboard/Makefile
new file mode 100644
index 0000000..e71a51e
--- /dev/null
+++ b/HapticKeyboard/Makefile
@@ -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
index 0000000..847cb80
--- /dev/null
+++ b/HapticKeyboard/Tweak.x
@@ -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
index 0000000..b416885
--- /dev/null
+++ b/HapticKeyboard/control
@@ -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)