PND nub modes

From Pandora Wiki
Revision as of 05:17, 9 October 2013 by Kingu (talk | contribs)
Jump to: navigation, search

This page is a work in progress, the instructions in here may or may not work for you. They were copied from several forum posts (see inline references). For an introduction to PNDs, see Introduction to PNDs.

If you want a different nub behavior for certain PND applications, you can achieve this by using one of the presented methods here.

Rationale

Why would you want to do this? Simple; at least one person has reported that, when playing a natively-ported FPS (like Duke Nukem or Quake, but not GoldenEye) on the Pandora, using the right nub as the mouse has proven to be more comfortable and less awkward. But switching nub modes manually is annoying; so let's have Linux do it for you!

Presented methods ONLY apply per PND, do not affect general behavior

The methods below are crash save, as the nub behavior is changed by the process pnd_run.sh, which runs before AND after a PND is running. Thus even in the event that your PND application crashes, your nub configuration WILL be the same as before you started the PND with the custom nub behavior. (Source: sebt3 forum post)

Method: Switch left/right nub unix devices

Hint from: Blue Protoman

Step 1

You must download sebt3's new Libpnd_hub#pnd_run.sh installer and run it. Get it here.
Note: This step is no longer required as of Hotfix 6 Alpha 1.

Step 2

Open a text editor and copy/paste this:

cat /proc/pandora/nub0/mode > /tmp/nub0mode_before
cat /proc/pandora/nub1/mode > /tmp/nub1mode_before

/usr/pandora/scripts/op_nubchange.sh mbuttons mouse

This will back up your current nub modes, then switch them; the left will act as the mouse buttons, the right will act as the mouse. If you'd like, you can substitute "scroll" or "absolute" (joystick) in, depending on how you like your nubs. But you must save this as PND_pre_script.sh. Save it wherever you'd like, you will be moving it elsewhere later.

Note: op_nubchange.sh script might not available in older firmwares. See Kernel interface page for more information.

Step 3

Copy/paste this into the editor again. Different file this time.

nub0mode=`cat /tmp/nub0mode_before`
nub1mode=`cat /tmp/nub1mode_before`
/usr/pandora/scripts/op_nubchange.sh $nub0mode $nub1mode

rm /tmp/nub0mode_before /tmp/nub1mode_before

This will restore your nub modes to what they were before, and delete the temporary files used to store them. You must save it as PND_post_script.sh.

Step 4

Simply copy these files into the appdata folder of your program of choice! Now you're done. If you want to test it, drag these files into the appdata of a program that runs windowed (like Comix or Deadbeef), so you can test with the mouse. Simply delete the files if you no longer desire their effects.

Method: Switch between nub configurator presets

Hint from: Caine

Steps

  • Start the nub configurator
  • Create a profile for the setup you wish your application to use.
  • Below, I'll assume a profile is created which is called joysticks which places both nubs in joystick mode.
  • Create a file PND_pre_script.sh with this content:
    • /usr/pandora/scripts/op_nubmode.py -s temp_profile -p joysticks
    • This will store the current configuration in a profile called temp_profile and next will load the joysticks profile.
  • Create a file PND_post_script.sh with this content:
    • /usr/pandora/scripts/op_nubmode.py -p temp_profile -d temp_profile
    • This will load the previously created profile temp_profile and will remove it afterwards.
  • Simply copy the files PND_pre_script.sh and PND_post_script.sh into the appdata folder of your program of choice!

Advantage

Uses the GUI to easily create custom profiles without having to know where values are written to.

Disadvantages

  • It is slower, uses some memory and writes profiles to NAND.
  • If you want to avoid NAND-writes per launch and you always revert back to the same profile after launch then you can use static profiles without having to save and remove the current. E.g. something like:
    • Before: /usr/pandora/scripts/op_nubmode.py -p joysticks
    • After: /usr/pandora/scripts/op_nubmode.py -p Default