Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Disable Predefinded Hotkeys

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
Game Hacking Dojo
Expert Cheater
Reputation: 1

Joined: 17 Sep 2023
Posts: 115

PostPosted: Sat May 04, 2024 3:18 am    Post subject: Disable Predefinded Hotkeys Reply with quote

Is there a possibility I could disable certain hotkeys using Lua scripts?
I am interested in all the hotkeys, used in the AA script under the template section.

Could you give me the "Execute" button and "Assign to current cheat table" option names?
If you tell me how you do it I won't bother you with retrieving form options names.

Thank you, in advance.



Screenshot 2024-05-04 110231.png
 Description:
 Filesize:  42.27 KB
 Viewed:  748 Time(s)

Screenshot 2024-05-04 110231.png


Back to top
View user's profile Send private message
Game Hacking Dojo
Expert Cheater
Reputation: 1

Joined: 17 Sep 2023
Posts: 115

PostPosted: Sat May 04, 2024 12:24 pm    Post subject: Reply with quote

Little update. I found almost everything I needed. However, overriding the hotkeys doesn't seem as straightforward.

["frmAutoInject"].Codeinjection1.Shortcut = ""
["frmAutoInject"].APIHook1.Shortcut = ""
["frmAutoInject"].Coderelocation1.Shortcut =""
["frmAutoInject"].miCallLua.Shortcut = ""
["frmAutoInject"].menuAOBInjection.Shortcut = ""
["frmAutoInject"].menuFullInjection.Shortcut = ""
["frmAutoInject"].CheatTablecompliantcodee1.Shortcut = ""

I checked the hotkeys before and after

result before:
Ctrl+I
Ctrl+Alt+A
Ctrl+R
Ctrl+L
Shift+Ctrl+A
Shift+Ctrl+F
Ctrl+Alt+T

result after:
Unknown
Unknown
Unknown
Unknown
Unknown
Unknown
Unknown

But nothing practically changed. I could still see the hotkeys being written next to the item label and the hotkeys still work. Any idea?

Edit:
Okay, thank you I just found out how and will post the code soon for those who want it.
Back to top
View user's profile Send private message
AylinCE
Grandmaster Cheater Supreme
Reputation: 33

Joined: 16 Feb 2017
Posts: 1346

PostPosted: Sat May 04, 2024 1:14 pm    Post subject: Reply with quote

use:

Code:
aa1 = MainForm.frmAutoInject.Codeinjection1.getShortcut()
print(aa1)
-- res: Ctrl+I

MainForm.frmAutoInject.Codeinjection1.setShortcut("")

aa2 = MainForm.frmAutoInject.Codeinjection1.getShortcut()
print(aa2)
-- res: Unknown


Check:
celua.txt --> line 962

methods --> line 979

Code:
MainForm.frmAutoInject.Codeinjection1.getShortcut()
MainForm.frmAutoInject.Codeinjection1.setShortcut(Ctrl+W)
--or
MainForm.frmAutoInject.Codeinjection1.setShortcut("")

_________________
Hi Hitler Different Trainer forms for you!
https://forum.cheatengine.org/viewtopic.php?t=619279
Enthusiastic people: Always one step ahead
Do not underestimate me Master: You were a beginner in the past
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Game Hacking Dojo
Expert Cheater
Reputation: 1

Joined: 17 Sep 2023
Posts: 115

PostPosted: Sat May 04, 2024 2:59 pm    Post subject: Reply with quote

I found something fishy.

Code:
print(MainForm.frmAutoInject)
07BD67B0

print(MainForm.frmAutoInject.Codeinjection1)
07F11B10

print(MainForm.frmAutoInject.Codeinjection1.Shortcut)
Ctrl+I

Print(getForm(1).Name)
frmAutoInject_1

Print(getForm(1))
13697CD0

Print(getForm(1).Codeinjection1)
1F15A580

Print(getForm(1).Codeinjection1.Shortcut)
Ctrl+I


Could you explain?
The only way to override the shortcuts is by using getForm(). Other ways are not viable.
Back to top
View user's profile Send private message
AylinCE
Grandmaster Cheater Supreme
Reputation: 33

Joined: 16 Feb 2017
Posts: 1346

PostPosted: Sat May 04, 2024 3:29 pm    Post subject: Reply with quote

I give up and leave the rest to you. Smile

You can also apply this to your own form (CETrainer).

Code:
aa22=getForm("frmAutoInject").Codeinjection1.getShortcut()

Print(aa22)

frm = getForm("frmAutoInject")

for i = 0, frm.ComponentCount - 1 do
  print(frm.Component[i].Name)
  print(frm.Component[i].Shortcut)
end

_________________
Hi Hitler Different Trainer forms for you!
https://forum.cheatengine.org/viewtopic.php?t=619279
Enthusiastic people: Always one step ahead
Do not underestimate me Master: You were a beginner in the past
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Game Hacking Dojo
Expert Cheater
Reputation: 1

Joined: 17 Sep 2023
Posts: 115

PostPosted: Sat May 04, 2024 4:00 pm    Post subject: Reply with quote

it's fine I had to write a looong code to do it. But I want to know how to execute it whenever I open the script.

I tried:

Code:
MainForm.frmAutoInject.OnCreate=function()
   DisableShortcuts()
end


It didn't work. (My function works)


This one didn't work for me

Quote:
Code:
aa22=getForm("frmAutoInject").Codeinjection1.getShortcut()

Print(aa22)

frm = getForm("frmAutoInject")

for i = 0, frm.ComponentCount - 1 do
  print(frm.Component[i].Name)
  print(frm.Component[i].Shortcut)
end
Back to top
View user's profile Send private message
ParkourPenguin
I post too much
Reputation: 143

Joined: 06 Jul 2014
Posts: 4382

PostPosted: Sat May 04, 2024 4:09 pm    Post subject: This post has 1 review(s) Reply with quote

Code:
local function removeAAshortcuts(form)
  form.Codeinjection1.shortcut = ''
  --...
end

if removeAAshortcuts_id then
  unregisterFormAddNotification(removeAAshortcuts_id)
  removeAAshortcuts_id = nil
end
removeAAshortcuts_id = registerFormAddNotification(function(f)
  if f.ClassName ~= 'TfrmAutoInject' then return end
  createTimer(1, removeAAshortcuts, f)
end)

_________________
I don't know where I'm going, but I'll figure it out when I get there.
Back to top
View user's profile Send private message
Game Hacking Dojo
Expert Cheater
Reputation: 1

Joined: 17 Sep 2023
Posts: 115

PostPosted: Sat May 04, 2024 4:29 pm    Post subject: Reply with quote

Wow man, thank you that's crazy good. Thanks a lot
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites