Author Topic: [fixed], 3.6.0.2, linux : "error converting from string to int, found: (-)"  (Read 1314 times)

Jérôme

  • Guest
Hi.

As I'm using an azerty keyboard, group selection shortcuts (0 -> 9) don't seem to work (even with the shift key pressed). Si I tried to reaffect them to the number keys without pressing shift : &é"'(-è_çà.

cat .megaglest/glestuserkeys.ini
; === propertyMap File ===

GroupUnitsKey1=&
GroupUnitsKey10=world 64
GroupUnitsKey2=world 73
GroupUnitsKey3="
GroupUnitsKey4='
GroupUnitsKey5=(
GroupUnitsKey6=-
GroupUnitsKey7=world 72
GroupUnitsKey8=_
GroupUnitsKey9=world 71

Then, when entering again in keyboard setup, I an error like : "error converting from string to int, found: (-)" and can't modify anything.

Removing .megaglest/glestuserkeys.ini set things back to default.

Perhaps should there be a test before writing stuff that can't be read, if not support for these keys.
« Last Edit: 9 January 2012, 21:29:35 by Jérôme »

tomreyn

  • Local Moderator
  • Airship
  • ********
  • Posts: 2,764
    • View Profile
    • MegaGlest - the free and open source cross platform 3D real-time strategy game
Thanks for your report. I'm surprised that there are still issues with the AZERTY keyboard layout and unit grouping since the exact same issue had been discussed and fixed, and confirmed fixed in the past.
atibox: Ryzen 1800X (8 cores @3.6GHz), 32 GB RAM, MSI Radeon RX 580 Gaming X 8G, PCI subsystem ID [1462:3417], (Radeon RX 580 chipset, POLARIS10) @3440x1440; latest stable Ubuntu release, (open source) radeon (amdgpu) / mesa video driver
atibox (old): Core2Quad Q9400 (4 cores @2.66GHz), 8 GB RAM, XFX HD-467X-DDF2, PCI subsystem ID [1682:2931], (Radeon HD 4670, RV730 XT) @1680x1050; latest stable Ubuntu release, (open source) radeon / mesa video driver
notebook: HP envy13d020ng
internet access: VDSL2+

· · · How YOU can contribute to MG · Latest development snapshot · How to build yourself · Megapack techtree · Currently hosted MG games · · ·

Jérôme

  • Guest
OK. Moving to the other thread for azerty unit grouping and leaving this one to keyboard settings save and read issue.

softcoder

  • MegaGlest Team
  • Battle Machine
  • ********
  • Posts: 2,239
    • View Profile
Unless you know what you're doing never edit the keyboard ini directly but use the keyboard assignment menu.

Jérôme

  • Guest
I did : the .megaglest/glestuserkeys.ini reproduced here was created using the keyboard assignment menu.

And I could enter keys that could not be read afterwards and therefore prevented the menu from opening... and the user from modifying the keys to something else.

I was in a broken state until I manually erased the .ini file.

softcoder

  • MegaGlest Team
  • Battle Machine
  • ********
  • Posts: 2,239
    • View Profile
the - issue is now fixed in svn. Regarding numbers vs numpad, i checked the code and either # or numpad # should work. If somehow your keyboard + sdl is not reporting the value properly then there will be issues. In the keyboard setup screen (options ->keyboard setup) as soon as you enter the screen you can press keys and see what value SDL gives us by looking at the top left corner.

Thanks

Jérôme

  • Guest
In the keyboard setup screen, # and numpad # don't give exactly the same values.

# numpad : 0 (0)(256)(48)(48)
# : 0 (0)(224)(48)(48)

I tried to map group actions to # instead of numpad # and as far as I understand,
  • either I press the Shift key, and it does not seem to work (no error displayed but I don't get any group / recall action working),
  • either I don't (after all, I don't care if the key is mapped as number or as &, #, or ç, as long as the action is executed as I type), then I get the error that made me open this bug in the first place : some characters are not interpreted correctly (at leat until last SVN)

How did you fix the issue in SVN ? Did you allow the mapping of special character keys, or just a prevented the user from settings such keys ?

softcoder

  • MegaGlest Team
  • Battle Machine
  • ********
  • Posts: 2,239
    • View Profile
Are you saying on an azerty keyboard that you cannot press a # key (without shift etc) to just get the #? If that is the case then this is likely the problem as shift, ctrl and atl have other special meanings. I only fixed the issue in svn related to the '-' character so it can be used as a key.

So for grouping keys the actual keystrokes must be keys that require no special combination as the trigger for their assignment you already require pressing CTRL + # then to recall just the #.

Jérôme

  • Guest
Are you saying on an azerty keyboard that you cannot press a # key (without shift etc) to just get the #?
Well, yes. I mean, no you cannot.

To type a number, I can :
- use numpad (NumLock is generally on)
- use shift + # key

And that's all. I believe on windows platforms, one can use Caps Lock to type numbers. On linux, this does not work. You get the capitalized versions of the special keys instead (eg: é becomes É), which is useful as well.

If that is the case then this is likely the problem as shift, ctrl and atl have other special meanings. I only fixed the issue in svn related to the '-' character so it can be used as a key.

So for grouping keys the actual keystrokes must be keys that require no special combination as the trigger for their assignment you already require pressing CTRL + # then to recall just the #.
OK, I get the "no combination allowed" part.

Perhaps the issue is partly solved. If all the special keys in the # bar are understood, they can be used as shortcuts just as # would.  The difference being they are not equivalent to numpad #, therefore you can't have a setting that allows both (as MegaGlest does not allow two keys for the same action).

Thanks.

softcoder

  • MegaGlest Team
  • Battle Machine
  • ********
  • Posts: 2,239
    • View Profile
Ok, now that i understand that some keyboards require pressing SHIFT to print a normal # I have allowed this and commited the code change in svn for next release.

Jérôme

  • Guest
Thanks.

Actually, if I am given the choice between

config a : group / recall affacted to both numpa # and # needing shift

config b : group recall available only via unshifted # keys (these are &, é, ", ', (, -, è, _, ç, and à) but not via numpad #

I'll go for the second, as having to use Shift is not that practical. (I have one hand on the mouse, the other on the keyboard. Note I'm a new user and I don't use other shortcuts. Other players may feel differently.)

Having equivalency between numpad # and unshifted # keys would probably be the ideal. But I guess that would make it complicated. The simpler would be to allow the mapping of two keys for the same action, but even this is probably not worth bothering with. Especially if everyone is happy with how it currently works.

At least you suppressed the problem of people screwing up the keyboard settings menu by typing the '-' key.

Marking as fixed.

softcoder

  • MegaGlest Team
  • Battle Machine
  • ********
  • Posts: 2,239
    • View Profile
The # key and numpad # keys will both work with the last commit i made in svn.

 

anything