project-navigation
Personal tools

Author Topic: 7 on number pad brings up radar not 7th unit  (Read 9009 times)

Offline joe davis

  • Rookie
  • ***
  • Posts: 55
    • View Profile
7 on number pad brings up radar not 7th unit
« on: January 27, 2010, 02:45:00 am »
When using the numeric keypad to cycle through units when I hit 7 I get a radar pop up and it doesn't switch to the 7th unit.

Offline Mattn

  • Administrator
  • PHALANX Commander
  • *****
  • Posts: 4831
  • https://github.com/mgerhardy/vengi
    • View Profile
    • Vengi Voxel Tools
Re: 7 on number pad brings up radar not 7th unit
« Reply #1 on: January 27, 2010, 06:16:25 am »
because HOME and KP_HOME are bound to this - see keys.cfg

Offline joe davis

  • Rookie
  • ***
  • Posts: 55
    • View Profile
Re: 7 on number pad brings up radar not 7th unit
« Reply #2 on: January 27, 2010, 08:29:46 am »
That makes sense that it might respond that way, but not understanding why radar is mapped to home then.  Is this just meant to be one of those idiosyncrasies of the game?  I can cycle through units 1-6 and 8 by pressing those buttons on the number pad but 7 is a special case for opening up the radar and if I want unit 7 then I should press the button for unit 7?  Peculiar, though I can definitely live with it if the coders say too.  Not a huge deal, just... odd.

Offline Destructavator

  • Combination Multiple Specialty Developer
  • Administrator
  • PHALANX Commander
  • *****
  • Posts: 1908
  • Creater of Scorchcrafter, knows the zarakites...
    • View Profile
Re: 7 on number pad brings up radar not 7th unit
« Reply #3 on: January 27, 2010, 05:34:39 pm »
IIRC the numbers above the main alphabet keys work fine, all of them, for selecting units.  In most apps and programs that I've worked with the number keypad keys vary in function depending on the "num lock" setting, how it is toggled, and I don't see any reason for UFO:AI to be different than all the other zillions of programs out there that also work this way.

Therefore, I personally wouldn't call this a bug, just a need to toggle the numlock setting.  In one setting the numbers are read as numbers, in the other the 7 becomes "home," the 1 becomes "end," the 9 becomes "page up," etc.

Edit:  You can always change the keymap so it works with a different key, if that's what you want.  The key bindings are not fixed hard-coded.

« Last Edit: January 27, 2010, 05:37:30 pm by Destructavator »

Offline joe davis

  • Rookie
  • ***
  • Posts: 55
    • View Profile
Re: 7 on number pad brings up radar not 7th unit
« Reply #4 on: January 27, 2010, 06:03:00 pm »
That is why I thought that it was odd.  I have the num lock on and all the number keys work except 7.  I have never experienced the alternate functions of the number pad unless I have the num lock off.  Now, this isn't a huge problem, I can learn to live with it in the game, and probably even learn to enjoy it, but I thought I would report it since it was a little unusual.  Now in regards to the .cfg I see "// key layout, don't modify for no reason" commented on the first line and that concerns me more than any alien, so I think I will leave the key mappings alone so I don't break nothing.

Offline bayo

  • Professional loser
  • Project Coder
  • Captain
  • ***
  • Posts: 733
    • View Profile
Re: 7 on number pad brings up radar not 7th unit
« Reply #5 on: January 27, 2010, 06:57:05 pm »
Quote
In most apps and programs that I've worked with the number keypad keys vary in function depending on the "num lock" setting, how it is toggled, and I don't see any reason for UFO:AI to be different than all the other zillions of programs out there that also work this way.

We use an OS abstraction called SDL, and we also use KEY_CODE, and not KEY_VALUE. I dont check the SDL output with and without num lock, but if SDL do not manage that (and i dont think it should for KEY_CODE), then i dont think we should do it for him. For example, i v got a laptop and a num lock, but number are set in the middle of the alphabet keyboard. We can't manage all hardware.

If we dont use KEY_CODE but KEY_VALUE, we will have problem with MAJ and caps lock, then there is no way.

Another time, i dont check the SDL output nor the specification, i can be wrong.

Offline Destructavator

  • Combination Multiple Specialty Developer
  • Administrator
  • PHALANX Commander
  • *****
  • Posts: 1908
  • Creater of Scorchcrafter, knows the zarakites...
    • View Profile
Re: 7 on number pad brings up radar not 7th unit
« Reply #6 on: January 27, 2010, 07:26:21 pm »
Well, the key bindings can be changed from default to a custom map anyways, and that alone would solve this issue.

Offline joe davis

  • Rookie
  • ***
  • Posts: 55
    • View Profile
Re: 7 on number pad brings up radar not 7th unit
« Reply #7 on: January 27, 2010, 08:37:11 pm »
Not really a big issue, just thought it was a little unusual from my normal experiences so thought I would let someone know.  In regards to altering the .cfg, are you saying that it is safe to do so and to not worry about the first line
Quote
// key layout, don't modify for no reason
  That seemed a little ominous and thought it might have been put there for a reason, like the coders might send a Taman after me if I changed it.  lol.  Maybe not, but maybe with me altering it, it would cause more problems than it would fix, but if you say it is cool to alter it then I will believe ya.

Offline Destructavator

  • Combination Multiple Specialty Developer
  • Administrator
  • PHALANX Commander
  • *****
  • Posts: 1908
  • Creater of Scorchcrafter, knows the zarakites...
    • View Profile
Re: 7 on number pad brings up radar not 7th unit
« Reply #8 on: January 27, 2010, 08:49:45 pm »
Yes, you can modify it.

I think that warning was mostly to make people aware that if they play around with settings there it has the potential to break things, meaning the game won't run.  No, we're not going to come after you if you modify it.

Just don't change any entries where you don't know what they do.

If you do by any chance mess up and the game doesn't run, you can always delete the folder in the appdata location where it is installed and the game will re-create default settings, as if you just installed the game.

Edit: ...Or, you could back-up the .cfg file first.

Offline joe davis

  • Rookie
  • ***
  • Posts: 55
    • View Profile
Re: 7 on number pad brings up radar not 7th unit
« Reply #9 on: January 28, 2010, 07:13:46 pm »
O.K. so I go into ...UFOAI-2.3-dev\base\0base.pk3 and I change it, but it's not changing it after I save.  So I figure maybe what I am doing is not what I think I am doing so I'll try a little change and reorder the bindings of keys 1 - 8 to 8 - 1 ie change the number 8 to 1; 7 to 2; 6 to 3.  I figure this way if I press 1 I should get unit 8, and press 2 should get unit 7 etc., but after saving it there is no change.  In case this rambling makes no sense:

changed from 'bind 1 "soldier_select 0"' to 'bind 8 "soldier_select 0"'
changed from 'bind 2 "soldier_select 1"' to 'bind 7 "soldier_select 1"'
etc.  minus the single quotes ' of course.  Changed what's in single quotes to what's in single quotes.

So, my question, if the above is not too confusing, is why are the changes not taking effect?  Can I not do the changes in the installed 0base.pk3 file?  Or is the above binds not the binds to select the units like I thought they were?

Offline Destructavator

  • Combination Multiple Specialty Developer
  • Administrator
  • PHALANX Commander
  • *****
  • Posts: 1908
  • Creater of Scorchcrafter, knows the zarakites...
    • View Profile
Re: 7 on number pad brings up radar not 7th unit
« Reply #10 on: January 28, 2010, 07:29:39 pm »
You're changing the wrong file.  You don't want to change the pk3 files to alter key bindings, you want the "application settings" folder, not the program files folder.

On Windows the folder you want is hidden by default, you want to enable viewing hidden files then go to:

(Your installed Windows drive):\Documents and Settings\(Your login name)\Application Data\

You should see a folder there for UFO AI 2.3.

In there are the configuration files you want to change.  Also in there somewhere is where the game puts screenshots.

If you're on Linux or a Mac, I don't recall off-hand where the game puts things.

Offline joe davis

  • Rookie
  • ***
  • Posts: 55
    • View Profile
Re: 7 on number pad brings up radar not 7th unit
« Reply #11 on: January 28, 2010, 08:05:40 pm »
Using windows so this is very pertinent.  Thank you for your assistance.  I opened it with notepad and that really bites so tried notepad++ and that was much better.  I tried to comment out the section that I thought might be giving me problems:

//bindui KP_HOME "hud.openradar"
//bindui KP_HOME "althud.openradar"
//bindui KP_HOME "radarwindow.closeradar"

and it worked, except it looks like the game cleans up the commented section and deletes it.  I now have the ability to cycle 1-8 without the radar popping up when I hit key 7 while still being able to pull up radar by hitting home and h.  Sorry about being so nit picky, and thank you for your help.

Offline Destructavator

  • Combination Multiple Specialty Developer
  • Administrator
  • PHALANX Commander
  • *****
  • Posts: 1908
  • Creater of Scorchcrafter, knows the zarakites...
    • View Profile
Re: 7 on number pad brings up radar not 7th unit
« Reply #12 on: January 28, 2010, 11:47:25 pm »
Glad you got it working like you want it to.

Personally I use Wordpad instead of Notepad, because Wordpad formats things nice and neat unlike Notepad, but if Notepad++ works for you, then you're probably fine to stick with that.

Offline Stedevil

  • Rookie
  • ***
  • Posts: 10
    • View Profile
Re: 7 on number pad brings up radar not 7th unit
« Reply #13 on: March 16, 2010, 12:02:08 am »
There is a bug here, because I also noticed, just as joe davis, that rebinding kp_7/Home REQUIRES manual editing (deleting) of the HOME entries in keys.cfg (a file you are warned not to edit manually...)

All other keys I tried work well with a simple rebind, but KP_7 needs to be manually nuked from the cfg file before your own new setting will "take". That is broken behavior.

PS http://ufoai.ninex.info/wiki/index.php/Change_binding is horribly out of date to the point of the instructions not working at all.

BTW I use the following custom keys that I believe (with numlock off) is quite a bit saner default than what the game has now. Whom to talk to for trying to get something like this to be the default?

// manually rem the 2+2 openradar lines from keys.cfg before next restart of the game.
bindbattle KP_HOME "+turnleft"
bindbattle KP_PGUP "+turnright"
bindbattle KP_END "+turndown"
bindbattle KP_PGDN "+turnup"
bindbattle KP_INS "+zoomin"
bindbattle KP_DEL "+zoomout"
bindbattle KP_PLUS "levelup"
bindbattle KP_MINUS "leveldown"
bindbattle KP_ENTER "actor_next"
bindbattle KP_SLASH "actor_nextalien"
bindui KP_5 "hud.openradar"
bindui KP_5 "althud.openradar"
bindui KP_5 "radarwindow.closeradar"
//* kp * not usable currently
bindbattle UPARROW "+shiftup"
bindbattle DOWNARROW "+shiftdown"
bindbattle RIGHTARROW "+shiftright"
bindbattle LEFTARROW "+shiftleft"

Offline Duke

  • Administrator
  • PHALANX veteran
  • *****
  • Posts: 1037
    • View Profile
Re: 7 on number pad brings up radar not 7th unit
« Reply #14 on: March 16, 2010, 09:38:47 pm »
PS http://ufoai.ninex.info/wiki/index.php/Change_binding is horribly out of date to the point of the instructions not working at all.
It's a wiki after all. Feel free to add any corrections you can think of ;)