GetMacroKeystroke

<< Click to Display Table of Contents >>

Navigation:  Quick3270 functions and statements >

GetMacroKeystroke

Description

This function returns the Virtual Keycode of the keystroke that started the macro.
It returns 0 in case the macro was started from the menu.

Syntax

KeyCode = GetMacroKeystroke()

 

The list of the Keycodes:

http://msdn.microsoft.com/de-de/library/0z084th3(v=vs.90).aspx
 
The Upper word contains the modifier (Alt / Ctrl / Shift)

Sample:

WshShell = CreateObject("WScript.Shell")

Result = GetMacroKeystroke()

 

KeyStr$ = "Key pressed: "

 

if Result And &H100 Then

   KeyStr$ = KeyStr$ & "Alt + "

Endif

 

if Result And &H200 Then

   KeyStr$ = KeyStr$ & "Ctrl + "

Endif

 

if Result And &H400 Then

   KeyStr$ = KeyStr$ & "Shit + "

Endif

 

' Remove the modifier value from Result and check the VK_KEY value

Result = Result And &HFF       

 

if Result = 0 Then

   KeyStr$ = KeyStr$ & "None"

Endif

 

if Result = &H70 Then

   KeyStr$ = KeyStr$ & "F1"

Endif

 

if Result = &H71 Then

   KeyStr$ = KeyStr$ & "F2"

Endif

 

WshShell.popup(KeyStr$)

 

End

Remarks

 

Added in version 4.30.