- button down action for MOUSEPAD

This commit is contained in:
TrueZhuanjia committed 2025-06-26 01:17:31 +08:00
1 parent 594906c121
commit 9063331d38
12 files changed
+450 -26

No files matched your search

@@ -366,6 +366,7 @@ static CGRect streamViewBounds;
buttonState.backgroundAlpha = widgetView.backgroundAlpha;
buttonState.borderWidth = widgetView.borderWidth;
buttonState.vibrationStyle = widgetView.vibrationStyle;
buttonState.mouseButtonAction = widgetView.mouseButtonAction;
buttonState.sensitivityFactor = widgetView.sensitivityFactor;
buttonState.stickIndicatorOffset = widgetView.stickIndicatorOffset;
buttonState.widgetShape = widgetView.shape;
@@ -38,6 +38,7 @@ NS_ASSUME_NONNULL_BEGIN
@property (nonatomic, assign) CGFloat oscLayerSizeFactor; // for OnScreenController CALayer
@property (nonatomic, assign) CGFloat backgroundAlpha; // for OnScreenController CALayer
@property (nonatomic, assign) uint8_t vibrationStyle; // for OnScreenController CALayer
@property (nonatomic, assign) uint8_t mouseButtonAction; // for OnScreenController CALayer
// @property (nonatomic, assign) BOOL hasValidPosition;
@@ -46,6 +47,14 @@ typedef NS_ENUM(NSInteger, OnScreenButtonType) {
CustomOnScreenWidget
};
typedef NS_ENUM(NSInteger, MouseButtonAction) {
hovering,
leftButtonDown,
middleButtonDown,
rightButtonDown,
};
- (id) initWithButtonName:(NSString*)name buttonType:(uint8_t)buttonType andPosition:(CGPoint)position;
+ (BOOL) supportsSecureCoding;
@@ -34,6 +34,7 @@
[encoder encodeObject:self.alias forKey:@"alias"];
[encoder encodeInt:self.buttonType forKey:@"buttonType"];
[encoder encodeInt:self.vibrationStyle forKey:@"vibrationStyle"];
[encoder encodeInt:self.mouseButtonAction forKey:@"mouseButtonAction"];
[encoder encodeCGPoint:self.position forKey:@"position"];
[encoder encodeBool:self.isHidden forKey:@"isHidden"];
[encoder encodeFloat:self.widthFactor forKey:@"widthFactor"];
@@ -53,6 +54,7 @@
self.alias = [decoder decodeObjectForKey:@"alias"];
self.buttonType = [decoder decodeIntForKey:@"buttonType"];
self.vibrationStyle = [decoder decodeIntForKey:@"vibrationStyle"];
self.mouseButtonAction = [decoder decodeIntForKey:@"mouseButtonAction"];
self.position = [decoder decodeCGPointForKey:@"position"];
self.isHidden = [decoder decodeBoolForKey:@"isHidden"];
self.widthFactor = [decoder decodeFloatForKey:@"widthFactor"];