KeyEvents Enter, Delete, and Insert write incorrectly #24

Closed
IsmAvatar opened this Issue Aug 17, 2012 · 5 comments

Comments

Projects
None yet
2 participants
@IsmAvatar
Owner

IsmAvatar commented Aug 17, 2012

They have a lookup map, but the writer does not use it. (This also affects the ENIGMA plugin writer). Pretty much all other keys map to their own values (so they write correctly anyways).

@RobertBColton

This comment has been minimized.

Show comment
Hide comment
@RobertBColton

RobertBColton Aug 12, 2013

Collaborator

I would like to know if this issue still exists, platforms, etc.

Collaborator

RobertBColton commented Aug 12, 2013

I would like to know if this issue still exists, platforms, etc.

@IsmAvatar

This comment has been minimized.

Show comment
Hide comment
@IsmAvatar

IsmAvatar Apr 12, 2014

Owner

Since I don't recall the exact details of this, I'll instead provide a test case of acceptable behavior:

  1. Create seven (7) objects.
  2. In the first object (the control), submit other, regular key events, such as letters, spacebar, enter.
  3. In the second, third, and fourth objects, respectively click the Enter, Delete, and Insert key event such that each object has one key event.
  4. Repeat this task for the fifth, sixth, and seventh objects by pressing the keys instead.
  5. In each of these events, place a uniquely visible action, such as "Show a message" with its own text.
  6. Create a starting room and place all the objects in the room.
  7. Save the game.
  8. Load the game in GM6 and GM7. Confirm that the key events retain their intended key.
  9. Run the game in GM6, GM7, and ENIGMA. Confirm that each of the key events behave properly.
    If you have successfully completed all of these steps, ticket passes. If you have difficulty during any of these steps, test case fails - either the solution was incorrect or a separate ticket may be filed as a blocker.
Owner

IsmAvatar commented Apr 12, 2014

Since I don't recall the exact details of this, I'll instead provide a test case of acceptable behavior:

  1. Create seven (7) objects.
  2. In the first object (the control), submit other, regular key events, such as letters, spacebar, enter.
  3. In the second, third, and fourth objects, respectively click the Enter, Delete, and Insert key event such that each object has one key event.
  4. Repeat this task for the fifth, sixth, and seventh objects by pressing the keys instead.
  5. In each of these events, place a uniquely visible action, such as "Show a message" with its own text.
  6. Create a starting room and place all the objects in the room.
  7. Save the game.
  8. Load the game in GM6 and GM7. Confirm that the key events retain their intended key.
  9. Run the game in GM6, GM7, and ENIGMA. Confirm that each of the key events behave properly.
    If you have successfully completed all of these steps, ticket passes. If you have difficulty during any of these steps, test case fails - either the solution was incorrect or a separate ticket may be filed as a blocker.
@RobertBColton

This comment has been minimized.

Show comment
Hide comment
@RobertBColton

RobertBColton Apr 17, 2014

Collaborator

I forgot about this one, yes I am able to reproduce the issue, I want this fixed and in the 1.8.5 release, will post back with more details.

Edit: When you create an object with the enter key event, and save it as gm81 then load it into GM8.1 it will say

I saved another file with all possible key ranges, and it does appear to be only these 3 buttons.

Collaborator

RobertBColton commented Apr 17, 2014

I forgot about this one, yes I am able to reproduce the issue, I want this fixed and in the 1.8.5 release, will post back with more details.

Edit: When you create an object with the enter key event, and save it as gm81 then load it into GM8.1 it will say

I saved another file with all possible key ranges, and it does appear to be only these 3 buttons.

@RobertBColton

This comment has been minimized.

Show comment
Hide comment
@RobertBColton

RobertBColton Apr 18, 2014

Collaborator

Alright I have the fix. I was able to get the enter key to map properly by changing the following line.
https://github.com/IsmAvatar/LateralGM/blob/master/org/lateralgm/resources/sub/Event.java#L344
I changed it to keys.put(13,13); //vk_enter
I also changed the following line to fix the Event Panel.
https://github.com/IsmAvatar/LateralGM/blob/master/org/lateralgm/subframes/EventPanel.java#L165
I changed it to keyboard.add(MainEvent.EV_KEYBOARD,13);

Now I can fix it the way you want and just handle it in all of the writers including the plugin. But I don't see why I can't just create a constant like we did for NO_KEY and ANY_KEY and save ourselves the trouble?

Collaborator

RobertBColton commented Apr 18, 2014

Alright I have the fix. I was able to get the enter key to map properly by changing the following line.
https://github.com/IsmAvatar/LateralGM/blob/master/org/lateralgm/resources/sub/Event.java#L344
I changed it to keys.put(13,13); //vk_enter
I also changed the following line to fix the Event Panel.
https://github.com/IsmAvatar/LateralGM/blob/master/org/lateralgm/subframes/EventPanel.java#L165
I changed it to keyboard.add(MainEvent.EV_KEYBOARD,13);

Now I can fix it the way you want and just handle it in all of the writers including the plugin. But I don't see why I can't just create a constant like we did for NO_KEY and ANY_KEY and save ourselves the trouble?

@RobertBColton

This comment has been minimized.

Show comment
Hide comment
@RobertBColton

RobertBColton Apr 18, 2014

Collaborator

I have fully fixed this issue in commit 9633a42 by creating a constant as mentioned above and it works in all possible test cases.
Edit: Marking this issue as resolved.

Collaborator

RobertBColton commented Apr 18, 2014

I have fully fixed this issue in commit 9633a42 by creating a constant as mentioned above and it works in all possible test cases.
Edit: Marking this issue as resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment