Exemplo n.º 1
0
        public static void Initialize(Sidebar window, Hotkey[] settings)
        {
            if (settings == null)
            {
                return;
            }

            Disable();

            _window = window;
            _index = 0;

            RegisteredKeys = settings.Select(h =>
            {
                h.Index = _index;
                _index++;
                return h;
            }).ToArray();

            (PresentationSource.FromVisual(window) as HwndSource).AddHook(KeyHook);
        }
Exemplo n.º 2
0
        public static void Initialize(Sidebar window, Hotkey[] settings)
        {
            if (settings == null || settings.Length == 0)
            {
                Dispose();
                return;
            }

            Disable();

            _sidebar = window;
            _index = 0;

            RegisteredKeys = settings.Select(h =>
            {
                h.Index = _index;
                _index++;
                return h;
            }).ToArray();

            window.HwndSource.AddHook(KeyHook);

            IsHooked = true;
        }