private void mKeyTextBox_PreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e) { if (!this.IsLoaded) { return; } KMManager.sGamepadDualTextbox = this; KMManager.pressedGamepadKeyList.Clear(); KMManager.CallGamepadHandler(this.ParentWindow, "true"); }
protected override void OnGotFocus(RoutedEventArgs e) { base.OnGotFocus(e); KMManager.CurrentIMapTextBox = this; KMManager.pressedGamepadKeyList.Clear(); KMManager.CallGamepadHandler(BlueStacksUIUtils.LastActivatedWindow, "true"); this.TextChanged -= new TextChangedEventHandler(this.IMapTextBox_TextChanged); this.TextChanged += new TextChangedEventHandler(this.IMapTextBox_TextChanged); this.PreviewMouseWheel -= new MouseWheelEventHandler(this.IMapTextBox_PreviewMouseWheel); this.PreviewMouseWheel += new MouseWheelEventHandler(this.IMapTextBox_PreviewMouseWheel); this.SetCaretIndex(); }
private void SetValueHandling(IMActionItem item) { string str = item.IMAction[item.ActionItem].ToString(); if (this.IsLoaded) { KMManager.CallGamepadHandler(BlueStacksUIUtils.LastActivatedWindow, "true"); } if (this.PropertyType.Equals(typeof(double))) { if (double.TryParse(this.Text, out double _)) { str = this.Text; } else if (!string.IsNullOrEmpty(this.Text)) { this.Text = str; } } else if (this.PropertyType.Equals(typeof(int))) { if (int.TryParse(this.Text, out int _)) { str = this.Text; } else if (!string.IsNullOrEmpty(this.Text)) { this.Text = str; } } else { str = !this.PropertyType.Equals(typeof(bool)) ? this.Tag.ToString() : this.Tag.ToString(); } IMapTextBox.Setvalue(item, str); }