Author Topic: Change Default KeyBinds  (Read 3290 times)

BLOODWOLF

  • Warrant Officer
  • *
  • Posts: 695
Change Default KeyBinds
« on: 08 January 2018, 10:22:11 »
https://github.com/MegaMek/megamek/pull/851/files

What do you guys think the keybinds should be?  I am thinking we need to have ctrl in front of the keys for things like iso view, unit labels, fields of fire, etc that people keep accidentally toggling that we want protected somewhat.  I made mine similar to Mechwarrior 2 and 3 keybinds but, how do you guys want this?

scJazz

  • Captain
  • *
  • Posts: 1828
Re: Change Default KeyBinds
« Reply #1 on: 08 January 2018, 10:39:34 »
I'm all in favor of adding CTRL+ to things like iso, unit tags, field of fire, etc.

Not fully in agreement with a full remapping... yet

Kentares

  • Warrant Officer
  • *
  • Posts: 628
Re: Change Default KeyBinds
« Reply #2 on: 08 January 2018, 10:53:44 »
I agree. Sometimes I hit a key and something changes and I have to hunt for what I changed accidentally.
Star Wars ST and Star Trek current shows are crap.

MoleMan

  • Master Sergeant
  • *
  • Posts: 344
Re: Change Default KeyBinds
« Reply #3 on: 09 January 2018, 10:58:12 »
I'd like a ctrl+ something for 'done' (the main action button)

BLOODWOLF

  • Warrant Officer
  • *
  • Posts: 695
Re: Change Default KeyBinds
« Reply #4 on: 09 January 2018, 11:02:02 »
Done already is ctrl+Enter, while just Enter is the chatbox.

Tecmes

  • Sergeant
  • *
  • Posts: 125
Re: Change Default KeyBinds
« Reply #5 on: 06 March 2021, 15:05:31 »
On the subject of the Topic title but unrelated to the OP...

I just cannot get my key bindings to "stick". Everytime I load MM, it reverts to defaults.

I though I should overwrite defaultkeybinds.xml... but that's the file that get updated when you change key bind, and somehow reverts to default defaults when starting MM. I'm a bit puzzled there!

Windchild

  • Master Sergeant
  • *
  • Posts: 297
Re: Change Default KeyBinds
« Reply #6 on: 07 March 2021, 09:48:57 »
Are you changing them through MHQ?
MegaMek Developer - MekHQ, Personnel, and Internal Focus
MegaMek Discord
MegaMek Projects Wiki
Bug Trackers
MegaMek Tracker
MekHQ Tracker
MegaMekLab Tracker

Tecmes

  • Sergeant
  • *
  • Posts: 125
Re: Change Default KeyBinds
« Reply #7 on: 07 March 2021, 10:08:35 »
Are you changing them through MHQ?
If you mean within MM when launched by MHQ, yes! If you mean really within MHQ, I don't know how?

Tecmes

  • Sergeant
  • *
  • Posts: 125
Re: Change Default KeyBinds
« Reply #8 on: 07 March 2021, 13:16:36 »
I see the MM options in MekHQ but that does NOT include key binding, which are Client Settings.
« Last Edit: 07 March 2021, 13:54:59 by Tecmes »

Windchild

  • Master Sergeant
  • *
  • Posts: 297
Re: Change Default KeyBinds
« Reply #9 on: 07 March 2021, 21:14:55 »
There might be a missing save if using MM loaded from HQ. I'm planning on making some changes to how that's handled in the near future, but I'm pretty sure that's a current bug.
MegaMek Developer - MekHQ, Personnel, and Internal Focus
MegaMek Discord
MegaMek Projects Wiki
Bug Trackers
MegaMek Tracker
MekHQ Tracker
MegaMekLab Tracker

Tecmes

  • Sergeant
  • *
  • Posts: 125
Re: Change Default KeyBinds
« Reply #10 on: 07 March 2021, 21:50:19 »
Makes sense, but that's the thing: I'm surprised that I don't see people reporting this, as if I was the only perso encoutnering this issue, which is odd!

Tecmes

  • Sergeant
  • *
  • Posts: 125
Re: Change Default KeyBinds
« Reply #11 on: 11 March 2021, 15:56:27 »
Even when using MM standalone (without MHQ) the behaviour of the key binding seems really abnormal. (Note that I STILL don't get what I seem to be the only person having issues there. Do people really use default bindings??? They seem hardly practical with Ctrl-Enter and such?)

Here's what I did to test and you can try:

1) Start MM. Change some bindings. This is immediately reflected in the "defaultKeyBinds.xml" file. (which is already odd. This should be the default, not the user pref?)

2) Close MM. The file remains as is. So far so good (except for the name).

3) Reopen MM. Check the bindings in MM: they appear as default! Stranger even: the file still contains the tweaked values.

So it seems the defaults are actually stored somewhere else (maybe hard-coded?), and so while there is code to alter the defaultKeyBinds.xml, there is no code to read that file.

(On an aside the other client prefs are correctly stored in the clientsettings.xml... but that one has no default... so once you change it you can never revert. It'S a bit of the opposite issue..)

So... IF I'm correct, it would be a matter of saving bindings to clientsettings.xml rather than defaultKeyBinds.xm;?
(And maybe adding client settings defaults while coders are at it?)
« Last Edit: 11 March 2021, 17:14:13 by Tecmes »

Hammer

  • Numerorum Malleo
  • Global Moderator
  • Major
  • *
  • Posts: 4128
    • MegaMek Website
Re: Change Default KeyBinds
« Reply #12 on: 11 March 2021, 18:52:27 »
Even when using MM standalone (without MHQ) the behaviour of the key binding seems really abnormal. (Note that I STILL don't get what I seem to be the only person having issues there. Do people really use default bindings??? They seem hardly practical with Ctrl-Enter and such?)

Here's what I did to test and you can try:

1) Start MM. Change some bindings. This is immediately reflected in the "defaultKeyBinds.xml" file. (which is already odd. This should be the default, not the user pref?)

2) Close MM. The file remains as is. So far so good (except for the name).

3) Reopen MM. Check the bindings in MM: they appear as default! Stranger even: the file still contains the tweaked values.

So it seems the defaults are actually stored somewhere else (maybe hard-coded?), and so while there is code to alter the defaultKeyBinds.xml, there is no code to read that file.

(On an aside the other client prefs are correctly stored in the clientsettings.xml... but that one has no default... so once you change it you can never revert. It'S a bit of the opposite issue..)

So... IF I'm correct, it would be a matter of saving bindings to clientsettings.xml rather than defaultKeyBinds.xm;?
(And maybe adding client settings defaults while coders are at it?)
I followed your steps and can't duplicate things.
MegaMek Projects Wiki
Bug Trackers
MegaMek Tracker
MekHQ Tracker
MegaMekLab Tracker
New Units and RAT's aren't added until after the 2 month release moratorium is passed.
Join the official MegaMek Discord

Windchild

  • Master Sergeant
  • *
  • Posts: 297
Re: Change Default KeyBinds
« Reply #13 on: 11 March 2021, 19:13:20 »
What version Tecmes?
MegaMek Developer - MekHQ, Personnel, and Internal Focus
MegaMek Discord
MegaMek Projects Wiki
Bug Trackers
MegaMek Tracker
MekHQ Tracker
MegaMekLab Tracker

Tecmes

  • Sergeant
  • *
  • Posts: 125
Re: Change Default KeyBinds
« Reply #14 on: 12 March 2021, 11:39:44 »
Sorry, 48.0.
Interesting, Hammer, so you mean that you are able to save bindings in between sessions?
(I mean actually closing and reopening standalone MM. For some reason successives session when launched from MHQ retain the binding, but not if I close and reopen MHQ)

Hammer

  • Numerorum Malleo
  • Global Moderator
  • Major
  • *
  • Posts: 4128
    • MegaMek Website
Re: Change Default KeyBinds
« Reply #15 on: 12 March 2021, 11:47:17 »
Sorry, 48.0.
Interesting, Hammer, so you mean that you are able to save bindings in between sessions?
(I mean actually closing and reopening standalone MM. For some reason successives session when launched from MHQ retain the binding, but not if I close and reopen MHQ)
Yep, but tested only with Megamek and not MekHQ involvement.
MegaMek Projects Wiki
Bug Trackers
MegaMek Tracker
MekHQ Tracker
MegaMekLab Tracker
New Units and RAT's aren't added until after the 2 month release moratorium is passed.
Join the official MegaMek Discord

Tecmes

  • Sergeant
  • *
  • Posts: 125
Re: Change Default KeyBinds
« Reply #16 on: 17 March 2021, 12:14:25 »
Then it means I have a very mysterious bug there. Could be a file permission issue... except the default fiel gets modified and it would be weird that it could be written but not read...

Also I still do not understand why the file that gets modified is the default keybind file.

Tecmes

  • Sergeant
  • *
  • Posts: 125
Re: Change Default KeyBinds
« Reply #17 on: 27 May 2021, 08:40:18 »
I've noticed, in my install, the nag screen in MM for the bot and the intial load always show even if I check "Do not bother me again", an issue which is likely linked to the key binding not saving. Does someone know where this "stop nagging" is saved? That could help me troubleshoot.

Hammer

  • Numerorum Malleo
  • Global Moderator
  • Major
  • *
  • Posts: 4128
    • MegaMek Website
Re: Change Default KeyBinds
« Reply #18 on: 27 May 2021, 10:09:41 »
I've noticed, in my install, the nag screen in MM for the bot and the intial load always show even if I check "Do not bother me again", an issue which is likely linked to the key binding not saving. Does someone know where this "stop nagging" is saved? That could help me troubleshoot.

It should be in clientsettings.xml
MegaMek Projects Wiki
Bug Trackers
MegaMek Tracker
MekHQ Tracker
MegaMekLab Tracker
New Units and RAT's aren't added until after the 2 month release moratorium is passed.
Join the official MegaMek Discord

Tecmes

  • Sergeant
  • *
  • Posts: 125
Re: Change Default KeyBinds
« Reply #19 on: 29 May 2021, 07:46:41 »
Still having the same really odd behaviour as described above where the default file is modified but not read... I just CANNOT understand why I'm seemingly the only person out there unable to save key bindings and button order...
« Last Edit: 29 May 2021, 09:53:36 by Tecmes »

Hammer

  • Numerorum Malleo
  • Global Moderator
  • Major
  • *
  • Posts: 4128
    • MegaMek Website
Re: Change Default KeyBinds
« Reply #20 on: 29 May 2021, 10:43:45 »
What OS? Also does the OS have any enhanced security. For example in Windows if you have Ransomware protection turned on it limits what can be written in certain folders.
MegaMek Projects Wiki
Bug Trackers
MegaMek Tracker
MekHQ Tracker
MegaMekLab Tracker
New Units and RAT's aren't added until after the 2 month release moratorium is passed.
Join the official MegaMek Discord

Tecmes

  • Sergeant
  • *
  • Posts: 125
Re: Change Default KeyBinds
« Reply #21 on: 29 May 2021, 16:11:36 »
I had looked in that direction. I've no such setting, nor antivirus etc. It's a pretty clean install of Win7/64.

I,ve tried putting the game folder in MyDocs, Prog Files and even root C:. I run MHQ with admin rights when in a folder that mandates it. Also I wouldn't think MHQ saves data outside the folder?