Keyboard input/Keypress check: Difference between revisions

Content added Content deleted
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()