Key binder program (javascript)

A forum for the discussion and development of programs to assist working on or playing with the Vegastrike engine and data sets.
PhaethonH
Star Pilot
Star Pilot
Posts: 6
Joined: Sat Jul 07, 2007 8:14 am
Location: Los Angeles-ish, California, USA
Contact:

Key binder program (javascript)

Post by PhaethonH »

Key binder program for Vegastrike 0.4.x done in Javascript. Spent the better part of a day on this, so it's quite crappy. A bit rough interface-wise, but I think it's still marginally usable. Most noticeable shortfall is lack of joystick bindings. German keyboard was included only because I read something in the wiki about a lot of unshifted-keys being shifted on .de keyboard, e.g. RespawnKey on semicolon; but otherwise I know next to squat about German. I tried to keep the JS sources navigable and editable, but I think I fell short here, too.

Tested on Firefox 2.0.0.4 and... um... that's it...
Would appreciate comments and feedback on this key binder program.

demo: http://www.icculus.org/~phaethon/vegast ... ebind.html

download in pieces: http://www.icculus.org/~phaethon/vegast ... trikebind/
Last edited by PhaethonH on Tue Jun 28, 2011 11:08 am, edited 1 time in total.
loki1950
The Shepherd
Posts: 5841
Joined: Fri May 13, 2005 8:37 pm
Location: Ottawa
Contact:

Post by loki1950 »

Welcome PhaethonH nice contribution on a first post 8) called up your demo looks functional you will probably get some feedback soon.Have fun.

Enjoy the Choice :)
my box::HP Envy i5-6400 @2Q70GHzx4 8 Gb ram/1 Tb(Win10 64)/3 Tb Mint 19.2/GTX745 4Gb acer S243HL K222HQL
Q8200/Asus P5QDLX/8 Gb ram/WD 2Tb 2-500 G HD/GF GT640 2Gb Mint 17.3 64 bit Win 10 32 bit acer and Lenovo ideapad 320-15ARB Win 10/Mint 19.2
Halleck
Elite
Elite
Posts: 1832
Joined: Sat Jan 15, 2005 10:21 pm
Location: State of Denial
Contact:

Post by Halleck »

This is great! Works pretty well for me on Epiphany (GNOME/Gecko browser) but that's to be expected if it was tested in Firefox.

I think the section tag is <bindings>, not <binding>. Drag-n-drop is a little flaky (and has the weird side effect of highlighting the keyboard) but other than that, it works seamlessly.

Thanks for your contribution.
ace123
Lead Network Developer
Lead Network Developer
Posts: 2560
Joined: Sun Jan 12, 2003 9:13 am
Location: Palo Alto CA
Contact:

Post by ace123 »

That's a very nice script... Simple and it gets the job done.
I had never thought about making a javascript generator...

A keybindings program like yours might be handy to include along with setup.
PhaethonH
Star Pilot
Star Pilot
Posts: 6
Joined: Sat Jul 07, 2007 8:14 am
Location: Los Angeles-ish, California, USA
Contact:

Post by PhaethonH »

updated to fix "bindings" tag, and to include mouse axes, 4 joystick axes, and two digital hatswitches even though d-hats are broken up to and through CVS (and SVN?) versions. I also got a handle on how the analog hatswitch thing seems to work, so I'll also be working on a pseudo-graphical way of making a-hat ranges as well.
ace123
Lead Network Developer
Lead Network Developer
Posts: 2560
Joined: Sun Jan 12, 2003 9:13 am
Location: Palo Alto CA
Contact:

Post by ace123 »

No, I believe the problem with hats was only in 0.4.3... They definitely worked at some point in SVN between the last release and now... and I don't see why they would have stopped working.

Though it is possible that it might show up as a normal hat or even as two axes (d-pad).
PhaethonH
Star Pilot
Star Pilot
Posts: 6
Joined: Sat Jul 07, 2007 8:14 am
Location: Los Angeles-ish, California, USA
Contact:

Post by PhaethonH »

ace123 wrote:No, I believe the problem with hats was only in 0.4.3... They definitely worked at some point in SVN between the last release and now... and I don't see why they would have stopped working.

Though it is possible that it might show up as a normal hat or even as two axes (d-pad).
Oops. I misread the wiki. It's disabled by default, which I mistook to mean "completely broken". Glad to know it's not all dead. :oops:

Anyway, another update, this time adding analog hatswitches that almost matches what I envisioned a couple days ago (same urls in first post).

Eventually, I'm hoping to move this whole mess to Python and/or in-VS-game. I started out doing a Javascript version so that keys could be set out-of-game while browsing web pages and researching other resources, without it taking up 100% CPU and/or screen (like some annoying moments back when I started on Quake 3 and Unreal Tournament 2004).
loki1950
The Shepherd
Posts: 5841
Joined: Fri May 13, 2005 8:37 pm
Location: Ottawa
Contact:

Post by loki1950 »

How would one go about updating this wee beastie to deal with the new bindings in SVN would be nice to have it around come release time i imaging that it not as simple as just changing defaults_vegastrike_04x.txt to include the new bindings.


Enjoy the Choice :)
my box::HP Envy i5-6400 @2Q70GHzx4 8 Gb ram/1 Tb(Win10 64)/3 Tb Mint 19.2/GTX745 4Gb acer S243HL K222HQL
Q8200/Asus P5QDLX/8 Gb ram/WD 2Tb 2-500 G HD/GF GT640 2Gb Mint 17.3 64 bit Win 10 32 bit acer and Lenovo ideapad 320-15ARB Win 10/Mint 19.2
PhaethonH
Star Pilot
Star Pilot
Posts: 6
Joined: Sat Jul 07, 2007 8:14 am
Location: Los Angeles-ish, California, USA
Contact:

Post by PhaethonH »

Added update for VS SVN.

http://www.linux.ucla.edu/~phaethon/veg ... d-05x.html

Wasn't sure how to present both the for-0.4.x version and for-SVN versions. I wanted to do some kind of "select a version" selector/droplist, but I decided to just be lazy and make separate pages :mrgreen:
loki1950
The Shepherd
Posts: 5841
Joined: Fri May 13, 2005 8:37 pm
Location: Ottawa
Contact:

Post by loki1950 »

Thx PhaethonH i think i will put a link to here in the user help area :D should drop the questions i have to answer :wink: as for making them separate 0.4.3 should no longer be needed after release 8)

Enjoy the Choice :)
my box::HP Envy i5-6400 @2Q70GHzx4 8 Gb ram/1 Tb(Win10 64)/3 Tb Mint 19.2/GTX745 4Gb acer S243HL K222HQL
Q8200/Asus P5QDLX/8 Gb ram/WD 2Tb 2-500 G HD/GF GT640 2Gb Mint 17.3 64 bit Win 10 32 bit acer and Lenovo ideapad 320-15ARB Win 10/Mint 19.2
whatch1
Bounty Hunter
Bounty Hunter
Posts: 182
Joined: Sat Jul 21, 2007 5:14 am
Location: Western MA

throttle and hat switches

Post by whatch1 »

a most of the fuctions buttons on the sidwinder are reprogramable via the included software including the hat views that makes 16 programable buttons but no way to allow for reverse thrust I'd like a way calibrate the throtle to use reverse thrust. throttle dosen't like negative values it all way fights it back to zero

Anyone know how i could do this. make it 75% forward 25% reverse


thanx in advance for any assistance
Bill
Machine: P4 prescott 3.2 Ghz, 2Gb ddr ram, 2 80g seagate sata drives in raiad stripe config nvidia 6600 gt oc card sidwinder pro FF2
Erk
Trader
Trader
Posts: 26
Joined: Thu Dec 20, 2007 12:33 am
Location: Japan

Post by Erk »

This really needs to be included in the program, or at least in the setup package... I use a non-english keyboard, and was beginning to despair that some of the commands might never be accessible, after looking all through the manual and the options.
loki1950
The Shepherd
Posts: 5841
Joined: Fri May 13, 2005 8:37 pm
Location: Ottawa
Contact:

Post by loki1950 »

@Erk it's a bit out of date there have been some new bindings added to the config file so the script needs a bit of work :wink:

Enjoy the Choice :)
my box::HP Envy i5-6400 @2Q70GHzx4 8 Gb ram/1 Tb(Win10 64)/3 Tb Mint 19.2/GTX745 4Gb acer S243HL K222HQL
Q8200/Asus P5QDLX/8 Gb ram/WD 2Tb 2-500 G HD/GF GT640 2Gb Mint 17.3 64 bit Win 10 32 bit acer and Lenovo ideapad 320-15ARB Win 10/Mint 19.2
Xit
Bounty Hunter
Bounty Hunter
Posts: 186
Joined: Mon Aug 06, 2007 2:34 am
Location: Cambs

Post by Xit »

Would it make more sense for the config file to contain functions first which then bind to keys, rather than each key being bound with a modifier to some function? I find it's a lot harder to move a function you're not familiar with to a key than just to type in the key you want (which you know the name of) next to the function in a complete list.

Also I'd be interested in helping with the keymapper (which I assume you'll need in python) but I'm not sure where to start since I've only coded in Ada, is it easy to pick up?
loki1950
The Shepherd
Posts: 5841
Joined: Fri May 13, 2005 8:37 pm
Location: Ottawa
Contact:

Post by loki1950 »

@Xit that would most likely break the file as it would not be XML any more :wink: this keybinder is actually written in java script so updating it for the new functions is just adding them to the proper arrays.I believe someone is working on splitting the user settings(bindings,screen resolution,sound etc)out of the config file and into some more human friendly format :D

Enjoy the Choice :)
my box::HP Envy i5-6400 @2Q70GHzx4 8 Gb ram/1 Tb(Win10 64)/3 Tb Mint 19.2/GTX745 4Gb acer S243HL K222HQL
Q8200/Asus P5QDLX/8 Gb ram/WD 2Tb 2-500 G HD/GF GT640 2Gb Mint 17.3 64 bit Win 10 32 bit acer and Lenovo ideapad 320-15ARB Win 10/Mint 19.2
Xit
Bounty Hunter
Bounty Hunter
Posts: 186
Joined: Mon Aug 06, 2007 2:34 am
Location: Cambs

Post by Xit »

Thanks Loki, I feel better knowing the reason for the layout anyway :D

The binder was totally broken for me in IE7 (shows nothing but hatswitch controls) but works great in Firefox 2.0.0.12, and the presets list helps a great deal.
CyberFoxZA
Just a tourist with a frag'd nav console
Just a tourist with a frag'd nav console
Posts: 3
Joined: Sat May 24, 2008 3:52 pm

Vegastrike Keyboard Bindings

Post by CyberFoxZA »

Ok Here we go.

I have made a keyboard layout using PhaethonH's keyboard binding software
It was done in MS Excel 2007 and can be modified to anyone's taste. If you use my template just mention my name somewhere in the small print.
Comments critiscism as well as suggestions will of course be welcomed.
Full instructions in the attached file.


CyberFox
You do not have the required permissions to view the files attached to this post.
loki1950
The Shepherd
Posts: 5841
Joined: Fri May 13, 2005 8:37 pm
Location: Ottawa
Contact:

Post by loki1950 »

Welcome CyberFoxZA thx this one was getting out of date :wink: any idea if OOo's Calc can work with this as Exel is a non starter on Linux.

Enjoy the Choice :)
my box::HP Envy i5-6400 @2Q70GHzx4 8 Gb ram/1 Tb(Win10 64)/3 Tb Mint 19.2/GTX745 4Gb acer S243HL K222HQL
Q8200/Asus P5QDLX/8 Gb ram/WD 2Tb 2-500 G HD/GF GT640 2Gb Mint 17.3 64 bit Win 10 32 bit acer and Lenovo ideapad 320-15ARB Win 10/Mint 19.2
CyberFoxZA
Just a tourist with a frag'd nav console
Just a tourist with a frag'd nav console
Posts: 3
Joined: Sat May 24, 2008 3:52 pm

Post by CyberFoxZA »

loki1950 wrote:Welcome CyberFoxZA thx this one was getting out of date :wink: any idea if OOo's Calc can work with this as Exel is a non starter on Linux.

Enjoy the Choice :)

Hi Loki1950

To be honest my knowledge of linux is absolutly zero. Only thing I can sugest
is to save it in pdf format. But not sure if that would help.

What format/s would be acceptable to linux users?

CyberFox
loki1950
The Shepherd
Posts: 5841
Joined: Fri May 13, 2005 8:37 pm
Location: Ottawa
Contact:

Post by loki1950 »

PDF would be fine or even an older exel format i haven't bothered upgrading past Office97 myself it does the job i what it to so why change :wink: that would also mean that linux types could open it with Open Office's Calc or the windows version of Calc for those with a M$ allergy :shock:

Enjoy the Choice :)
my box::HP Envy i5-6400 @2Q70GHzx4 8 Gb ram/1 Tb(Win10 64)/3 Tb Mint 19.2/GTX745 4Gb acer S243HL K222HQL
Q8200/Asus P5QDLX/8 Gb ram/WD 2Tb 2-500 G HD/GF GT640 2Gb Mint 17.3 64 bit Win 10 32 bit acer and Lenovo ideapad 320-15ARB Win 10/Mint 19.2
CyberFoxZA
Just a tourist with a frag'd nav console
Just a tourist with a frag'd nav console
Posts: 3
Joined: Sat May 24, 2008 3:52 pm

Post by CyberFoxZA »

loki1950 wrote:PDF would be fine or even an older exel format i haven't bothered upgrading past Office97 myself it does the job i what it to so why change :wink: that would also mean that linux types could open it with Open Office's Calc or the windows version of Calc for those with a M$ allergy :shock:

Enjoy the Choice :)
Thnx

I have included a Excel 97-2003 version in the .zip file
Let me know if it is fine and what u think of it.

Thnx
CyberFox
You do not have the required permissions to view the files attached to this post.
loki1950
The Shepherd
Posts: 5841
Joined: Fri May 13, 2005 8:37 pm
Location: Ottawa
Contact:

Post by loki1950 »

Thx now linux side and will give it a try brand shiny new fedora 9 install complete with firefox 3 beta 5 :D

Edit:That did the trick opens up with Calc with no problem 8) looks good

Enjoy the Choice :)
my box::HP Envy i5-6400 @2Q70GHzx4 8 Gb ram/1 Tb(Win10 64)/3 Tb Mint 19.2/GTX745 4Gb acer S243HL K222HQL
Q8200/Asus P5QDLX/8 Gb ram/WD 2Tb 2-500 G HD/GF GT640 2Gb Mint 17.3 64 bit Win 10 32 bit acer and Lenovo ideapad 320-15ARB Win 10/Mint 19.2
Keller
Merchant
Merchant
Posts: 50
Joined: Sat Jun 16, 2007 2:23 pm

Post by Keller »

I would advise not using FF v3 beta just yet, if you also use Firebug for debugging your JS scripts. FB chokes when running under FF v3 beta at present. I understand a fix is in the works from the FB people, but no deploy date just yet.
Nothing is uninteresting. ;)
loki1950
The Shepherd
Posts: 5841
Joined: Fri May 13, 2005 8:37 pm
Location: Ottawa
Contact:

Post by loki1950 »

No problem under f9 so far but i don't use firebug.rendering is not bad will be faster when i revert to Xorg 1.3 as the nvidia driver has problems with it and newer kernel versions.

Enjoy the Choice :)
my box::HP Envy i5-6400 @2Q70GHzx4 8 Gb ram/1 Tb(Win10 64)/3 Tb Mint 19.2/GTX745 4Gb acer S243HL K222HQL
Q8200/Asus P5QDLX/8 Gb ram/WD 2Tb 2-500 G HD/GF GT640 2Gb Mint 17.3 64 bit Win 10 32 bit acer and Lenovo ideapad 320-15ARB Win 10/Mint 19.2
johnnywas
Star Pilot
Star Pilot
Posts: 4
Joined: Thu Dec 28, 2006 1:47 am
Location: London

Re: Vegastrike Keyboard Bindings

Post by johnnywas »

CyberFoxZA wrote:Ok Here we go.

I have made a keyboard layout using PhaethonH's keyboard binding software
It was done in MS Excel 2007 and can be modified to anyone's taste. If you use my template just mention my name somewhere in the small print.
Comments critiscism as well as suggestions will of course be welcomed.
Full instructions in the attached file.


CyberFox
Thanks

Very neat

I'm trying to configure some of the strafe and roll commands so they are more similar to X3 Reunion and thsi will be very useful as I have an X3 Reunion Map in similar format
my box - 2.8GHz Pentium, 1 GB Ram running Windows XP, Version 0.5.0, rookie pilot
Post Reply