Binding Programs/Scripts to buttons, possible?

Posted by: tsaavik

Binding Programs/Scripts to buttons, possible? - 11/08/2003 14:22

How would i go about binding a button (say a button on my sony wired remote) to launch a script (such as ttsclock)?

I'm running the dev+hijack kernel, i just don't see a clear way to do this. Is there more documention for hijack somewhere? The FAQ is nice but seems to lack alot of technical details.

I searched hi and low, but all the posts talk about using ;@EXEC and that isn't really what i'm looking for, unless someone has a program that can monitor buttons and "steal" them from the player software?

---Confused
Posted by: tfabris

Re: Binding Programs/Scripts to buttons, possible? - 11/08/2003 15:03

So you want to press a button on your remote and have it launch a specific third-party app?

I don't think anyone's done that. Perhaps it's something that can be added to Hijack. Mark?
Posted by: mlord

Re: Binding Programs/Scripts to buttons, possible? - 11/08/2003 15:33

Launch an app, let it bind to the button(s) of interest, and then it can pop itself onto the display whenever such button(s) is pressed.

It's there. And, yes, we know there's a better way -- not implemented yet.

Cheers
Posted by: tfabris

Re: Binding Programs/Scripts to buttons, possible? - 11/08/2003 15:38

In other words, it must be coded into the app itself. Gotcha.

So Tsaavik, you need to see if that feature already exists in TTSclock, and request it if it's not.
Posted by: tsaavik

Re: Binding Programs/Scripts to buttons, possible? - 12/08/2003 08:35

Okay, that sounds reasonable. Maybe i can rip some code outta another app and make it work. I'll try to write it as a wrapper to ttsclock that way it can be used for other stuff. Can anyone recommend an app that has good source & licensing that would allow me to pick bits out and re-arrange them?

I imagine the tetris/pacman type games would work (gonna have to brush up on my C) wish someone had an app in perl, but thats prob not very likely

UPDATE: Just looked thru the viewer.c source by Jogn Heathco, looks pretty dang cool, i'm gonna have to read thru hijack.h

New question, can i bind a button with the app while hijack is running, or do i need to get out of hijack first?

John goes:
rc = ioctl( fd, EMPEG_HIJACK_WAITMENU, menu ); // Wait for menu..

Then when that works...

rc = ioctl( fd, EMPEG_HIJACK_BINDBUTTONS, buttons ); // Bind buttons
rc = ioctl( fd, EMPEG_HIJACK_SETGEOM, &fullscreen ); // Grab screen

Can i do the bind, then wait for my button to be pressed and do the screen grab? Or will the bind break hijack?
Posted by: Rafy

Re: Binding Programs/Scripts to buttons, possible? - 27/08/2003 06:35

any luck ? I'll give this a little bump for I think Program/Script Button Binding functionality is a MUST HAVE on the empeg...

can't wait to be able to press a button on the controler to play some wav file out of the blue ...
Posted by: Rafy

Re: Binding Programs/Scripts to buttons, possible? - 04/09/2003 08:01

bump
Posted by: tsaavik

Re: Binding Programs/Scripts to buttons, possible? - 30/09/2003 09:56

Sorry, i've been busy looking for a new job (my company is closing by year end).

I still plan on working on this though, just give me some more time
Posted by: drakino

Re: Binding Programs/Scripts to buttons, possible? - 30/09/2003 11:40

For the record, I did talk to Mark about this at the Ohio meet because I want a similar function, to run TTSClock from a popup menu. He seemed to indicate that it might be possible in the future, relating to having hijack be able to execute commands from input on the serial port. This in turn would then be accesable via /proc, thus a few more lines of code and buttons could be mapped to run programs.

Mark, am I remembering this right? I think Derrick might have heard this conversation as well...
Posted by: rtundo

Re: Binding Programs/Scripts to buttons, possible? - 30/09/2003 13:09

Related to this. It would be great if raw button codes could be read by Hijack's "Button Codes Display" function through the serial port from external devices.
Posted by: tsaavik

Re: Binding Programs/Scripts to buttons, possible? - 04/10/2003 15:17

well, i just tried it and didn't have much luck. It dosn't look like you can bind a button with an external app while player+hijack are running, or (more likely) i don't know how to do it. If anyone has any suggestion/tips/etc please let me know
Posted by: Dava

Re: Binding Programs/Scripts to buttons, possible? - 06/05/2004 05:01

Bump

If Mark could add functionality to the IRtranslate feature of Hijack so that:

[ir_translate]
b93452="/drive0/var/bashscript"

was acceptable, it would mean that we could
exec the script from a button and it should also work with the

http://player.ip/?button=b93452

commands from the web interface.

This would allow one to control which apps are executable from the web interface. The only issue that I can forsee is that the dummy button may wake the player if it is in standby.

What do you think Mark? Would this method be possible to implement and more importantly, of interest to you.
Posted by: SonicSnoop

Re: Binding Programs/Scripts to buttons, possible? - 09/05/2004 20:20

This would be a nice feature to have. Even tho the TTS doesnt work that great the idea of having a button to press and have it speak what menu or item it is on comes to mind, would come in very handy when riding in my vert with the top down on a bright day when i cant see the screen and trying to drive.
Posted by: Dava

Re: Binding Programs/Scripts to buttons, possible? - 11/05/2004 05:40

It seems like it would be useful for those trying to implement ODB II and GPS apps on the unit too. This would allow you to run the player app with max memory unless you wanted to do the other thing, better than having it always sitting in the background.