The "up staircase" key should not cause problems. It is passed through to FBReader and you can map it to whatever action you want. I map it to <quit> (and I map long press up staircase to <home> since that is what its keycode is).
The other 5 keys don't reach FBReader, but are trapped by the contentLister. I don't know if the contentLister then issues a kill call that is missed by FBReader or not.
What are the symptoms of the problem? If it is just that a new FBReader invocation runs a 2nd FBReader, then there is an simple fix. In run.sh, use:
Code:
/usr/bin/killall FBReader 2>| ./killall.err
/usr/local/bin/FBReader 2>| ./run.err
This kills all running version of FBReader before starting it again. The stderr from the last run will be saved in killall.err and run.err. Note that if there are FBReader processes running you get an error from killall even when it works.
I tried this in stand-alone FBRreader and it seems to work. I'm not sure how FBReader works when you click on a book in the contentLister, but something similar should work.
If this is all that is needed, the same technique can be used in all the stand-alone single-app scripts. Then if there are rogue standalone apps you can kill them by re-invoking the same app.