Example #1
0
        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();
                        }
                    });
                }
            }
        }
Example #2
0
 private void TextBoxAutoComplete_GotFocus(object sender, RoutedEventArgs e)
 {
     if (OnFocus != null && TextBoxAutoComplete.Text == "" && !IsMultiSelect)
     {
         ComboAutoComplete.IsDropDownOpen = true;
         OnFocus?.Invoke();
     }
 }
Example #3
0
 private void TextBoxAutoComplete_GotMouseCapture(object sender, MouseEventArgs e)
 {
     if (OnFocus != null && TextBoxAutoComplete.Text == "")
     {
         ComboAutoComplete.IsDropDownOpen = true;
         OnFocus?.Invoke();
     }
 }
Example #4
0
        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 { }
        }
Example #5
0
 public void Focus()
 {
     if (!focused)
     {
         Main.clrInput();
         focused = true;
         OnFocus?.Invoke();
     }
 }
Example #6
0
        internal void Focus()
        {
            if (!focused)
            {
                Main.clrInput();
                focused         = true;
                Main.blockInput = true;

                OnFocus?.Invoke();
            }
        }
Example #7
0
        private void OnInputFocus()
        {
            if (Value != null || Options != null && Options.Any())
            {
                ToggleState = true;
            }

            if (!string.IsNullOrWhiteSpace(Value))
            {
                OnFocus?.Invoke(Value);
            }
        }
Example #8
0
        public void Focus()
        {
            if (!focused)
            {
                Main.clrInput();
                focused         = true;
                Main.blockInput = true;
                cursorPos       = currentString.Length;

                OnFocus?.Invoke();
            }
        }
Example #9
0
        public void Focus()
        {
            if (!focused)
            {
                focused         = true;
                Main.blockInput = true;
                Main.clrInput();

                OnFocus?.Invoke();

                counter = 0;
            }
        }
Example #10
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);
     }
 }
Example #11
0
        public void Focus()
        {
            if (!focused)
            {
                Main.clrInput();
                focused         = true;
                Main.blockInput = true;

                //OnFocus?.Invoke(); //###
                if (OnFocus != null)
                {
                    OnFocus.Invoke();
                }
            }
        }
Example #12
0
        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(); };
        }
Example #14
0
        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);
            }
        }
Example #18
0
        bool IFocusable.Focus()
        {
            OnFocus?.Invoke(this);

            return(true);
        }
Example #19
0
 public virtual void Focus()
 {
     OnFocus?.Invoke();
 }
Example #20
0
 internal void _OnFocus(EventArgs eventArgs)
 {
     OnFocus?.Invoke(this, eventArgs);
     Utils.Call("self.EventStarted = False");
 }
Example #21
0
 private void Focus(IOption <T> o)
 {
     _focused = o;
     OnFocus?.Invoke(o);
 }
 private void OnPointerEnter()
 {
     OnFocus?.Invoke();
 }
Example #23
0
 public static void OnFocusHook()
 {
     OnFocus?.Invoke(null, EventArgs.Empty);
 }