Re-map build key (and other locked keys)

Do you need help? Ask here!

Bug reporting belongs here: http://developer.wz2100.net/newticket
Post Reply
antiaircraft
Greenhorn
Posts: 6
Joined: 31 Dec 2009, 10:39
Contact:

Re-map build key (and other locked keys)

Post by antiaircraft » 13 Aug 2010, 11:30

I have a laptop which requires you to hold down a modifier key to activate the function keys (F1, etc. only work if I hold down 'fn'), which makes it rather awkward when I want to issue a quick build order with F3. I've tried to change the build key, but it appears to be locked in the key map options (marked with a red background, clicking it has no effect besides making an error noise). I vaguely remember reading somewhere that this was done deliberately to make sure that people didn't change commonly used keys. However, since I'm the only one using this computer, I was wondering if I could override this. Is this possible?
*end of message*

cybersphinx
Inactive
Inactive
Posts: 1693
Joined: 01 Sep 2006, 19:17

Re: Re-map build key (and other locked keys)

Post by cybersphinx » 13 Aug 2010, 11:39

In the six lines at http://developer.wz2100.net/browser/bra ... map.c#L295, change KEYMAP_ALWAYS_PROCESS to KEYMAP_ASSIGNABLE and recompile the game (you probably need to reset your keymap after that).

digt
Rookie
Rookie
Posts: 17
Joined: 20 Jun 2008, 06:19

Re: Re-map build key (and other locked keys)

Post by digt » 13 Aug 2010, 13:55

It might be easier to change your keyboard options. I used to have a laptop running Windows XP that had a feature to switch the way the function keys work. Now I have a Mac 10.5 laptop that allows you to switch the function keys too.

If you have a Mac go to System Preferences and choose Keyboard & Mouse. Check the checkbox that says "Use all F1, F2, etc. keys as standard function keys".

User avatar
Buginator
Professional
Professional
Posts: 3285
Joined: 04 Nov 2007, 02:20

Re: Re-map build key (and other locked keys)

Post by Buginator » 14 Aug 2010, 05:39

cybersphinx wrote:In the six lines at http://developer.wz2100.net/browser/bra ... map.c#L295, change KEYMAP_ALWAYS_PROCESS to KEYMAP_ASSIGNABLE and recompile the game (you probably need to reset your keymap after that).
Note, they were hardcoded that way for a reason, since the tooltips are hardcoded.
and it ends here.

antiaircraft
Greenhorn
Posts: 6
Joined: 31 Dec 2009, 10:39
Contact:

Re: Re-map build key (and other locked keys)

Post by antiaircraft » 14 Aug 2010, 11:07

cybersphinx wrote:In the six lines at http://developer.wz2100.net/browser/bra ... map.c#L295, change KEYMAP_ALWAYS_PROCESS to KEYMAP_ASSIGNABLE and recompile the game (you probably need to reset your keymap after that).
Works as advertised! Thanks! :)
digt wrote:It might be easier to change your keyboard options. I used to have a laptop running Windows XP that had a feature to switch the way the function keys work. Now I have a Mac 10.5 laptop that allows you to switch the function keys too.

If you have a Mac go to System Preferences and choose Keyboard & Mouse. Check the checkbox that says "Use all F1, F2, etc. keys as standard function keys".
Unfortunately I can only disable the keys' special functions, I can't set them to trigger F(x) directly.
Attachments
warzone2100-2.3.4-unlock_keys.patch
Patch for future reference
(2.23 KiB) Downloaded 162 times
*end of message*

Post Reply