| View previous topic :: View next topic |
| Author |
Message |
Razi Expert Cheater
Reputation: 1
Joined: 17 Jan 2018 Posts: 205
|
Posted: Thu Nov 02, 2023 7:04 am Post subject: Hotkey for last file |
|
|
How to add hotkeys for the last two CE recent files?
So that the last recent file can be opened using the F9 hotkey, and the penultimate recent file can be opened using the 'ctrl + 2' hotkeys.
As a result, to open the last CT file we need to press F9. This will make things a little easier and faster for everyone who uses CE frequently.
|
|
| Back to top |
|
 |
Dark Byte Site Admin
Reputation: 471
Joined: 09 May 2003 Posts: 25827 Location: The netherlands
|
Posted: Thu Nov 02, 2023 7:43 am Post subject: |
|
|
add to your autorun folder
| Code: |
local oldclick=MainForm.File1.OnClick
MainForm.File1.OnClick=function(s)
oldclick(s)
for i=0,math.min(MainForm.miLoadRecent.Count-3,9) do -- -3 because the last 2 aren't table entries
local shortcut='Ctrl+'..(i+1) % 10
--print(MainForm.miLoadRecent.Item[i].Caption..' gets shortcut '..shortcut)
MainForm.miLoadRecent.Item[i].ShortCut=textToShortCut(shortcut)
end
end
MainForm.File1.doClick() --init once else it only fills it when you click on the File menu
|
replace the 9 with 1 if you only want the first 2
_________________
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 |
|
 |
Razi Expert Cheater
Reputation: 1
Joined: 17 Jan 2018 Posts: 205
|
Posted: Thu Nov 02, 2023 1:42 pm Post subject: |
|
|
| Dark Byte wrote: | | add to your autorun folder |
CE 7.4 shows an error: Access violation, some condition is needed until CE window loads. Hotkeys in CE 7.4/7.5 only work after clicking on the "File" menu. It seems that the code: MainForm.File1.doClick() is being executed before the CE window appears.
|
|
| Back to top |
|
 |
Dark Byte Site Admin
Reputation: 471
Joined: 09 May 2003 Posts: 25827 Location: The netherlands
|
Posted: Thu Nov 02, 2023 2:41 pm Post subject: |
|
|
ah ok. i didn't test it in autorun
then try
| Code: |
createTimer(1,function()
local oldclick=MainForm.File1.OnClick
MainForm.File1.OnClick=function(s)
oldclick(s)
for i=0,math.min(MainForm.miLoadRecent.Count-3,9) do -- -3 because the last 2 aren't table entries
local shortcut='Ctrl+'..(i+1) % 10
--print(MainForm.miLoadRecent.Item[i].Caption..' gets shortcut '..shortcut)
MainForm.miLoadRecent.Item[i].ShortCut=textToShortCut(shortcut)
end
end
MainForm.File1.doClick() --init once else it only fills it when you click on the File menu
end)
|
(still not tested, and the issue may be somewhere else as autorun should execute after the mainform is present)
_________________
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 |
|
 |
Razi Expert Cheater
Reputation: 1
Joined: 17 Jan 2018 Posts: 205
|
Posted: Thu Nov 02, 2023 4:05 pm Post subject: |
|
|
| Dark Byte wrote: | | then try |
it works now, thanks
P.S.: Since I had ctrl+1 hotkey and rarely used it, here is another code with the F9 hotkey for the last file. | Code: | createTimer(100,function()
local oldclick=MainForm.File1.OnClick
MainForm.File1.OnClick=function(s)
oldclick(s)
MainForm.miLoadRecent.Item[0].ShortCut=textToShortCut('F9')
for i=1,math.min(MainForm.miLoadRecent.Count-3,9) do -- -3 because the last 2 aren't table entries
local shortcut='Ctrl+'..(i+1) % 10
--print(MainForm.miLoadRecent.Item[i].Caption..' gets shortcut '..shortcut)
MainForm.miLoadRecent.Item[i].ShortCut=textToShortCut(shortcut)
end
end
MainForm.File1.doClick() --init once else it only fills it when you click on the File menu
end) |
|
|
| Back to top |
|
 |
|