View previous topic :: View next topic |
Author |
Message |
catfood Cheater Reputation: 0
Joined: 22 Jun 2015 Posts: 34
|
Posted: Thu Jan 20, 2022 7:39 am Post subject: replace key combos with another using Lua? |
|
|
Hello, my game doesn't support CTRL + A to select all text. however you can HOME, then SHIFT + END to essentially do the same thing.
is this something that can be done via Lua? where pressing CTRL+A = HOME, SHIFT+END?
I only want this key replacement to work on my game, and not globally across the rest of my PC when I tab away from the game.
any guidance or direction would be greatly appreciated!
thanks so much!
|
|
Back to top |
|
|
Dark Byte Site Admin Reputation: 457
Joined: 09 May 2003 Posts: 25262 Location: The netherlands
|
Posted: Thu Jan 20, 2022 7:51 am Post subject: |
|
|
Code: |
if hk then hk.destroy() hk=nil end
hk=createHotkey(function()
if getForegroundProcess()==getOpenedProcessID() then
--first unpress the control key in case it acts like an normal list where index and selection can be different
keyUp(VK_LCONTROL)
keyUp(VK_RCONTROL)
keyUp(VK_CONTROL)
sleep(10)
--now do the home, shift+end
doKeyPress(VK_HOME)
keyDown(VK_SHIFT)
doKeyPress(VK_END)
keyUp(VK_SHIFT)
end
end, VK_CONTROL, VK_A)
|
(tested on ce's foundlist, which also doesn't do ctrl+a, for a good reason)
_________________
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 |
|
|
catfood Cheater Reputation: 0
Joined: 22 Jun 2015 Posts: 34
|
Posted: Thu Jan 20, 2022 10:11 am Post subject: |
|
|
i am trying to do a similar thing where up / down keyboard arrows enter a single mouse wheel scroll up / down respectfully. however I cannot find any documentation on the wiki of mouse wheel scrolling.
https://wiki.cheatengine.org/index.php?title=Lua:keyDown
is mouse wheel scrolling supported?
|
|
Back to top |
|
|
Dark Byte Site Admin Reputation: 457
Joined: 09 May 2003 Posts: 25262 Location: The netherlands
|
|
Back to top |
|
|
catfood Cheater Reputation: 0
Joined: 22 Jun 2015 Posts: 34
|
Posted: Thu Jan 20, 2022 4:36 pm Post subject: |
|
|
thank you again, last question hopefully, then I have everything working. is there a function similar to autohotkey's [url=https://www.autohotkey.com/docs/commands/KeyWait.htm]KeyWait[/url]?
I would like to be able to triggger scroll wheel up using up arrow, without losing the ability to hold up arrow to move upward in my game.
some sudocode like:
[code]if hk then hk.destroy() hk=nil end
hk=createHotkey(function()
if getForegroundProcess()==getOpenedProcessID() then
mouse_event(MOUSEEVENTF_WHEEL, 0, 0, 40, 0)
keyWait(VK_UP) --THIS IS A GUESS OF HOW IT MIGHT BE CALLED
end
end, VK_UP)[/code]
if this function doesn't exist, I was wondering if some while loop could do it using the isKeyPressed function, or something.
is this even possible with Lua? I've spent the better part of the day googling and trying reference code to piece something together.
any guidance is much appreciated, thanks!
|
|
Back to top |
|
|
|