Key Remapping?


ozzyfreakdude

Still Fresh
Joined
Feb 14, 2011
Messages
92
Hello


I've noticed that in many different programs, if I make enough key-presses in succession [including using the D-Pad, which is the main problem], I experience something similar to a key lock on PC keyboards. Basically if you're pressing different buttons on the D-pad in quick succession, as you do with most games, it will end up registering one key as being held down until you completely release the D-Pad and push the key that's being pushed down.


For example, say you're playing Duke Nukem 3d or Descent, and moving around with the D-Pad in various directions. Then all of a sudden the left key will get stuck, and your character will consistently move left until you completely let go of the d-pad and then push left again.


It basically makes all of the affected games unplayable, as you can't effectively control the game.


Something similar had happened in other emulators, like the SNES emulator and GnGeo [rather than keeping the key held down, it wouldn't register any more key presses if you had pushed enough buttons on the D-Pad], but I fixed it by turning off the keyboard-related options in the accessibility menu. This issue still persists in certain games, though. I mainly notice it in ports of open-source game engines, such as Descent, Duke Nukem 3d, Heretec II, etc.


Any help or ideas are appreciated. Thanks


EDIT: the original title is no longer relevant, so I'm changing the title to make it more relevant
 
Last edited by a moderator:
This sounds like it is currently too stiff. Happens with some DPads until you play a while with them.


You can try to wiggle it a lot to loosen it a bit :)
 
I'm not sure if this is hardware, I've never seen a dpad get stuck down. I've only seen them be very sensitive.


This sounds like the strange event you can do in the input tester where if you hold down enough keys they get stuck down in the software (even if they are not being pressed).


If you think it is the dpad, pull it up a little and look under it, see if there is any glue residue (it will look shiny) on the rubber nubs which go in to the dpad.


If there is move it about a bit until the glue clearly starts to crack and loosen up.
 
As I was in the process of testing EvilDragon's idea of wiggling the D-Pad, I noticed a strange common connection between all the times it gets stuck; The mouse clicking.


I realized that [say for example, in a doom/heretec style game] if I'm standing still not touching the d-pad, and clicking to shoot, and then I try to move with the d-pad while I'm shooting, it will not allow me to move - IE it doesn't register the keypresses while the mouse is held down.


However, if I'm moving in one direction while shooting, IE I'm holding down the up button on the D-Pad, I click to shoot, and then I let go of the mouse button, the up button on the d-pad will be frozen in the state that it was in as I clicked the mouse. In other words, if I'm running forward and shoot, then I will continue running forward after letting go of the d-pad until I push up again.
 
For what it's worth, I should add that I have the mouse buttons mapped to the left and right triggers. So it could also be intepreted as the triggers freezing the d-pad, as well as the mouse.


Is there a way that one could set an application specific keymapping? Maybe something like setting a keymap file somewhere in the PND's appdata folder to be launched on startup, so that triggers as mouse could be disabled in games that conflict with it, thus freeing up the triggers in those games?
 
For what it's worth, I should add that I have the mouse buttons mapped to the left and right triggers. So it could also be intepreted as the triggers freezing the d-pad, as well as the mouse.


Is there a way that one could set an application specific keymapping? Maybe something like setting a keymap file somewhere in the PND's appdata folder to be launched on startup, so that triggers as mouse could be disabled in games that conflict with it, thus freeing up the triggers in those games?

It sounds like that's the problem.


How have you mapped the mouse buttons to L/R?


Changing the keymap would be possible with xmodmap.
 
I manually edited the .pndXmodmap file located in home. Is there an xmodmap utility? Maybe I'm just editing the configuration file of a GUI utility or something?


How should I go about doing so?


I've attached the .pndXmodmap file that I'm using [as a text file]

pndXmodmap.txt
 

Attachments

  • pndXmodmap.txt
    2.9 KB · Views: 222
Thanks for pointing me in the right direction. As soon as I realized that you can run xmodmap as a terminal application, I wrote a quick simple script to automate changing to a new configuration file, running the game, and changing back. I figured I'd post it here in case anybody else wants to do the same thing.


Put all 3 of the attached files in the same directory. Rename the run file to run_[whatever you want to run].sh [i had to make it a txt file to upload it), change the name of the pnd on the second line, make sure it's executable [sudo chmod +x nameofthefile.sh), make sure the pnd file is in the same directory, and then run the script.


Assuming that you already have your triggers mapped as mouse buttons, it loads a mapping file that remaps them as keys [shift and alt if I remember correctly] so that you can then map them to whatever you need in your game. It then runs the game, and as soon as the game is finished it sets the mapping back to the triggers as mouse buttons. It takes a minute after exiting the program for the remapping to take effect, but it does work - at least for me.



pndXmodmapMouseTriggers.txt

pndXmodmapNoMouseTriggers.txt
 

Attachments

  • run_hexen.txt
    92 bytes · Views: 162
  • pndXmodmapMouseTriggers.txt
    2.9 KB · Views: 165
  • pndXmodmapNoMouseTriggers.txt
    2.9 KB · Views: 175
Last edited by a moderator:
After using these scripts for a while, I've noticed a fundamental problem. They work fine for ports which don't remap the controls within the code of the pnd itself, such as the game engine ports I was referring to.


However, if you want to remap the controls for programs which automatically remap the controls themselves, such as GINGE and every other emulator I've used, manually applying xmodmap such as in this script doesn't work, because it remaps the controls again AFTER you've set the controls to what you want. For most programs that do this it's not much of a problem, because they're usually emulators and provide their own facility for control customization.


However, I've noticed that GINGE doesn't - it just remaps the controls to their corresponding buttons on the Pandora, and I haven't figured out any way to customize this. This is a problem with FBA in ginge, because it will only play vertical games by flipping the screen, thus requiring to use the d-pad with the left hand and the action buttons with the right hand. This was no big deal on the gp2x, but the Pandora's flip screen gets in the way of the thumb while using the D-pad flipped sideways, making it unplayable without serious cramps. However, mapping the action buttons to the triggers would make it possible to use the d-pad with the right hand.


Basically what I'm proposing is - does anybody know of a way to change the controls of something that handles its own control mapping, such as GINGE? Maybe the only way to do so is by repackaging the PND, or by recompiling from source? if so, that gives me an excuse in getting my feet wet in something other than Java and vb.net. And if recompiling from source, is there an xmodmap file included somewhere in the source, or are the keymappings all assigned during run-time? Does anybody have any ideas/experience/suggestions with this?
 
Back
Top