Hi, I'd like to know if the 'repeatable' flag in the key bindings is supposed to work ? It doesn't on my debian sid with the latest cvs fgfs : keys are always repeated even when the flag is false... It might sound trivial but I think it's important for people flying with a keyboard (I use the mouse myself but hoften use the keyboard too for slight adjustments). With really non-repeatable keys, we could have smooth move of the controls by starting a nasal increment loop on a key press and stopping it on key up rather than calling an increment func for each key press event (hope I'm clear enough ;) We can actually do it, but the loop will be continually stopped and restarted, making it inefficient, redundant and irregular. One of those little annoying things remainding you that you are flying a computer and not a real plane...
I had a look at the sources and it seems to be correctly implemented so I guess this comes from some underlying lib (glut?) which makes no difference between a key press and a key repeat. Then I wrote a dirty hack which fix this by holding key-release events for a short time (1ms seems to be fine) and discarding them if a corresponding key-press is received during that period. Seems to work fine : the binding is called for each repeat if the key is 'repeatable' and only once otherwise, and any 'mod-up' binding is always called once, when the key is really released. There's a risk of loosing some events if you release and re-press a key very quickly, but it doesn't happen in practice and wouldn't be noticable anyway. So maybe there are better solutions like disabling key repeat at a lower level and implementing it ourself ? It would be much harder but would provide some nice features, like letting the user specify a different repeat delay for each key binding and thus define keys with a regular repeat rate. Maybe we could also create a <mod-down> binding, so this one would only be called when the key is pressed, the default one for each press/repeat and the <mod-up> when the key is released. Well, all this to say I'd like to do something about that, so any opinions or suggestions are welcome... and sorry if all this doesn't make sense, this is my first try with FG ;) PS: please tell me if you're interested by the hack, as it will need some optimization and cosmetics first... thanks, -- Cédric Lucantis ------------------------------------------------------------------------- SF.Net email is sponsored by: Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace _______________________________________________ Flightgear-devel mailing list Flightgear-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/flightgear-devel