| View previous topic :: View next topic |
| Author |
Message |
infogulch
Joined: 27 Mar 2008 Posts: 103 Location: KC, MO
|
Posted: Tue May 13, 2008 3:25 pm Post subject: If var is [not] type - Add type:Hotkey |
|
|
If var is [not] type
Supported types:
...
float
number
alpha
...
Hotkey ?? -|- True if var exists on the current keyboard layout. [etc. etc.]
How about it? _________________
 |
|
| Back to top |
|
 |
SomeGuy
Joined: 21 Apr 2008 Posts: 94 Location: somewhere
|
Posted: Tue May 13, 2008 4:14 pm Post subject: |
|
|
you can check it yourself, Like this:
| Code: | Hotkey = a
If !IsHotkeyValid(Hotkey)
MsgBox % Hotkey . " :`n`n" . HK_Error
Hotkey = Tab
If !IsHotkeyValid(Hotkey)
MsgBox % Hotkey . " :`n`n" . HK_Error
Hotkey = F24
If !IsHotkeyValid(Hotkey)
MsgBox % Hotkey . " :`n`n" . HK_Error
Hotkey = F25
If !IsHotkeyValid(Hotkey)
MsgBox % Hotkey . " :`n`n" . HK_Error
exitapp
IsHotkeyValid(Hotkey){
global HK_Error := ""
Hotkey, %Hotkey%, Dummy, UseErrorLevel
If ErrorLevel {
If ErrorLevel = 1
HK_Error = The Label parameter specifies a nonexistent label name.
Else If ErrorLevel = 2
HK_Error = The KeyName parameter specifies one or more keys that are either not recognized or not supported by the current keyboard layout/language.
Else If ErrorLevel = 3
HK_Error = Unsupported prefix key.
Else If ErrorLevel = 4
HK_Error = The KeyName parameter is not suitable for use with the AltTab or ShiftAltTab actions.
Else If ErrorLevel = 5
HK_Error = The command attempted to modify a nonexistent hotkey.
Else If ErrorLevel = 6
HK_Error = The command attempted to modify a nonexistent variant of an existing hotkey.
Else If ErrorLevel = 50
HK_Error = The command completed successfully but the operating system refused to activate the hotkey.
Else If ErrorLevel = 51
HK_Error = The command completed successfully but the hotkey is not supported on Windows 95/98/Me.
Else If ErrorLevel = 98
HK_Error = Creating this hotkey would exceed the 700-hotkey-per-script limit.
Else If ErrorLevel = 99
HK_Error = Out of memory.
Else
HK_Error = Unknown Error.`nErrorLevel = %ErrorLevel%
return 0
}
Hotkey, %Hotkey%, Off
return 1
Dummy:
return
}
|
|
|
| Back to top |
|
 |
infogulch
Joined: 27 Mar 2008 Posts: 103 Location: KC, MO
|
Posted: Tue May 13, 2008 6:36 pm Post subject: |
|
|
| SomeGuy wrote: | you can check it yourself, Like this:
... |
I see. I guess that other than being a little easier to use, a hotkey type wouldn't do much. And it wouldn't give as much info back as the function you made either. Thanks.  _________________
 |
|
| Back to top |
|
 |
|