| View previous topic :: View next topic | 
	
	
		| Author | Message | 
	
		| Game Hacking Dojo Master Cheater
 
  Reputation: 1 
 Joined: 17 Sep 2023
 Posts: 250
 
 
 | 
			
				|  Posted: Fri Oct 11, 2024 8:33 pm    Post subject: Disable/Hijack Ctrl+C Dissassembler |   |  
				| 
 |  
				| Is there a way to change the behaviour of the OnKeyPress() (I believe) when pressing Ctrl+C on a selected address? 
 I want to copy the address and not get the window (I find it less useful than just instantly copying the address)
 
 One way might be by using registerFormAddNotification() but is there another way?
 |  | 
	
		| Back to top |  | 
	
		|  | 
	
		| AylinCE Grandmaster Cheater Supreme
 
  Reputation: 37 
 Joined: 16 Feb 2017
 Posts: 1528
 
 
 | 
			
				|  Posted: Sat Oct 12, 2024 11:59 am    Post subject: |   |  
				| 
 |  
				| Here's an idea... I assume you don't want this to work everywhere in Windows.
 
 Define the specific window you want it to work in.
 
 
  	  | Code: |  	  | if wtmr1 then wtmr1.Destroy() wtmr1=nil end 
 wtmr1=createTimer(MainForm)
 wtmr1.Interval=10
 
 -----------------------------------
 -- Define the window title in which the function will be active:
 --HWND1 = executeCodeLocalEx("FindWindowA",0,"Memory Viewer")
 fndWCpt = MainForm.Caption
 --print(fndWCpt)
 HWND2 = executeCodeLocalEx("FindWindowA",0,fndWCpt)
 -----------------------------------
 
 wtmr1.OnTimer=function()
 gfw = getForegroundWindow()
 --print("hwnd: "..HWND.." - "..gfw)
 if gfw==HWND2 then
 if isKeyPressed(VK_CONTROL) and isKeyPressed(VK_C) then
 sleep(200) -- Prevents the function from being triggered repeatedly
 print("true") -- your Ctrl+C func code..
 end
 end
 end
 
 wtmr1.Enabled=true
 | 
 _________________
 
 |  | 
	
		| Back to top |  | 
	
		|  | 
	
		| LeFiXER Grandmaster Cheater Supreme
 
 ![]() Reputation: 20 
 Joined: 02 Sep 2011
 Posts: 1069
 Location: 0x90
 
 | 
			
				|  Posted: Sat Oct 12, 2024 1:37 pm    Post subject: |   |  
				| 
 |  
				| Here is an extension I made (sometime ago) to copy the address rather than hooking hotkeys etc... I found this to be the most effective way. You can alter the shortcuts for each menu within the Lua extension. 
 Just place it within the autorun folder within Cheat Engine's installation directory and restart Cheat Engine. The default shortcut is Ctrl, Shift + C.
 
 
 
 
	
		
	 
		| Description: |  |  Download
 |  
		| Filename: | extraCopy.lua |  
		| Filesize: | 1.27 KB |  
		| Downloaded: | 2586 Time(s) |  
 |  | 
	
		| Back to top |  | 
	
		|  | 
	
		| Game Hacking Dojo Master Cheater
 
  Reputation: 1 
 Joined: 17 Sep 2023
 Posts: 250
 
 
 | 
			
				|  Posted: Sat Oct 12, 2024 4:21 pm    Post subject: |   |  
				| 
 |  
				| Thank you for your help guys. I still didn't use AylinCE's but I'll give it a try. 
 Thank you LeFiXER I made my own version now because I can't accept the most common copy method to be 3 key shortcuts while something I don't use at all to be 2
 
 
  	  | Code: |  	  | local function copy_address(form) form.setPosition(getScreenHeight(), getScreenWidth())
 form.close()
 
 local clipboard_option = getMemoryViewForm().Copytoclipboard1
 for i = 0, clipboard_option.Count - 1 do
 if clipboard_option.Item[i].Name == 'miCopyAddressesOnly' then
 clipboard_option.Item[i].DoClick()
 end
 end
 
 local address = string.gsub(readFromClipboard(), "%s+$", "")
 writeToClipboard(address)
 end
 
 if copy_address_id then
 unregisterFormAddNotification(copy_address_id)
 copy_address_id = nil
 end
 
 copy_address_id = registerFormAddNotification(function(form)
 if form.ClassName ~= "TfrmSavedisassembly" and form.Caption ~= "Copy disassembled output" then return end
 createTimer(1, copy_address, form)
 end)
 | 
 
 Again thank you, lads. And please check out my "Suprior Go to Address" extension if you're interested in having a better go-to-address prompt:
 https://forum.cheatengine.org/viewtopic.php?t=622886
 |  | 
	
		| Back to top |  | 
	
		|  | 
	
		|  |