How To View All Hotkey?

Anything Cheat Engine related, bugs, suggestions, helping others, etc..
Post Reply
exassasinx
Cheater
Cheater
Posts: 49
Joined: Fri Aug 25, 2017 1:05 pm
Reputation: 10

How To View All Hotkey?

Post by exassasinx »

12345678
Last edited by exassasinx on Mon Jun 13, 2022 5:14 pm, edited 1 time in total.

User avatar
YoucefHam
Expert Cheater
Expert Cheater
Posts: 92
Joined: Sun Jan 21, 2018 10:21 pm
Reputation: 202

Re: How To View All Hotkey?

Post by YoucefHam »

exassasinx wrote:
Fri Sep 25, 2020 6:26 am
Is there a LUA script that can let me see all the hotkeys I have assigned?
Hi,
you are lucky ^_^ , I have just coded one.

Here you go

Code: Select all

{$lua}
if syntaxcheck then return end
[ENABLE]
mr = getAddressList() -- get all records in the Table
if mr.Count > 0 then
  _GetHotKeys = ""
  _KeyCode = {[1]="LBUTTON",[2]="RBUTTON",[5]="XBUTTON1",[6]="XBUTTON2",[3]="CANCEL",[4]="MBUTTON",[8]="BACK",[9]="TAB",[12]="CLEAR",[13]="RETURN",[16]="SHIFT",[17]="CONTROL",[18]="MENU",[19]="PAUSE",[20]="CAPITAL",[27]="ESCAPE",[32]="SPACE",[33]="PRIOR",[34]="NEXT",[35]="END",[36]="HOME",[37]="LEFT",[38]="UP",[39]="RIGHT",[40]="DOWN",[41]="SELECT",[42]="PRINT",[43]="EXECUTE",[44]="SNAPSHOT",[45]="INSERT",[46]="DELETE",[47]="HELP",[48]="0",[49]="1",[50]="2",[51]="3",[52]="4",[53]="5",[54]="6",[55]="7",[56]="8",[57]="9",[65]="A",[66]="B",[67]="C",[68]="D",[69]="E",[70]="F",[71]="G",[72]="H",[73]="I",[74]="J",[75]="K",[76]="L",[77]="M",[78]="N",[79]="O",[80]="P",[81]="Q",[82]="R",[83]="S",[84]="T",[85]="U",[86]="V",[87]="W",[88]="X",[89]="Y",[90]="Z",[91]="LWIN",[92]="RWIN",[93]="APPS",[96]="NUMPAD0",[97]="NUMPAD1",[98]="NUMPAD2",[99]="NUMPAD3",[100]="NUMPAD4",[101]="NUMPAD5",[102]="NUMPAD6",[103]="NUMPAD7",[104]="NUMPAD8",[105]="NUMPAD9",[106]="MULTIPLY",[107]="ADD",[108]="SEPARATOR",[109]="SUBTRACT",[110]="DECIMAL",[111]="DIVIDE",[112]="F1",[113]="F2",[114]="F3",[115]="F4",[116]="F5",[117]="F6",[118]="F7",[119]="F8",[120]="F9",[121]="F10",[122]="F11",[123]="F12",[124]="F13",[125]="F14",[126]="F15",[127]="F16",[128]="F17",[129]="F18",[130]="F19",[131]="F20",[132]="F21",[133]="F22",[134]="F23",[135]="F24",[144]="NUMLOCK",[145]="SCROLL",[160]="LSHIFT",[162]="LCONTROL",[164]="LMENU",[161]="RSHIFT",[163]="RCONTROL",[165]="RMENU"}

  for _Record = 0 , mr.Count - 1 do -- Read all records in the Table
    _keyCount = mr[_Record].HotkeyCount -- Get How many keys
    if _keyCount > 0 then

      _HotKeys = ""
      for _Hotkey = 0, _keyCount - 1 do -- Read All key list
        _Keys = ""
        _KeyData = mr[_Record].Hotkey[_Hotkey].Keys -- Get How many unique keys
        for _Modifiers = 1, #_KeyData  do
          if _Modifiers == 1 then
             _Keys = _KeyCode[mr[_Record].Hotkey[_Hotkey].Keys[_Modifiers]]
          else
             _Keys = _Keys.." + ".._KeyCode[mr[_Record].Hotkey[_Hotkey].Keys[_Modifiers]]
          end
        end
        _HotKeys = _HotKeys..";".._Keys
      end
      _GetHotKeys = _GetHotKeys.."Record:"..mr[_Record].getDescription().."\n   HotKeys :".._HotKeys.."\n"
    end
  end
  if #_GetHotKeys > 1 then
     showMessage(_GetHotKeys)
  else
     showMessage("No HotKeys Found!!!")
  end
end
[DISABLE]

exassasinx
Cheater
Cheater
Posts: 49
Joined: Fri Aug 25, 2017 1:05 pm
Reputation: 10

Re: How To View All Hotkey?

Post by exassasinx »

12345678
Last edited by exassasinx on Mon Jun 13, 2022 5:14 pm, edited 1 time in total.

exassasinx
Cheater
Cheater
Posts: 49
Joined: Fri Aug 25, 2017 1:05 pm
Reputation: 10

Re: How To View All Hotkey?

Post by exassasinx »

12345678
Last edited by exassasinx on Mon Jun 13, 2022 5:14 pm, edited 1 time in total.

exassasinx
Cheater
Cheater
Posts: 49
Joined: Fri Aug 25, 2017 1:05 pm
Reputation: 10

Re: How To View All Hotkey?

Post by exassasinx »

12345678
Last edited by exassasinx on Mon Jun 13, 2022 5:14 pm, edited 1 time in total.

User avatar
YoucefHam
Expert Cheater
Expert Cheater
Posts: 92
Joined: Sun Jan 21, 2018 10:21 pm
Reputation: 202

Re: How To View All Hotkey?

Post by YoucefHam »

exassasinx wrote:
Tue Nov 10, 2020 6:28 pm
thanks, is there a way to make this into a .lua for autorun so that whenever I start cheat engine I can just press 1 button to show all the hotkeys? :D
is this what you want!!!
Get All Hotkeys.CT
(3.07 KiB) Downloaded 172 times
try this, it will add a menu "Get Hotkeys", save it as "GetHotkeys.lua" in autorun folder.

Code: Select all

function GetHotkeys()
	mr = getAddressList()
	if mr.Count > 0 then
	  _GetHotKeys = ""
	  _KeyCode = {[1]="LBUTTON",[2]="RBUTTON",[5]="XBUTTON1",[6]="XBUTTON2",[3]="CANCEL",[4]="MBUTTON",[8]="BACK",[9]="TAB",[12]="CLEAR",[13]="RETURN",[16]="SHIFT",[17]="CONTROL",[18]="MENU",[19]="PAUSE",[20]="CAPITAL",[27]="ESCAPE",[32]="SPACE",[33]="PRIOR",[34]="NEXT",[35]="END",[36]="HOME",[37]="LEFT",[38]="UP",[39]="RIGHT",[40]="DOWN",[41]="SELECT",[42]="PRINT",[43]="EXECUTE",[44]="SNAPSHOT",[45]="INSERT",[46]="DELETE",[47]="HELP",[48]="0",[49]="1",[50]="2",[51]="3",[52]="4",[53]="5",[54]="6",[55]="7",[56]="8",[57]="9",[65]="A",[66]="B",[67]="C",[68]="D",[69]="E",[70]="F",[71]="G",[72]="H",[73]="I",[74]="J",[75]="K",[76]="L",[77]="M",[78]="N",[79]="O",[80]="P",[81]="Q",[82]="R",[83]="S",[84]="T",[85]="U",[86]="V",[87]="W",[88]="X",[89]="Y",[90]="Z",[91]="LWIN",[92]="RWIN",[93]="APPS",[96]="NUMPAD0",[97]="NUMPAD1",[98]="NUMPAD2",[99]="NUMPAD3",[100]="NUMPAD4",[101]="NUMPAD5",[102]="NUMPAD6",[103]="NUMPAD7",[104]="NUMPAD8",[105]="NUMPAD9",[106]="MULTIPLY",[107]="ADD",[108]="SEPARATOR",[109]="SUBTRACT",[110]="DECIMAL",[111]="DIVIDE",[112]="F1",[113]="F2",[114]="F3",[115]="F4",[116]="F5",[117]="F6",[118]="F7",[119]="F8",[120]="F9",[121]="F10",[122]="F11",[123]="F12",[124]="F13",[125]="F14",[126]="F15",[127]="F16",[128]="F17",[129]="F18",[130]="F19",[131]="F20",[132]="F21",[133]="F22",[134]="F23",[135]="F24",[144]="NUMLOCK",[145]="SCROLL",[160]="LSHIFT",[162]="LCONTROL",[164]="LMENU",[161]="RSHIFT",[163]="RCONTROL",[165]="RMENU"}

	  for _Record = 0 , mr.Count - 1 do -- Read all records in the Table
		_keyCount = mr[_Record].HotkeyCount -- Get How many keys
		if _keyCount > 0 then

		  _HotKeys = ""
		  for _Hotkey = 0, _keyCount - 1 do -- Read All key list
			_Keys = ""
			_KeyData = mr[_Record].Hotkey[_Hotkey].Keys -- Get How many unique keys
			for _Modifiers = 1, #_KeyData  do
			  if _Modifiers == 1 then
				 _Keys = _KeyCode[mr[_Record].Hotkey[_Hotkey].Keys[_Modifiers]]
			  else
				 _Keys = _Keys.." + ".._KeyCode[mr[_Record].Hotkey[_Hotkey].Keys[_Modifiers]]
			  end
			end
			_HotKeys = _HotKeys..";".._Keys
		  end
		  _GetHotKeys = _GetHotKeys.."Record:"..mr[_Record].getDescription().."\n   HotKeys :".._HotKeys.."\n"
		end
	  end
	  if #_GetHotKeys > 1 then
		 showMessage(_GetHotKeys)
	  else
		 showMessage("No HotKeys Found!!!")
	  end
	end
end

function addGetHotkeysMenu()
  if GetHotkeysalreadyexists then return end
  local parent = getMainForm().Menu.Items
  GetHotkeysitem = createMenuItem(parent); parent.add(GetHotkeysitem)
  GetHotkeysitem.Caption = 'Get Hotkeys'
  GetHotkeysitem.OnClick = GetHotkeys
  GetHotkeysalreadyexists = 'yes'
end

addGetHotkeysMenu()
Last edited by YoucefHam on Sat Dec 26, 2020 7:25 am, edited 1 time in total.

exassasinx
Cheater
Cheater
Posts: 49
Joined: Fri Aug 25, 2017 1:05 pm
Reputation: 10

Re: How To View All Hotkey?

Post by exassasinx »

12345678
Last edited by exassasinx on Mon Jun 13, 2022 5:14 pm, edited 1 time in total.

User avatar
Dread_Pony_Roberts
Table Makers
Table Makers
Posts: 521
Joined: Sun Dec 09, 2018 8:46 am
Reputation: 385

Re: How To View All Hotkey?

Post by Dread_Pony_Roberts »

Converted YoucefHam's script into a lua file for people who don't know how.
Attachments
GetHotkeys.zip
(1.29 KiB) Downloaded 125 times

qwurhwqr28
Noobzor
Noobzor
Posts: 5
Joined: Mon Jan 18, 2021 10:02 am
Reputation: 0

Re: How To View All Hotkey?

Post by qwurhwqr28 »

Dread_Pony_Roberts wrote:
Tue Jan 19, 2021 3:46 pm
Converted YoucefHam's script into a lua file for people who don't know how.
[Link]

There's an error like this. :(
How do I solve it? Please let me know.

exassasinx
Cheater
Cheater
Posts: 49
Joined: Fri Aug 25, 2017 1:05 pm
Reputation: 10

Re: How To View All Hotkey?

Post by exassasinx »

12345678
Last edited by exassasinx on Mon Jun 13, 2022 5:14 pm, edited 1 time in total.

User avatar
YoucefHam
Expert Cheater
Expert Cheater
Posts: 92
Joined: Sun Jan 21, 2018 10:21 pm
Reputation: 202

Re: How To View All Hotkey?

Post by YoucefHam »

Here I fixed the error :D , the key you are having error with is not listed in the _KeyCode, so it was returning a nil.
Get Hotkeys.lua.zip
(3.15 KiB) Downloaded 103 times

Code: Select all

function GetHotkeys()
	mr = getAddressList()
	if mr.Count > 0 then
		_GetHotKeys = ""
		_KeyCode = {[1]="LBUTTON",[2]="RBUTTON",[5]="XBUTTON1",[6]="XBUTTON2",[3]="CANCEL",[4]="MBUTTON",[8]="BACK",[9]="TAB",[12]="CLEAR",[13]="RETURN",[16]="SHIFT",[17]="CONTROL",[18]="MENU",[19]="PAUSE",[20]="CAPITAL",[27]="ESCAPE",[32]="SPACE",[33]="PRIOR",[34]="NEXT",[35]="END",[36]="HOME",[37]="LEFT",[38]="UP",[39]="RIGHT",[40]="DOWN",[41]="SELECT",[42]="PRINT",[43]="EXECUTE",[44]="SNAPSHOT",[45]="INSERT",[46]="DELETE",[47]="HELP",[48]="0",[49]="1",[50]="2",[51]="3",[52]="4",[53]="5",[54]="6",[55]="7",[56]="8",[57]="9",[65]="A",[66]="B",[67]="C",[68]="D",[69]="E",[70]="F",[71]="G",[72]="H",[73]="I",[74]="J",[75]="K",[76]="L",[77]="M",[78]="N",[79]="O",[80]="P",[81]="Q",[82]="R",[83]="S",[84]="T",[85]="U",[86]="V",[87]="W",[88]="X",[89]="Y",[90]="Z",[91]="LWIN",[92]="RWIN",[93]="APPS",[96]="NUMPAD0",[97]="NUMPAD1",[98]="NUMPAD2",[99]="NUMPAD3",[100]="NUMPAD4",[101]="NUMPAD5",[102]="NUMPAD6",[103]="NUMPAD7",[104]="NUMPAD8",[105]="NUMPAD9",[106]="MULTIPLY",[107]="ADD",[108]="SEPARATOR",[109]="SUBTRACT",[110]="DECIMAL",[111]="DIVIDE",[112]="F1",[113]="F2",[114]="F3",[115]="F4",[116]="F5",[117]="F6",[118]="F7",[119]="F8",[120]="F9",[121]="F10",[122]="F11",[123]="F12",[124]="F13",[125]="F14",[126]="F15",[127]="F16",[128]="F17",[129]="F18",[130]="F19",[131]="F20",[132]="F21",[133]="F22",[134]="F23",[135]="F24",[144]="NUMLOCK",[145]="SCROLL",[160]="LSHIFT",[162]="LCONTROL",[164]="LMENU",[161]="RSHIFT",[163]="RCONTROL",[165]="RMENU"}
		for _Record = 0 , mr.Count - 1 do -- Read all records in the Table
			_keyCount = mr[_Record].HotkeyCount -- Get How many keys
			if _keyCount > 0 then
				_HotKeys = ""
				for _Hotkey = 0, _keyCount - 1 do -- Read All key list
					_Keys = ""
					_KeyData = mr[_Record].Hotkey[_Hotkey].Keys -- Get How many unique keys
					for _Modifiers = 1, #_KeyData  do
						if _KeyCode[mr[_Record].Hotkey[_Hotkey].Keys[_Modifiers]] ~= nil then
							if _Modifiers == 1 then
								_Keys = _KeyCode[mr[_Record].Hotkey[_Hotkey].Keys[_Modifiers]]
							else
								_Keys = _Keys.." + ".._KeyCode[mr[_Record].Hotkey[_Hotkey].Keys[_Modifiers]]
							end
						else
							if _Modifiers == 1 then
								_Keys = "VK0"..mr[_Record].Hotkey[_Hotkey].Keys[_Modifiers]
							else
								_Keys = _Keys.." + ".."VK0"..mr[_Record].Hotkey[_Hotkey].Keys[_Modifiers]
							end
						end
					end
					_HotKeys = _HotKeys..";".._Keys
				end
				_GetHotKeys = _GetHotKeys.."Record:"..mr[_Record].getDescription().."\n   HotKeys :".._HotKeys.."\n"
			end
		end
		if #_GetHotKeys > 1 then
			showMessage(_GetHotKeys)
		else
			showMessage("No HotKeys Found!!!")
		end
	end
end

function addGetHotkeysMenu()
	if GetHotkeysalreadyexists then return end
	local parent = getMainForm().Menu.Items
	GetHotkeysitem = createMenuItem(parent); parent.add(GetHotkeysitem)
	GetHotkeysitem.Caption = 'Get Hotkeys'
	GetHotkeysitem.OnClick = GetHotkeys
	GetHotkeysalreadyexists = 'yes'
end

addGetHotkeysMenu()

User avatar
gibberishh
Table Makers
Table Makers
Posts: 331
Joined: Fri Jul 02, 2021 5:48 pm
Reputation: 225

Re: How To View All Hotkey?

Post by gibberishh »

YoucefHam wrote:
Mon Apr 26, 2021 10:08 pm
Here I fixed the error :D , the key you are having error with is not listed in the _KeyCode, so it was returning a nil.
Please correct me if I'm wrong, but I think your code adds an unnecessary 0 after the VK if the keycode is 3 digits long. I think the following code fixes that:

Code: Select all

function GetHotkeys()
  local mr = getAddressList()
  local _GetHotKeys = ""
  if mr.Count > 0 then
    local _KeyCode = {[1]="LBUTTON",[2]="RBUTTON",[5]="XBUTTON1",[6]="XBUTTON2",[3]="CANCEL",[4]="MBUTTON",[8]="BACK",[9]="TAB",[12]="CLEAR",[13]="RETURN",[16]="SHIFT",[17]="CONTROL",[18]="ALT",[19]="PAUSE",[20]="CAPITAL",[27]="ESCAPE",[32]="SPACE",[33]="PRIOR",[34]="NEXT",[35]="END",[36]="HOME",[37]="LEFT",[38]="UP",[39]="RIGHT",[40]="DOWN",[41]="SELECT",[42]="PRINT",[43]="EXECUTE",[44]="SNAPSHOT",[45]="INSERT",[46]="DELETE",[47]="HELP",[48]="0",[49]="1",[50]="2",[51]="3",[52]="4",[53]="5",[54]="6",[55]="7",[56]="8",[57]="9",[65]="A",[66]="B",[67]="C",[68]="D",[69]="E",[70]="F",[71]="G",[72]="H",[73]="I",[74]="J",[75]="K",[76]="L",[77]="M",[78]="N",[79]="O",[80]="P",[81]="Q",[82]="R",[83]="S",[84]="T",[85]="U",[86]="V",[87]="W",[88]="X",[89]="Y",[90]="Z",[91]="LWIN",[92]="RWIN",[93]="APPS",[96]="NUMPAD0",[97]="NUMPAD1",[98]="NUMPAD2",[99]="NUMPAD3",[100]="NUMPAD4",[101]="NUMPAD5",[102]="NUMPAD6",[103]="NUMPAD7",[104]="NUMPAD8",[105]="NUMPAD9",[106]="MULTIPLY",[107]="ADD",[108]="SEPARATOR",[109]="SUBTRACT",[110]="DECIMAL",[111]="DIVIDE",[112]="F1",[113]="F2",[114]="F3",[115]="F4",[116]="F5",[117]="F6",[118]="F7",[119]="F8",[120]="F9",[121]="F10",[122]="F11",[123]="F12",[124]="F13",[125]="F14",[126]="F15",[127]="F16",[128]="F17",[129]="F18",[130]="F19",[131]="F20",[132]="F21",[133]="F22",[134]="F23",[135]="F24",[144]="NUMLOCK",[145]="SCROLL",[160]="LSHIFT",[162]="LCONTROL",[164]="LALT",[161]="RSHIFT",[163]="RCONTROL",[165]="RALT"}
    for _Record = 0, mr.Count-1 do
      local _keyCount = mr[_Record].HotkeyCount
      if _keyCount > 0 then
        local _HotKeys = ""
        for _Hotkey = 0, _keyCount - 1 do
	  local _Keys = ""
	  for _Modifiers = 1, #mr[_Record].Hotkey[_Hotkey].Keys do
	    if _KeyCode[mr[_Record].Hotkey[_Hotkey].Keys[_Modifiers]] ~= nil then
            _Keys = (_Modifiers == 1 and '' or _Keys.."+").._KeyCode[mr[_Record].Hotkey[_Hotkey].Keys[_Modifiers]]
	    else
            _Keys = (_Modifiers == 1 and '' or _Keys.."+").."VK"..string.format("%03d",mr[_Record].Hotkey[_Hotkey].Keys[_Modifiers])
	    end
	  end
	  _HotKeys = _HotKeys.._Keys
        end
        _GetHotKeys = _GetHotKeys..mr[_Record].getDescription()..": ".._HotKeys.."\n"
      end
    end
  end
  showMessage((#_GetHotKeys > 0) and _GetHotKeys or "No Hotkeys Found")
end

function addGetHotkeysMenu()
  if GetHotkeysalreadyexists then return end
  local parent = getMainForm().Menu.Items
  GetHotkeysitem = createMenuItem(parent)
  parent.add(GetHotkeysitem)
  GetHotkeysitem.Caption = 'Get &Hotkeys'
  GetHotkeysitem.OnClick = GetHotkeys
  GetHotkeysalreadyexists = true
end

addGetHotkeysMenu()
If those keys are supposed to have 4 numeric digits, then my code is wrong. Sorry.

Edit: Made 1 improvement and 2 more corrections to the code:
1. Changed all variables to local.
2. _GetHotKeys was being initialized in the wrong place. If there are no hotkeys, the earlier code would return nil, not "", throwing an error.
3. showMessage() was in the wrong place. If mr.Count is 0, the earlier code would not show any message. Now it will correctly say No Hotkeys Found.

FYI, in my own CE, I use getMainForm().Menu.Items[1] as my target parent. This puts the menu under Edit. (I tried Items[3] to put it under Table, but it keeps getting erased from there for some reason).

User avatar
gibberishh
Table Makers
Table Makers
Posts: 331
Joined: Fri Jul 02, 2021 5:48 pm
Reputation: 225

Re: How To View All Hotkey?

Post by gibberishh »

Here's my file in case anyone wants it. Rename to .lua instead of .ct and place it in CE's autorun folder.
(Removed obsolete file. Get the new file below.)
Last edited by gibberishh on Thu Jan 26, 2023 10:32 am, edited 1 time in total.

User avatar
gibberishh
Table Makers
Table Makers
Posts: 331
Joined: Fri Jul 02, 2021 5:48 pm
Reputation: 225

Re: How To View All Hotkey?

Post by gibberishh »

Update: Multiple hotkeys for the same record are now separated by a comma instead of being bunched up together. E.g., You will now see Alt+A, Alt+B instead of Alt+AAlt+B if those two key combos are assigned to the same memory record.
Rename to .lua instead of .ct and place it in CE's autorun folder.
Attachments
GetHotkeys.ct
Rename to .lua
(2.64 KiB) Downloaded 168 times

Post Reply

Who is online

Users browsing this forum: Dread_Pony_Roberts