WPF - How to capture when CTRL+SHIFT are pressed down?

When the user clicks left CTRL+ left SHIFT I want to make the entire application translucent (like VS2008's intellisense drop-down). If I write my code on the KeyUp event I can capture both keys being pressed, but the transparency effect should only be active while the keys are pressed. When they are release the opacity should go back to 100%. The behavior I want is actually the KeyDown event, but I can't capture both keys on KeyDown, can I?

Thanks

-------------Problems Reply------------

Use the static methods of the Keyboard class, specifically IsKeyDown() to check the state of the keys you're interested in.

On KeyDown you can use this to enable the translucency and on KeyUp you can disable the effect again. If you are at it, you could save the key's state yourself and act upon it.

Category:wpf Views:6 Time:2009-05-04

Related post

  • How can I register a global hot key to say CTRL+SHIFT+(LETTER) using WPF and .NET 3.5? 2008-09-08

    I'm building an application in C# using WPF. How can I bind to some keys? Also, how can I bind to the Windows key? --------------Solutions------------- I'm not sure of what you mean by "global" here, but here it goes (I'm assuming you mean a command

  • Capturing Ctrl+Shift+Esc Before Task Manager Does 2010-05-05

    I'm using the Windows API (SetWindowsHookEx) to capture keyboard events. I would like to pass the Ctrl+Shift+Esc combination to my application for processing but suppress Task Manager appearing. Unfortunately, it looks like the three key combination

  • Ctrl-Shift-Plus keyboard shortcut and WPF listview 2011-03-23

    In a typical Windows forms list view the shortcut key Ctrl + Shift + + resizes all the columns in the grid to their "automatic" size (as they would be if you double clicked on the resize handle in the column header). In my WPF application containing

  • WPF KeyBinding Guesture for Ctrl+Shift+Zero not working 2011-06-24

    I am trying to do a to map Ctrl+Shift+0 with WPF 3.5sp1, but the binding does not fire. The XAML I'm using is: <KeyBinding Gesture="Ctrl+Shift+D0" Command="Blah"/> I have also tried: <KeyBinding Key="D0" Modifiers="Ctrl+Shift" Command="Blah"

  • Capturing Ctrl + Shift + P key stroke in a C# Windows Forms application 2011-10-04

    Possible Duplicate: Capture combination key event in a Windows Forms application I need to perform a particular operation when (Ctrl + Shift + P) keys are pressed. How can I capture this in my C# application? --------------Solutions------------- Pers

  • WPF Datagrid Multiple Selection without CTRL or Space 2010-01-13

    The WPF Datagrid has two selection modes, Single or Extended. The WPF ListView has a third - Multiple. This mode allows you to click and select multiple rows without CTRL or Shift being held down. Anyone know how to do this for the datagrid? --------

  • Ctrl + Shift + R is not working in Eclipse 2011-04-20

    We all know that we can use Ctrl + Shift + R to search any file in the workspace. But today, I surprisingly found out that it is not working anymore. Ctrl + Shift + H and Ctrl + Shift + T are working though. I believe I am missing a setting somewhere

  • Can Emacs differentiate between ctrl-r and ctrl-shift-r? 2009-05-13

    I'd like to bind Ctrl + R to 'isearch-backward and bind Ctrl + Shift + R to 'tags-apropos but I can't distinguish between the two key presses. Can emacs differentiate between Ctrl + R and Ctrl + Shift + R? What should go into my .emacs file to allow

  • Ctrl Shift R in Visual Studio 2008 2009-07-30

    I am learning .Net after many years of Java programming. In Eclipse we have Ctrl Shift R to open any resource in the project. Is there a similar keystroke in Visual Studio 2008 or is the best to use the Find in Files? Thanks, Tom --------------Soluti

  • Ctrl-Shift-M no longer working in SQL Server Management Studio 2009-08-08

    I find it useful and productive to use the built in Ctrl-Shift-M when creating a new stored proc in SQL Server Management Studio (2008). On one of my machines that keyboard shortcut combo has stopped working and I've been unable to work out how to re

  • Why does CTRL-SHIFT-F redraw several windows on my desktop in Visual Studio? 2009-08-26

    I have a 3 monitor setup and usually have Visual Studio 2008 open and the help on another screen and some other windows. When I press CTRL-SHIFT-F to open the Find and Replace Dialog, my desktop starts to redraw several windows on my desktop. That ex

  • Is there a way to capture/override Ctrl-R or F5 on IE using Javascript? 2009-09-09

    I want to capture the Ctrl-R or F5 shortcut on the browser to prevent it from performing a browser refresh, but instead perform a custom refresh. I was able to capture Ctrl-R on Safari and FF using: document.onkeypress = function(e){ if ((e.ctrlKey |

  • what is the shortcut key for opening a resource in RAD 6.0? Ctrl + Shift + R? 2009-09-29

    This may be a basic question, but I'm still looking for the answer. I've been using Eclipse IDE for a long time and I know the shortcut ket 'Ctrl + Shift + R' which will open the resources dialog box. Recently I switched to RAD 6.0 IDE (as per projec

  • How to map Ctrl+A and Ctrl+Shift+A differently? 2009-10-01

    In a terminal, one cannot distinguish Ctrl+A and Ctrl+Shift+A as they both emit the same key code, so I can see why vim can't do it. But gvim, being an X application, can differentiate Ctrl+A and Ctrl+Shift+A. So is there any way to map those two thi

  • Visual Studio: ctrl+shift+v opens clipboard ring window 2009-11-27

    I'm trying to get the clipboard ring working by pressing Ctrl + Shift + V, but this only opens a window showing what the clipboard contains. I would like the items to cycle through as I press V, not open in a window. Ctrl + Shift + Insert works as ex

  • press Ctrl+Shift+Del outof firefox extension 2010-01-03

    So, i need to press Ctrl+Shift+Del in a program way. I want my extension to press Ctrl+Shift+Del and then press 'Enter' (to clean all history,cookies,cache and so on). i do next: var e=document.createEvent('KeyboardEvent'); e.initKeyEvent( 'keypress'

  • How to make Emacs (without GUI) differentiate between Ctrl+Shift+S and Ctrl+S? 2010-01-20

    I'm trying to teach Emacs standard shortcut keys. I use emacs23-nox version from Debian, often through SSH connection. One of those is Ctrl+Shift+S for SaveAs. The relevant part of configuration looks like this: (global-set-key (kbd "C-S") 'write-fil

  • VS 2008, is there a way to search properties like the old vb6/EVB? CTRL+SHIFT? 2010-02-16

    I really miss the CTRL+SHIFT+CHAR searching of a property in VS 2008 that older IDE's had... typing CTRL+SHIFT+T got you to "tabindex" then Tag when pressed again. They dropped it in VS 2002 I believe, and the closest I could find to restoring any fu

  • Delphi Getting 'Ctrl Tab' and 'Ctrl Shift Tab' in application 2010-02-22

    In my application I use tabs, my own component, like Google chrome sort of. Each tab reference an explorer component so it is basicly a tabbed browser/explorer. My problem is that I want to use Ctrl Tab and Ctrl Shift Tab to navigate tabs. Setting fo

Copyright (C) dskims.com, All Rights Reserved.

processed in 0.070 (s). 11 q(s)