Esempio n. 1
0
 private void Search_PreviewKeyDown(object sender, KeyEventArgs e)
 {
     if (e.Key == Key.Enter)
     {
         // On enter, copy to the clipboard and move on.
         GiphySearchResult local = null;
         lock (m_resultLock)
         {
             local = m_currentResults;
         }
         if (local != null && local.Data.Length > 0)
         {
             Clippy.SetClipboardContent(local.Data[m_currentResultShown]);
         }
         Close();
     }
     if (e.Key == Key.Right || e.Key == Key.Down)
     {
         ShowNextImage(true);
         e.Handled = true;
     }
     if (e.Key == Key.Left || e.Key == Key.Up)
     {
         ShowNextImage(false);
         e.Handled = true;
     }
 }
Esempio n. 2
0
        public App()
        {
            // keep us alive after the main window closes.
            ShutdownMode = ShutdownMode.OnExplicitShutdown;

            Clippy.Test();

            // Setup the keyboard hooker
            m_hooker = new Hooker();
            m_hooker.GlobalHotKeyInvoked += Hooker_GlobalHotKeyInvoked;

            // Kill any other processes
            Killer.KillOthers();

#if DEBUG
            OpenWindow();
#else
            // Setup to start on run.
            Starter.SetStartup();

            // Set the keyboard hook
            m_hooker.SetHook();
#endif
        }