Modifier in my script no longer working

Ask gaming related questions (AHK v1.1 and older)
exkitteh
Posts: 3
Joined: 05 Aug 2021, 17:33

Modifier in my script no longer working

05 Aug 2021, 17:50

Hi all, please be gentle with me as this was the first script I made just so I could change some keybinding for playing The Sims 4. Everything was working fine, until I played today. It seems the shift (or any modifier) is not working in conjunction with my side mouse buttons, which in my script when combined send Home or End which then cycles through the three wall viewing options. (All other key swaps are working.)

Originally I was using this script:

Code: Select all

#IfWinActive, ahk_exe TS4_x64.EXE
`::p ; Pause button swap
Tab::Space ; Cycle through sims
+XButton1::End ; Walls go down using shift and msbtn one
+XButton2::Home ; Walls go up using shift and msbtn two
XButton1::PgDn ; go down a level using msbtn one
XButton2::PgUp ; go up a level using msbtn one
return
#IfWinActive
After some googling I added the send function. However this didn't work either.

Code: Select all

#IfWinActive, ahk_exe TS4_x64.EXE
`::p ; Pause button swap
Tab::Space ; Cycle through sims
+XButton1::Send, End ; Walls go down using shift and msbtn one
+XButton2::Send, Home ; Walls go up using shift and msbtn two
XButton1::PgDn ; go down a level using msbtn one
XButton2::PgUp ; go up a level using msbtn one
return
#IfWinActive
I also tried swapping out shift (+) for alt (!), didn't work, then also adding tilde to the start... but still nothing works. So I was wondering if anyone could see anything wrong with what I've got? I have a feeling it might be a mod conflict of some sort that could be breaking it, but thought I'd ask first in case there was a silly mistake I'd missed.

Thank you all very much in advance for any help!
gregster
Posts: 9012
Joined: 30 Sep 2013, 06:48

Re: Modifier in my script no longer working

05 Aug 2021, 18:34

At least, the send syntax is different than that of your previous remappings:

Code: Select all

+XButton1::Send, {End}
Your current code would literally send the string End instead of the key.
exkitteh
Posts: 3
Joined: 05 Aug 2021, 17:33

Re: Modifier in my script no longer working

05 Aug 2021, 19:01

gregster wrote:
05 Aug 2021, 18:34
At least, the send syntax is different than that of your previous remappings:

Code: Select all

+XButton1::Send, {End}
Your current code would literally send the string End instead of the key.
Ah, I see, thanks! Updated it with that bit added but didn't work so I tried something without the side mouse buttons:

Code: Select all

!q::Send, {End} ; Walls go down using alt and q
!e::Send, {Home} ; Walls go up using alt and e
This gets it working at least. So there must be something amiss that causes a conflict and only letting the pgup / pgdwn mousebutton swaps to work, right? I will keep trying anyhoo :)
gregster
Posts: 9012
Joined: 30 Sep 2013, 06:48

Re: Modifier in my script no longer working

05 Aug 2021, 19:32

Well, games are often tricky (but I am not very familiar with them). Anyway, I am not aware of specific problems with XButtons.
As you said, the script worked before - AHK doesn't update by itself, but the game might have. The solution often requires trial-and-error, I am afraid.

Perhaps also try

Code: Select all

XButton1::Send {PgDn} 
XButton2::Send {PgUp}
in combination with the shifted keys, as the pure remappings from before would also work with modifiers pressed (but also cause shifted keys as a result) :

Code: Select all

XButton1::Send {PgDn} 
XButton2::Send {PgUp}
+XButton1::Send {End} 
+XButton2::Send {Home}
exkitteh
Posts: 3
Joined: 05 Aug 2021, 17:33

Re: Modifier in my script no longer working

07 Aug 2021, 08:22

Thought I'd update to say I got it working. Also: I'm a dunce. :) Somehow I didn't realise logitech gaming software (for my mouse) was running in the background, and in that there was a very old profile for the game for the side mouse buttons setting them to be pgup and pgdown. So this explains why the script was at first working then suddenly wasn't working, cause the profile was overriding the script. So yeah, lol. Also after working through this found using alt was nicer than shift for hands.

Anyhoo, if any simmers come across this thread in the future this is my simple script:

Code: Select all

#IfWinActive, ahk_exe TS4_x64.exe

`::p ; Pause button swap

Tab::Send {Space} ; Cycle through sims

Space::Send {Tab} ; camera mode

!Tab::Tab ; gives me back normal alt-tab mode

!XButton1::Send {End} ; Walls go down using alt and msbtn one
!XButton2::Send {Home} ; Walls go up using alt and msbtn two

XButton1::Send {PgDn} ; go down a level using msbtn one
XButton2::Send {PgUp} ; go up a level using msbtn one

return
#IfWinActive

Return to “Gaming Help (v1)”

Who is online

Users browsing this forum: No registered users and 73 guests