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(); } }); } } }
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(); } }
internal void Focus() { if (!focused) { Main.clrInput(); focused = true; Main.blockInput = true; OnFocus?.Invoke(); } }
private void OnInputFocus() { if (Value != null || Options != null && Options.Any()) { ToggleState = true; } if (!string.IsNullOrWhiteSpace(Value)) { OnFocus?.Invoke(Value); } }
public void Focus() { if (!focused) { Main.clrInput(); focused = true; Main.blockInput = true; cursorPos = currentString.Length; OnFocus?.Invoke(); } }
public void Focus() { if (!focused) { focused = true; Main.blockInput = true; Main.clrInput(); OnFocus?.Invoke(); counter = 0; } }
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) { 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; } }
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(); } }
void video_Touch(object sender, View.TouchEventArgs e) { //TODO CHECK CAN ACTUALLY DO FOCUS... if (e.Event.Action == MotionEventActions.Up && !focussing) { focussing = true; Rect rect = active; //Log.i("onAreaTouchEvent", "SENSOR_INFO_ACTIVE_ARRAY_SIZE,,,,,,,,rect.left--->" + rect.left + ",,,rect.top--->" + rect.top + ",,,,rect.right--->" + rect.right + ",,,,rect.bottom---->" + rect.bottom); Size size = pixel; //Log.i("onAreaTouchEvent", "mCameraCharacteristics,,,,size.getWidth()--->" + size.getWidth() + ",,,size.getHeight()--->" + size.getHeight()); int areaSize = 200; int right = rect.Right; int bottom = rect.Bottom; int viewWidth = View.Width; int viewHeight = View.Height; int ll, rr; Rect newRect; int centerX = (int)e.Event.GetX(); int centerY = (int)e.Event.GetY(); ll = ((centerX * right) - areaSize) / viewWidth; rr = ((centerY * bottom) - areaSize) / viewHeight; int focusLeft = Clamp(ll, 0, right); int focusBottom = Clamp(rr, 0, bottom); newRect = new Rect(focusLeft, focusBottom, focusLeft + areaSize, focusBottom + areaSize); float x = e.Event.GetX(); float y = e.Event.GetY(); //Rect touchRect = new Rect( // (int)(x - 70), // (int)(y - 70), // (int)(x + 70), // (int)(y + 70)); OnFocus?.Invoke(newRect); focusring.LayoutParameters = new FrameLayout.LayoutParams(focusring.LayoutParameters) { MarginStart = (int)x - (int)TypedValue.ApplyDimension(ComplexUnitType.Dip, 40, Resources.DisplayMetrics), TopMargin = (int)y - (int)TypedValue.ApplyDimension(ComplexUnitType.Dip, 40, Resources.DisplayMetrics) }; focusring.Visibility = ViewStates.Visible; Animation scaleup = AnimationUtils.LoadAnimation(Context, Resource.Animation.scaleup); scaleup.Interpolator = new DecelerateInterpolator(); scaleup.Duration = 300; inner_ring.StartAnimation(scaleup); Animation scaledown = AnimationUtils.LoadAnimation(Context, Resource.Animation.scaledown); scaledown.Duration = 300; scaledown.Interpolator = new DecelerateInterpolator(); outer_ring.StartAnimation(scaledown); //View.SetHaveTouch(true, touchRect); //drawingView.Invalidate(); // // Remove the square indicator after 1000 msec Handler handler = new Handler(); handler.PostDelayed(() => { //drawingView.setHaveTouch(false, new Rect(0, 0, 0, 0)); focusring.Visibility = ViewStates.Invisible; focussing = false; //drawingView.Invalidate(); }, 800); } }
bool IFocusable.Focus() { OnFocus?.Invoke(this); return(true); }
public virtual void Focus() { OnFocus?.Invoke(); }
internal void _OnFocus(EventArgs eventArgs) { OnFocus?.Invoke(this, eventArgs); Utils.Call("self.EventStarted = False"); }
private void Focus(IOption <T> o) { _focused = o; OnFocus?.Invoke(o); }
private void OnPointerEnter() { OnFocus?.Invoke(); }
public static void OnFocusHook() { OnFocus?.Invoke(null, EventArgs.Empty); }