Huddled Masses
You can do more than breathe for free...
Browse: Home / EventHandler

EventHandler

How to get the Char(acter) and VirtualKey from a WPF KeyDown event

By Joel 'Jaykul' Bennett on 22-Sep-2008

While working on my WPF PowerShell console, I’m working on implementing PSRawUserInterface, and had to implement a method called ReadKey which returns a KeyInfo object. KeyInfo is a pretty simple struct class with four properties: VirtualKeyCode Character ControlKeyState KeyDown So it doesn’t seem like it would be a real problem … just handle the KeyDown [...]

Posted in Huddled | Tagged .Net Framework, Char, EventHandler, Interop, KeyDown, PInvoke, ScanCode, VirtualKey, WPF

AutoMount Removable Drives in PowerShell v2 (CTP2)

By Joel 'Jaykul' Bennett on 16-Aug-2008

Oisin (x0n) Grehan wrote a module for PowerShell 2 which uses the WMI ManagementEventWatcher and the new event-handling features of PowerShell 2.0 to automatically run scripts whenever you plug in or unplug a removable drive …. specifically, the AutoMount module runs New-PSDrive whenever you plug in a removable, and Remove-PSDrive when you unplug it. The [...]

Posted in Huddled | Tagged EventHandler, Events, ManagementEventWatcher, PowerShell, Removable, Scripting, WMI | 1 Response

Lijit Search

Tags

.Net .Net 2008 Scripting Games Automation Bugs Design Development Funny Gadgets GeoShell GUI Huddled Masses Internet licensing Microsoft Modules My Software News Personal PInvoke Pipeline Politics PoshCode PoshConsole PowerBoots PowerShell PowerShell Functions PowerTips Rants Recommender Repository Scripting ShowUI Software Solutions Textile Tips User Group UserInterface WalkThrough WebHosting Windows 7 WordPress WPF Xml

About Huddled Masses

This is web site is dedicated to the musings of Joel Bennett (aka Jaykul) about technology, software, software development, the web, and the world.

Any resemblance of the views expressed and the views of my employer, my terminal, or the view out my window are purely coincidental. The resemblance between them and my own views is non-deterministic. The question of the existence of views in the absence of anyone to hold them is left as an exercise for the reader.

P.S.: I occasionally link to things I think are great. When I do, I occasionally find a "referral code" so I can make a little cash. I promise that I don't link to anything just because of that cash (I wouldn't cross the street for the amount of cash those links bring in, never mind write a whole blog post) ... but I do not promise that things I link to will stay great as time passes, nor that you will agree with me about their greatness!

Archives

  • January 2012
  • October 2011
  • August 2011
  • July 2011
  • June 2011
  • March 2011
  • February 2011
  • January 2011
  • November 2010
  • August 2010

Copyright © 2012 Joel Bennett.

Powered by WordPress and Hybrid.