View previous topic :: View next topic |
Author |
Message |
Goat Engine Cheater Reputation: 0
Joined: 13 Aug 2018 Posts: 44
|
Posted: Thu Aug 30, 2018 3:36 pm Post subject: How do I suspend CE's hotkeys on the fly? |
|
|
I've searched this question numerous times over the months and never have been able to find the solution, but certainly this would need to be able to be done by more people than just me so I am probably just missing it somehow...
Once I go into the settings of CE and set up a few of the hotkeys in CE's built in hotkey options, how do I temporarily suspend all of the hotkeys? For example if I have the numeric pad 0 set up as one of the hotkeys but when I switch over to my web browser or another program and I'm typing something, I don't want the key to be triggering anything in CE during that short interval.
My guess would be there's obviously a built in hotkey that suspends all hotkeys, but what is it? Sorry for such a silly question that I'm sure everyone else has figured out. |
|
Back to top |
|
|
Dark Byte Site Admin Reputation: 457
Joined: 09 May 2003 Posts: 25253 Location: The netherlands
|
Posted: Thu Aug 30, 2018 3:42 pm Post subject: |
|
|
You'll have to use lua code.
likely
Code: |
getHotkeyHandlerThread().state='htsDisabled'
|
other valid strings are:
Code: |
'htsActive'=Active
'htsMemrecOnly'=Memory records only
'htsNoMemrec'=Everything except memoryrecords
'htsDisabled'=disabled
|
Perhaps you can use it with a timer that checks if the foreground process is the target process (getForegroundProcess() ) and if it's your browser disable it, else active _________________
Do not ask me about online cheats. I don't know any and wont help finding them.
Like my help? Join me on Patreon so i can keep helping |
|
Back to top |
|
|
FreeER Grandmaster Cheater Supreme Reputation: 53
Joined: 09 Aug 2013 Posts: 1091
|
Posted: Thu Aug 30, 2018 3:44 pm Post subject: |
|
|
um, that one's new to me but seems like it exists (lua)
Code: | getHotkeyHandlerThread().state = 'htsDisabled' | based on (in celua.txt) Code: | HotkeyHandlerThread(Inheritence: Thread)
getHotkeyHandlerThread() : Returns the hotkey handler thread used internally by CE
properties
state: 0 ('htsActive')=Active , 1('htsMemrecOnly')=Memory records only, 2('htsNoMemrec')=Everything except memoryrecords, 3('htsDisabled')=disabled
methods
-
|
Not hotkey for it afaik, but presumably you could use a timer to check if a key is pressed and toggle it, something like Code: | hktt = createTimer()
hktt.Interval = getFreezeTimer().Interval
hkt = getHotkeyHandlerThread()
hktt.OnTimer = function()
if isKeyPressed(VK_F2) then
if hkt.status ~= 'htsActive' then hkt.status = 'htsActive'
else hkt.status = 'htsDisabled' end
end
end |
_________________
|
|
Back to top |
|
|
Goat Engine Cheater Reputation: 0
Joined: 13 Aug 2018 Posts: 44
|
Posted: Thu Aug 30, 2018 4:35 pm Post subject: |
|
|
Thanks for the help on this. Ok, so not being an expert on Lua, my understanding is I can test this string out by pasting it into CE's Lua Script window and hitting the Execute button, which is the same manner I use a different Lua script on occasion without any issues at all...
Here is the result when I execute it:
Error:[string "getHotkeyHandlerThread().state = 'htsDisabled..."]:1: attempt to call a nil value (global 'getHotkeyHandlerThread')
Not sure if this means I'm testing it out wrong, or if this means there's an error I need to address beyond what is normally expected? I was thinking the result should have been that it disables the hotkeys until I use the same string again with htsActive as the state? |
|
Back to top |
|
|
Dark Byte Site Admin Reputation: 457
Joined: 09 May 2003 Posts: 25253 Location: The netherlands
|
Posted: Thu Aug 30, 2018 4:42 pm Post subject: |
|
|
It means you're on a version before 6.8.1
and yes, htsActive will reactivate the hotkeys _________________
Do not ask me about online cheats. I don't know any and wont help finding them.
Like my help? Join me on Patreon so i can keep helping |
|
Back to top |
|
|
Goat Engine Cheater Reputation: 0
Joined: 13 Aug 2018 Posts: 44
|
Posted: Thu Aug 30, 2018 5:12 pm Post subject: |
|
|
Updating CE fixed the earlier error. Thanks both of you for the quick help!
Next issue I'm having -- This script I'm trying doesn't seem to work. What am I doing wrong here? This snippet as far as I can tell should Deactivate hotkeys when I press Z...
Code: | function func(sender)
getHotkeyHandlerThread().state = 'htsDisabled'
return true
end
hkey=createHotkey("func",VK_Z)
generichotkey_onHotkey(hkey,func) |
EDIT: Never mind it DOES work. I was an idiot and had forgotten to initially "execute" the script thus assigning the Z hotkey. LOL! Thanks again! |
|
Back to top |
|
|
|