using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
namespace ShiftMouseClick
{
public partial class Page : UserControl
{
public Page()
{
InitializeComponent();
this.MouseLeftButtonDown += new MouseButtonEventHandler(Page_MouseLeftButtonDown);
}
void Page_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
{
Data.Text = String.Empty;
ModifierKeys keys = Keyboard.Modifiers;
bool shiftKey = (keys & ModifierKeys.Shift) != 0;
bool altKey = (keys & ModifierKeys.Alt) != 0;
bool appleKey = (keys & ModifierKeys.Apple) != 0;
bool controlKey = (keys & ModifierKeys.Control) != 0;
bool windowsKey = (keys & ModifierKeys.Windows) != 0;
if (true == shiftKey)
Data.Text += "<shift>";
if (true == altKey)
Data.Text += "<alt>";
if (true == appleKey)
Data.Text += "<apple>";
if (true == controlKey)
Data.Text += "<ctrl>";
if (true == windowsKey)
Data.Text += "<windows>";
Data.Text += " Left Clicked";
}
}
}