protected void OnFocusEvent(FocusEventArgs?e) { if (OnFocus.HasDelegate) { OnFocus.InvokeAsync(e); } }
public void HandleFocus(string value) { if (OnFocus.HasDelegate) { OnFocus.InvokeAsync(value); } }
void OnWindowsEvent(IntPtr hWinEventHook, uint eventType, IntPtr hwnd, int idObject, int idChild, uint dwEventThread, uint dwmsEventTime) { if (eventType == WinEvent.EVENT_SYSTEM_MINIMIZEEND || eventType == WinEvent.EVENT_SYSTEM_FOREGROUND) { FocusedWindow = GetWindowTitle(hwnd); if (IsPathOfExileInFocus || IsSidekickInFocus) { logger.LogInformation("Path of Exile focused."); PathOfExileWasMinimized = false; OnFocus?.Invoke(); } else if (!PathOfExileWasMinimized) { PathOfExileWasMinimized = true; logger.LogInformation("Path of Exile minimized."); OnBlur?.Invoke(); } // If the game is run as administrator, Sidekick also needs administrator privileges. if (!PermissionChecked && IsPathOfExileInFocus) { PermissionChecked = true; Task.Run(async() => { if (!IsUserRunAsAdmin() && IsPathOfExileRunAsAdmin()) { await RestartAsAdmin(); } }); } } }
internal virtual async Task OnFocusAsync(FocusEventArgs e) { if (OnFocus.HasDelegate) { await OnFocus.InvokeAsync(e); } }
/// <summary> /// Assigns all events to the selectable, since there are so many of them. /// </summary> /// <param name="selectable">The selectable to assign events to.</param> /// <param name="i">The index of the methods array.</param> /// <param name="j">The number to pass into the method.</param> private void AssignSelectable(KMSelectable selectable, ref int i, ref int j) { if (OnCancel != null && i < OnCancel.Length) { selectable.OnCancel += OnCancel[i](j); } if (OnDefocus != null && i < OnDefocus.Length) { selectable.OnDefocus += OnDefocus[i](j); } if (OnDeselect != null && i < OnDeselect.Length) { selectable.OnDeselect += OnDeselect[i](j); } if (OnFocus != null && i < OnFocus.Length) { selectable.OnFocus += OnFocus[i](j); } if (OnHighlight != null && i < OnHighlight.Length) { selectable.OnHighlight += OnHighlight[i](j); } if (OnHighlightEnded != null && i < OnHighlightEnded.Length) { selectable.OnHighlightEnded += OnHighlightEnded[i](j); } if (OnInteract != null && i < OnInteract.Length) { selectable.OnInteract += OnInteract[i](j); } if (OnInteractEnded != null && i < OnInteractEnded.Length) { selectable.OnInteractEnded += OnInteractEnded[i](j); } if (OnLeft != null && i < OnLeft.Length) { selectable.OnLeft += OnLeft[i](j); } if (OnRight != null && i < OnRight.Length) { selectable.OnRight += OnRight[i](j); } if (OnSelect != null && i < OnSelect.Length) { selectable.OnSelect += OnSelect[i](j); } }
private void TextBoxAutoComplete_GotFocus(object sender, RoutedEventArgs e) { if (OnFocus != null && TextBoxAutoComplete.Text == "" && !IsMultiSelect) { ComboAutoComplete.IsDropDownOpen = true; OnFocus?.Invoke(); } }
private void TextBoxAutoComplete_GotMouseCapture(object sender, MouseEventArgs e) { if (OnFocus != null && TextBoxAutoComplete.Text == "") { ComboAutoComplete.IsDropDownOpen = true; OnFocus?.Invoke(); } }
private void TextChanged() { try { if (TextBoxAutoComplete.Text.Length > 0) { TextBoxAutoComplete.SelectionStart = TextBoxAutoComplete.Text.Length; TextBoxAutoComplete.SelectionLength = 0; } ComboAutoComplete.Items.Clear(); if (!IsMultiSelect) { Selections.Clear(); } var searchText = GetSearchText(); if (TextBoxAutoComplete.Text.Length < _searchThreshold) { ComboAutoComplete.IsDropDownOpen = false; OnClear?.Invoke(); OnFocus?.Invoke(); return; } if (string.IsNullOrEmpty(searchText)) { return; } TextBoxAutoComplete.IsEnabled = false; if (OnSearch != null) { if (ImgLoader != null) { ImgLoader.Visibility = Visibility.Visible; } var searchTask = Task.Run(() => { OnSearch?.Invoke(searchText); }, CancellationToken.None); searchTask.ContinueWith((t) => { TextBoxAutoComplete.IsEnabled = true; TextBoxAutoComplete.Focus(); Task.Delay(2000) .ContinueWith((delayTask) => { ImgLoader.Visibility = Visibility.Collapsed; }, TaskScheduler.FromCurrentSynchronizationContext()); }, TaskScheduler.FromCurrentSynchronizationContext()); } } catch { } }
public void Focus() { if (!focused) { Main.clrInput(); focused = true; OnFocus?.Invoke(); } }
public FocusNode( string name, OnFocus onFocus, int count ) : base(name) { this.focusOn = onFocus; this.count = count; }
public void OnDestroy() { if (OnFocus != null) { foreach (Delegate d in OnFocus.GetInvocationList()) { OnFocus -= (Action <IDialog>)d; } OnFocus = null; } if (OnBlur != null) { foreach (Delegate d in OnBlur.GetInvocationList()) { OnBlur -= (Action <IDialog>)d; } OnBlur = null; } if (OnShow != null) { foreach (Delegate d in OnShow.GetInvocationList()) { OnShow -= (Action <IDialog>)d; } OnShow = null; } if (OnHide != null) { foreach (Delegate d in OnHide.GetInvocationList()) { OnHide -= (Action <IDialog>)d; } OnHide = null; } if (OnClose != null) { foreach (Delegate d in OnClose.GetInvocationList()) { OnClose -= (Action <IDialog>)d; } OnClose = null; } if (OnCancel != null) { foreach (Delegate d in OnCancel.GetInvocationList()) { OnCancel -= (Action <IDialog>)d; } OnCancel = null; } }
internal void Focus() { if (!focused) { Main.clrInput(); focused = true; Main.blockInput = true; OnFocus?.Invoke(); } }
public void Focus() { if (!focused) { Main.clrInput(); focused = true; Main.blockInput = true; cursorPos = currentString.Length; OnFocus?.Invoke(); } }
internal virtual async Task OnFocusAsync(FocusEventArgs e) { IsFocused = true; if (_hasAffixWrapper) { SetClasses(); } if (OnFocus.HasDelegate) { await OnFocus.InvokeAsync(e); } }
private void OnInputFocus() { if (Value != null || Options != null && Options.Any()) { ToggleState = true; } if (!string.IsNullOrWhiteSpace(Value)) { OnFocus?.Invoke(Value); } }
private static void Update() { if (!_appFocused && UnityEditorInternal.InternalEditorUtility.isApplicationActive) { _appFocused = UnityEditorInternal.InternalEditorUtility.isApplicationActive; OnFocus?.Invoke(true); } else if (_appFocused && !UnityEditorInternal.InternalEditorUtility.isApplicationActive) { _appFocused = UnityEditorInternal.InternalEditorUtility.isApplicationActive; OnFocus?.Invoke(false); } }
public void Focus() { if (!focused) { focused = true; Main.blockInput = true; Main.clrInput(); OnFocus?.Invoke(); counter = 0; } }
public void Focus() { if (!focused) { Main.clrInput(); focused = true; Main.blockInput = true; //OnFocus?.Invoke(); //### if (OnFocus != null) { OnFocus.Invoke(); } } }
public void Focus() { if (!Focused) { foreach (var o in Options) { o.Left.Set(OptionsX, 0); } OnFocus?.Invoke(); ScaleUpBasedOnHover = false; ScaledUp = true; Focused = true; } }
internal async void Onfocus(FocusEventArgs args) { if (args == null) { return; } Focused = true; if (OnFocus.HasDelegate) { await OnFocus.InvokeAsync(args); } await JsInvokeAsync(JSInteropConstants.focus, Ref); StateHasChanged(); }
public SearchTextBox() { InitializeComponent(); this.DataContext = this; aControl.GotFocus += (s, e) => OnFocus?.Invoke(); this.MouseLeftButtonUp += (s, e) => OnFocus?.Invoke(); aControl.MouseLeftButtonUp += (s, e) => OnFocus?.Invoke(); this.aControl.KeyUp += (s, e) => { if (e.Key == Key.Down) { e.Handled = true; OnFechaAbajo?.Invoke(); } }; //aControl.PreviewMouseDown += (s, e) => { if (aControl.IsFocused) OnFocus?.Invoke(); }; }
private void FocusCamera() { //Get the center and radius of the selection bounding sphere Bounds selectionBounds = ObjectSelection.Instance.SelectionBounds; Vector3 boundsCenter = selectionBounds.center; float boundsRadius = selectionBounds.extents.magnitude; //Expand the radius to keep the camera further away from the selection boundsRadius *= focusDistMultiplier; //The normalized vector pointing towards the camera along the camera's line of sight Vector3 lookVector = (-transform.forward).normalized; //Translate the camera to the intersection point between the look vector and the expanded bounding sphere transform.position = boundsCenter + (lookVector * boundsRadius); //Notify all listeners that the camera was focused OnFocus?.Invoke(); }
public void Focus() { if (!Focused) { Main.clrInput(); Main.blockInput = true; Focused = true; if (Text == HintText) { SetText(""); } ScaleUpBasedOnHover = false; ScaledUp = true; OnFocus?.Invoke(); } }
private async Task HasGotFocus() { ValueBeforeFocus = Value; ActiveClass = ComputeClass(); AdditionalStyles = ""; decimal decValue = Convert.ToDecimal(Value); var value = decValue.ToString("G29", Culture.NumberFormat); await JsModule.InvokeVoidAsync("SetNumericTextBoxValue", new string[] { "#" + Id, value }); if (decValue == 0) { await JsModule.InvokeVoidAsync("SelectNumericTextBoxContents", new string[] { "#" + Id, VisibleValue }); } if (OnFocus != null) { await OnFocus.Invoke(); } }
protected virtual Task HandleFocus(FocusEventArgs args) { return(OnFocus.InvokeAsync(args)); }
bool IFocusable.Focus() { OnFocus?.Invoke(this); return(true); }
private void OnPointerEnter() { OnFocus?.Invoke(); }
private async Task OnOptionFocus(FocusEventArgs focusEventArgs) { await OnFocus.InvokeAsync(new ChoiceGroupOptionFocusEventArgs { Item = Item, FocusEventArgs = focusEventArgs }); }
private void Focus(FocusEventArgs e) { this._isFocused = true; OnFocus.InvokeAsync(e); }
public static void OnFocusHook() { OnFocus?.Invoke(null, EventArgs.Empty); }