1
0
şunun yansıması https://github.com/lint/NewTermArrows eşitlendi 2025-07-03 19:36:45 +00:00

Initial release

Bu işleme şunda yer alıyor:
lint
2019-11-19 00:48:05 -05:00
ebeveyn 44468c54c1
işleme 6cc1b30a2c
4 değiştirilmiş dosya ile 92 ekleme ve 0 silme

12
Makefile Normal dosya
Dosyayı Görüntüle

@ -0,0 +1,12 @@
ARCHS = arm64 arm64e
include $(THEOS)/makefiles/common.mk
TWEAK_NAME = NewTermArrows
NewTermArrows_FILES = Tweak.xm
NewTermArrows_CFLAGS += -fobjc-arc
include $(THEOS_MAKE_PATH)/tweak.mk
after-install::
install.exec "killall -9 NewTerm"

1
NewTermArrows.plist Normal dosya
Dosyayı Görüntüle

@ -0,0 +1 @@
{ Filter = { Bundles = ( "ws.hbang.Terminal" ); }; }

70
Tweak.xm Normal dosya
Dosyayı Görüntüle

@ -0,0 +1,70 @@
@interface TerminalKeyInput
-(void)upKeyPressed;
-(void)downKeyPressed;
-(void)leftKeyPressed;
-(void)rightKeyPressed;
@property(strong, nonatomic) NSTimer *haTimer;
-(void) haHandleLongPress:(UILongPressGestureRecognizer *) arg1;
@end
%hook TerminalKeyInput
%property(strong, nonatomic) NSTimer *haTimer;
-(id) initWithFrame:(CGRect) arg1 {
id orig = %orig;
UILongPressGestureRecognizer *upLongPress = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(haHandleLongPress:)];
UILongPressGestureRecognizer *downLongPress = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(haHandleLongPress:)];
UILongPressGestureRecognizer *leftLongPress = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(haHandleLongPress:)];
UILongPressGestureRecognizer *rightLongPress = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(haHandleLongPress:)];
id keyboardToolbar = MSHookIvar<id>(self, "toolbar");
[MSHookIvar<UIButton *>(keyboardToolbar, "upKey") addGestureRecognizer:upLongPress];
[MSHookIvar<UIButton *>(keyboardToolbar, "downKey") addGestureRecognizer:downLongPress];
[MSHookIvar<UIButton *>(keyboardToolbar, "leftKey") addGestureRecognizer:leftLongPress];
[MSHookIvar<UIButton *>(keyboardToolbar, "rightKey") addGestureRecognizer:rightLongPress];
return orig;
}
%new
-(void) haHandleLongPress:(UILongPressGestureRecognizer *) recognizer {
NSString *keyName = [[recognizer view] accessibilityLabel];
if (recognizer.state == UIGestureRecognizerStateBegan){
if (![self haTimer]){
if ([keyName isEqualToString:@"Up"]){
[self setHaTimer:[NSTimer scheduledTimerWithTimeInterval:0.1 target:self selector:@selector(upKeyPressed) userInfo:nil repeats:YES]];
} else if ([keyName isEqualToString:@"Down"]){
[self setHaTimer:[NSTimer scheduledTimerWithTimeInterval:0.1 target:self selector:@selector(downKeyPressed) userInfo:nil repeats:YES]];
} else if ([keyName isEqualToString:@"Left"]){
[self setHaTimer:[NSTimer scheduledTimerWithTimeInterval:0.1 target:self selector:@selector(leftKeyPressed) userInfo:nil repeats:YES]];
} else if ([keyName isEqualToString:@"Right"]){
[self setHaTimer:[NSTimer scheduledTimerWithTimeInterval:0.1 target:self selector:@selector(rightKeyPressed) userInfo:nil repeats:YES]];
}
}
} else if (recognizer.state == UIGestureRecognizerStateEnded){
if ([self haTimer]){
[[self haTimer] invalidate];
[self setHaTimer:nil];
}
}
}
%end
%ctor {
%init(TerminalKeyInput = objc_getClass("NewTerm.TerminalKeyInput"));
}

9
control Normal dosya
Dosyayı Görüntüle

@ -0,0 +1,9 @@
Package: com.lint.ntarrows
Name: NewTermArrows
Depends: mobilesubstrate
Version: 1.0.0
Architecture: iphoneos-arm
Description: Allows you to hold down the arrow keys to move the cursor in New Term.
Maintainer: lint
Author: lint
Section: Tweaks