I read that AHK doesn't work in some apps that run on administrator mode although I'm not sure which apps that refers to. Are there other technical limitations? Or is there a site that lists what AHK can't?
I also read that AHK can't recognize multiple keyboard devices separately but an app called Luamacro seems to allow it to do so, so that one wouldn't be a problem.
What are things that you can't do with AHK?
What are things that you can't do with AHK?
Last edited by zipcat1 on 19 Feb 2018, 00:19, edited 2 times in total.
Re: What are things that you can't do with AHK?
It will often be the case that you can work with apps running as admin if your AHK script is also running as admin (I believe there are other/better ways to address that issue, but that is one way).
It would be easier to answer if you asked specifically what you would like it to do rather than to answer what it generally can't do. It depends on the application and what you are trying to do with it. Think about how you asked that question and if you asked it about any other thing (like a toaster, for example). You could list many things it can't do (like make ice cubes), but most of the answers aren't than insightful without knowing what you are trying to do with it.
It would be easier to answer if you asked specifically what you would like it to do rather than to answer what it generally can't do. It depends on the application and what you are trying to do with it. Think about how you asked that question and if you asked it about any other thing (like a toaster, for example). You could list many things it can't do (like make ice cubes), but most of the answers aren't than insightful without knowing what you are trying to do with it.
Re: What are things that you can't do with AHK?
Is it possible to make a macro that do something when the clipboard content changes from text to image? Like when I originally have a text in the clipboard and then I take a screen shot.
Re: What are things that you can't do with AHK?
- It's possible that AHKHID might be able to help with distinguishing between key presses from different devices:
NEW Barcode Input Capture (USB and RS232 compatible) - Page 2 - AutoHotkey Community
https://autohotkey.com/boards/viewtopic ... 73#p170673
- To detect a clipboard change:
OnClipboardChange
https://autohotkey.com/docs/commands/On ... m#function
- To check if image data is on the clipboard, search for AutoHotkey (or MSDN) and IsClipboardFormatAvailable. Also useful: NirSoft InsideClipboard, to check which clipboard formats are on the clipboard.
NEW Barcode Input Capture (USB and RS232 compatible) - Page 2 - AutoHotkey Community
https://autohotkey.com/boards/viewtopic ... 73#p170673
- To detect a clipboard change:
OnClipboardChange
https://autohotkey.com/docs/commands/On ... m#function
- To check if image data is on the clipboard, search for AutoHotkey (or MSDN) and IsClipboardFormatAvailable. Also useful: NirSoft InsideClipboard, to check which clipboard formats are on the clipboard.
homepage | tutorials | wish list | fun threads | donate
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA
Re: What are things that you can't do with AHK?
How about a macro that switches the input source while I'm pressing a key and resets when I release it? IOW, starting from the default US keyboard, on pressing down it switches to the French keyboard and keeps it while pressing and I can type French for a while, and then on releasing the key the keyboard gets back to the US layout.
Re: What are things that you can't do with AHK?
example from user 'Capn Odin' to change keyboard
Code: Select all
; https://msdn.microsoft.com/en-us/library/dd318693%28v=vs.85%29.aspx
; "The specified language must be displayable using the current system character set." (SystemParametersInfo function)
; https://msdn.microsoft.com/en-us/library/windows/desktop/ms724947%28v=vs.85%29.aspx
;-------- https://autohotkey.com/boards/viewtopic.php?f=6&t=18519 ---
;- example-1 = ctrl+2 > US
^1::SetDefaultKeyboard(0x0406) ; Danish
^2::SetDefaultKeyboard(0x0409) ; English (USA)
^3::SetDefaultKeyboard(0x0809) ; English (UK)
^4::SetDefaultKeyboard(0x0411) ; Japanese
^5::SetDefaultKeyboard(0x0408) ; Greek
^6::SetDefaultKeyboard(0x0807) ; swiss german
return
;- example-2 = toggle F4 > dansk or english-US
$F4::
V++
M:=mod(V,2)
if M=1
SetDefaultKeyboard(0x0406) ; Danish
else
SetDefaultKeyboard(0x0409) ; english-US
return
SetDefaultKeyboard(LocaleID){
Global
SPI_SETDEFAULTINPUTLANG := 0x005A
SPIF_SENDWININICHANGE := 2
Lan := DllCall("LoadKeyboardLayout", "Str", Format("{:08x}", LocaleID), "Int", 0)
VarSetCapacity(Lan%LocaleID%, 4, 0)
NumPut(LocaleID, Lan%LocaleID%)
DllCall("SystemParametersInfo", "UInt", SPI_SETDEFAULTINPUTLANG, "UInt", 0, "UPtr", &Lan%LocaleID%, "UInt", SPIF_SENDWININICHANGE)
WinGet, windows, List
Loop %windows% {
PostMessage 0x50, 0, %Lan%, , % "ahk_id " windows%A_Index%
}
}
;=====================================================
Re: What are things that you can't do with AHK?
Is that detecting both key press (key down) and key release (key up) as I explained? I'm not talking about a normal toggle switch. I'd like to type french only while holding down the key. What does M:=mod(V,2) mean?garry wrote:example from user 'Capn Odin' to change keyboardCode: Select all
; https://msdn.microsoft.com/en-us/library/dd318693%28v=vs.85%29.aspx ; "The specified language must be displayable using the current system character set." (SystemParametersInfo function) ; https://msdn.microsoft.com/en-us/library/windows/desktop/ms724947%28v=vs.85%29.aspx ;-------- https://autohotkey.com/boards/viewtopic.php?f=6&t=18519 --- ;- example-1 = ctrl+2 > US ^1::SetDefaultKeyboard(0x0406) ; Danish ^2::SetDefaultKeyboard(0x0409) ; English (USA) ^3::SetDefaultKeyboard(0x0809) ; English (UK) ^4::SetDefaultKeyboard(0x0411) ; Japanese ^5::SetDefaultKeyboard(0x0408) ; Greek ^6::SetDefaultKeyboard(0x0807) ; swiss german return ;- example-2 = toggle F4 > dansk or english-US $F4:: V++ M:=mod(V,2) if M=1 SetDefaultKeyboard(0x0406) ; Danish else SetDefaultKeyboard(0x0409) ; english-US return SetDefaultKeyboard(LocaleID){ Global SPI_SETDEFAULTINPUTLANG := 0x005A SPIF_SENDWININICHANGE := 2 Lan := DllCall("LoadKeyboardLayout", "Str", Format("{:08x}", LocaleID), "Int", 0) VarSetCapacity(Lan%LocaleID%, 4, 0) NumPut(LocaleID, Lan%LocaleID%) DllCall("SystemParametersInfo", "UInt", SPI_SETDEFAULTINPUTLANG, "UInt", 0, "UPtr", &Lan%LocaleID%, "UInt", SPIF_SENDWININICHANGE) WinGet, windows, List Loop %windows% { PostMessage 0x50, 0, %Lan%, , % "ahk_id " windows%A_Index% } } ;=====================================================
And what kind of situation would lag AHK key response if there's any? If I assigned a 5 sec sound file to every alpha numeric key so that they play sound after typing text as usual, would there be any lags when I'm typing fast?
Would having a HUGE AHK script cause a lag?
Also, can AHK fail to detect key presses? Or is it stable in detecting keys?
If I had 4 active keyboards each has its own keymapping I have created with AHK, could I swap keymaps of keyboard A and B easily? Like by swapping the Device ID I wrote in each keymap? IOW wouold the A key of keyboard A and that of B have the same keycode in AHK scripting?
An example would be like this:
keyboard A has text editing related macros-> web browsing related macros
keyboard B has web browsing related macros -> text editing related macros
keyboard C has normal keyboard with some modifications
keyboard D has skype related macros
Who is online
Users browsing this forum: Mannaia666 and 137 guests