Jump to content

Keyboard input/Keypress check: Difference between revisions

m
Line 36:
 
=={{header|PowerShell}}==
The following uses the special <code>$Host</code> variable which points to an instance of the PowerShell host application. Since the host's capabilities may vary this may not wokwork in all PowerShell hosts. In particular, this works in the console host, but not in the PowerShell ISE.
<lang powershell>if ($Host.UI.RawUI.KeyAvailable) {
$key = $Host.UI.RawUI.ReadKey()
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.