Is there a way to rebind CTRL-f to z?

General chat related to ScummVM, adventure gaming, and so on.

Moderator: ScummVM Team

Post Reply
UFO
Posts: 21
Joined: Sat Jun 23, 2012 6:56 pm

Is there a way to rebind CTRL-f to z?

Post by UFO »

is there a way or a command line to rebind CTRL-f to z or num-0 or key-pad-enter or something else?
i want to play some rpg lying down, i need a simpler and closer key for fast switching
User avatar
Praetorian
ScummVM Developer
Posts: 883
Joined: Tue May 08, 2007 8:54 am
Location: Greece
Contact:

Re: Is there a way to rebind CTRL-f to z?

Post by Praetorian »

UFO wrote: Sat Aug 03, 2024 5:56 am is there a way or a command line to rebind CTRL-f to z or num-0 or key-pad-enter or something else?
i want to play some rpg lying down, i need a simpler and closer key for fast switching
Which game are you referring to? And what is the "action" currently mapped to Ctrl+F?

Typically, what you want is to map a key (or combo of keys) to an in-game "action".
That is a job for a keymapper. If the engine/games has a custom keymapping support implemented for it (meaning it supports custom mappings for the specific actions of that game), then you use the Keymaps tab for the game from the ScummVM launcher -> Edit Game -> Keymaps.

If there's no such support, then you could open a feature request for it on the ScummVM bug tracker. Keep in mind that currently there's work in progress updating and adding keymapper support for engines in ScummVM, so this may already be implemented in a daily development build or planned for implementation.
UFO
Posts: 21
Joined: Sat Jun 23, 2012 6:56 pm

Re: Is there a way to rebind CTRL-f to z?

Post by UFO »

>Which game are you referring to? And what is the "action" currently mapped to Ctrl+F?
no which game, this is the BESTEST implemented scummVM's own function
you can make games go maybe 10 times faster
all lucas arts games walk slow, with it, you can walk faster
all voices are NOT effected by this, speech plays at a normal speed
some background sound effects are effected by it but background sound effects are usually small and rare
toggle Ctrl+F on and off is the KEY, and i hope to do it a simpler key manner
ALT + 0-9 = save
control + 0-9 = load

i have been rewriting scummVM's command lines for about 2 days,
but strangely , these keys help display disappeared from scummvm, i had it yesterday, but try them on scummVM, they are still there
CTRL +F
ALT + 0-9 = save
control + 0-9 = load

i got it the extra key display was in HELP and NEXT icon
this function was implemented maybe 7 years ago.. all i can say is in vague memory ... long ago
you CANT play simon the sorcerer, loom, all lucas games, king quest 7 without it.
User avatar
Praetorian
ScummVM Developer
Posts: 883
Joined: Tue May 08, 2007 8:54 am
Location: Greece
Contact:

Re: Is there a way to rebind CTRL-f to z?

Post by Praetorian »

UFO wrote: Sun Aug 04, 2024 1:53 am but strangely , these keys help display disappeared from scummvm, i had it yesterday, but try them on scummVM, they are still there
CTRL +F
ALT + 0-9 = save
control + 0-9 = load

i got it the extra key display was in HELP and NEXT icon
this function was implemented maybe 7 years ago.. all i can say is in vague memory ... long ago
you CANT play simon the sorcerer, loom, all lucas games, king quest 7 without it.
Ctrl+F is a hotkey hardcoded for the SCUMM engine games.
It could be also hardcoded or a keymap for other engines (you mention Simon the Sorcerer and King's Quest 7 which I cannot check off hand), but it's not something that applies in every engine.

Also Ctrl+G is a hotkey that enables "another" fast speed mode (it's a separate fast speed flag in the engine), but I am not sure how Ctrl+F and Ctrl+G are different.

What I've written above still stands though. Since these are hardcoded, there would have to be some extra implementation work to support keymapping their actions (faster speed modes, or quick saving, or quick loading for the other hotkeys), to custom key shortcuts.

If you are able to compile ScummVM locally you could modify the source code to directly set your preferred keys for these actions, but that would be a crude solution and not compatible with ScummVM updates, and could potential create conflicts with games that already use the new keys (that you set) for other in-game actions. The code, at least for the SCUMM engine games, that specifies these hotkeys is currently at:
https://github.com/scummvm/scummvm/blob ... t.cpp#L135
There are other subengine or game specific cases in that file as well.
UFO
Posts: 21
Joined: Sat Jun 23, 2012 6:56 pm

Re: Is there a way to rebind CTRL-f to z?

Post by UFO »

Ctrl+F is kind of too fast, but still totally good, takes maybe ~1.5 seconds moving from one corner to another corner
Ctrl+G is probably developer's mode, too fast. takes 0.1 seconds moving from one corner to another corner

normal games like simon sorcerer (maybe 20 seconds), loom(maybe 30 sec), Dragon Sphere, Phantom of Opera took 40 seconds moving from one corner to another corner to with PC 386 or pentium and 20 seconds under DOSbox with modern PCs
i have never replayed these two games Dragon Sphere, Phantom of Opera, i hope someday scummVM would implement microprose's games too

>If you are able to compile ScummVM locally you could....
i wish.. i am not a system engineer, i barely understand DOS batch commands and much much less DOS operators especially regarding Setlocal EnableExtensions DisableDelayedExpansion
the only compiler i know well is true basic and some fortran

CTRL-f is still very good, i just hope i can rebind it for a simpler key, because i use it very often for ALL slow walking RPG games that would put me to sleep.
i just hope scummVM developers someday would have a thought about it.
fibs
Posts: 29
Joined: Mon Sep 26, 2022 10:38 pm

Re: Is there a way to rebind CTRL-f to z?

Post by fibs »

The SCUMM engine keymapper is complicated to implement fully at this point. For now, in Windows you can download and install AutoHotKey (e.g. 2.x), and create a new file called e.g. ScummVM_CTRL_F.ahk that contains the following:

Code: Select all

#IfWinActive ahk_exe scummvm.exe

; When NumLock is on
Numpad0::
Send ^f
return

; When NumLock is off
NumpadIns::
Send ^f
return

; When NumLock is on or off
NumpadEnter::
Send ^f
return

#IfWinActive
The first two entries are for Numpad 0, the final entry is for Numpad Enter. Currently it works with both, just edit out what you don't need. Once AHK is installed, just "executing" the ahk file is sufficient to run it. The AHK script is very light and affects only ScummVM so it doesn't really matter if it still runs, it's just an extra icon in the tray. You can add these lines in your fancy batch script (after adapting them to your situation):

Code: Select all

taskkill /F /IM AutoHotkey*
C:\your\path\to\ScummVM_CTRL_F.ahk
UFO
Posts: 21
Joined: Sat Jun 23, 2012 6:56 pm

Re: Is there a way to rebind CTRL-f to z?

Post by UFO »

i been using auto hotkey v1.1.24.05 from year 2014 for only one purpose that is disabling a single winkey, it served me so well for all these years, goes like this in my startup windows
@ECHO OFF
SET P1=C:\Programs\Auto Hotkey\AutoHotkey.exe
SET A1=C:\Programs\Auto Hotkey\winkey - no.ahk
START "" "%P1%" "%A1%"

winkey - no.ahk has
~LWin UP::return
~RWin UP::return
****************************************************************************
for a next step
i added winkey - no.ahk as below and ran it in v1.1.24.05

~LWin UP::return
~RWin UP::return

#IfWinActive ahk_exe scummvm.exe

; When NumLock is on
Numpad0::
Send ^f
return

; When NumLock is off
NumpadIns::
Send ^f
return

; When NumLock is on or off
NumpadEnter::
Send ^f
return

#IfWinActive
*************************************************************
the hotkeys kind of worked in scummvm, it was not sensitive enough, i had to remain pressing maybe 0.4 seconds to 1 sec to take effect, or over-pressing it by maybe 0.01 seconds more would return to the original state as if it were pressed 2 times.
----------------------------------------------------------------------
----------------------------------------------------------------------
this time i tried the latest version 2.0.18
it didnt work, caused an error at the 1st line
#IfWinActive ahk_exe scummvm.exe
i think the new auto hotkey seemed to reject this line when scummvm.exe was not run

i dont know anything about auto hotkey's syntax...
maybe if it is ok with you, i'd be appreciated if you could add just few words to help explaining about syntax, for a starter, as to what this # is... and the rest i guess well
fibs
Posts: 29
Joined: Mon Sep 26, 2022 10:38 pm

Re: Is there a way to rebind CTRL-f to z?

Post by fibs »

I observed no delays as you describe with the old script. I thought that AHK 2.x could run AHK 1.x scripts, but maybe both can and have to be installed at the same time.

I'm not sure what your Win-key code is actually for so I can't test it. You might want to use your existing script instead to ensure everything works as usual, but here is the entire code adapted to AHK 2.0 syntax and tested with the latest AHK. Edit away what you don't need:

Code: Select all

#Requires AutoHotkey v2.0

~LWin Up::Return
~RWin Up::Return

SetKeyDelay(0, 0) ;

if WinActive("ahk_exe scummvm.exe") {
    Numpad0::Send("^f")
    NumpadIns::Send("^f")
    NumpadEnter::Send("^f")
}
I'm not sure what there is to explain as it's plainly readable. "#" is a prefix for directives that configure the AHK script. I previously used one to limit the applicability to the ScummVM window.

The bindings are as sensitive as they can be and I again notice no delay. I can't help you if the delays persist for you - I'd say get a faster computer, but it's probably some other odd thing you rigged up that's the issue. My advice is to stop doing odd things and go with the flow, you'll save time.
UFO
Posts: 21
Joined: Sat Jun 23, 2012 6:56 pm

Re: Is there a way to rebind CTRL-f to z?

Post by UFO »

i have been searching AutoHotkey forum past from maybe 1999 to maybe 2015 maybe occasionally in 2017, non existed, but today i found it, i registered it. i will ask there.

i installed AutoHotkey_2.0.18_setup.exe, and a few main files were below

M:\AutoHotkey\WindowSpy.ahk
M:\AutoHotkey\UX\AutoHotkeyUX.exe
M:\AutoHotkey\v2\AutoHotkey32.exe
M:\AutoHotkey\v2\AutoHotkey64.exe

i found no AutoHotkey.exe, so i took AutoHotkey64.exe as AutoHotkey.exe

i ran
AutoHotkeyU64.exe "winkey - no.ahk"
a file winkey - no.ahk has
---------------------------------------------------
#Requires AutoHotkey v2.0

~LWin Up::Return
~RWin Up::Return

SetKeyDelay(0, 0) ;

if WinActive("ahk_exe scummvm.exe") {
Numpad0::Send("^f")
NumpadIns::Send("^f")
NumpadEnter::Send("^f")
}
-----------------------------------------------------
a autohotkey program was loaded and was in the memory
nothing worked, it seemed that it didnt like this format AutoHotkeyU64.exe "winkey - no.ahk", but this is the format i only know at this moment
even a winkey was not disabled

autohotkey v1.1.24.05 that i am using is too old to say anything
these two lines were the ONLY things for which i was using autohotkey till today
~LWin Up::Return
~RWin Up::Return

i also suspect a thing that UAC is always off might have had something to do with it
User avatar
Red_Breast
Posts: 775
Joined: Tue Sep 30, 2008 10:33 pm
Location: The Bar Of Gold, Upper Swandam Lane.

Re: Is there a way to rebind CTRL-f to z?

Post by Red_Breast »

Just earlier today I read that one of Microsoft's Powertoys has a keyboard mapper. I haven't tried it.
I think the Powertoys repo is on Github.

https://learn.microsoft.com/en-us/windo ... rd-manager
Post Reply