Advertisement
Guest User

Untitled

a guest
Sep 23rd, 2019
211
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. AssignHotKey(Label, key, vkey, state = "on") {
  2.     If (not StrLen(vkey)) {
  3.         vkey := key
  4.     }
  5.  
  6.     If (state != "off") {
  7.         Hotkey, %VKey%, %Label%, UseErrorLevel
  8.     }
  9.  
  10.     If (ErrorLevel) {
  11.         If (errorlevel = 1)
  12.             str := str . "`nASCII " . VKey . " - 1) The Label parameter (" Label ") specifies a nonexistent label name."
  13.         Else If (errorlevel = 2)
  14.             str := str . "`nASCII " . VKey . " - 2) The KeyName parameter specifies one or more keys that are either not recognized or not supported by the current keyboard layout/language. Switching to the english layout should solve this for now."
  15.         Else If (errorlevel = 3)
  16.             str := str . "`nASCII " . VKey . " - 3) Unsupported prefix key. For example, using the mouse wheel as a prefix in a hotkey such as WheelDown & Enter is not supported."
  17.         Else If (errorlevel = 4)
  18.             str := str . "`nASCII " . VKey . " - 4) The KeyName parameter is not suitable for use with the AltTab or ShiftAltTab actions. A combination of two keys is required. For example: RControl & RShift::AltTab."
  19.         Else If (errorlevel = 5)
  20.             str := str . "`nASCII " . VKey . " - 5) The command attempted to modify a nonexistent hotkey."
  21.         Else If (errorlevel = 6)
  22.             str := str . "`nASCII " . VKey . " - 6) The command attempted to modify a nonexistent variant of an existing hotkey. To solve this, use Hotkey IfWin to set the criteria to match those of the hotkey to be modified."
  23.         Else If (errorlevel = 50)
  24.             str := str . "`nASCII " . VKey . " - 50) Windows 95/98/Me: The command completed successfully but the operating system refused to activate the hotkey. This is usually caused by the hotkey being "" ASCII " . int . " - in use"" by some other script or application (or the OS itself). This occurs only on Windows 95/98/Me because on other operating systems, the program will resort to the keyboard hook to override the refusal."
  25.         Else If (errorlevel = 51)
  26.             str := str . "`nASCII " . VKey . " - 51) Windows 95/98/Me: The command completed successfully but the hotkey is not supported on Windows 95/98/Me. For example, mouse hotkeys and prefix hotkeys such as a & b are not supported."
  27.         Else If (errorlevel = 98)
  28.             str := str . "`nASCII " . VKey . " - 98) Creating this hotkey would exceed the 1000-hotkey-per-script limit (however, each hotkey can have an unlimited number of variants, and there is no limit to the number of hotstrings)."
  29.         Else If (errorlevel = 99)
  30.             str := str . "`nASCII " . VKey . " - 99) Out of memory. This is very rare and usually happens only when the operating system has become unstable."
  31.  
  32.         MsgBox, %str%
  33.     }
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement