User talk:MusicMonkey5555

From MythTV Official Wiki
Jump to: navigation, search

I wanted a bit better web keyboard to use on my phone (Palm Pre), so I started diving into the MythWeb Code and here is what I did in case anyone else wants to do the same or make it better.

NOTE: Everything I will be working with will be in /var/www/mythweb/ also anything I do could cause issues if you are not using the skin I made and are going to the phone page, also in order to get it to work I had to modify core code not just add a skin.

go to skins and copy and paste the folder called default and then rename it to phone. Then open skins/phone/remote.css scroll to the bottom and add:
/* Phone Controls*/ #remote_keysPhone table td { text-align: center; padding: 2px !important; } #remote_keysPhone table a { display: block; min-width: 12em; min-height: 2em; padding: .25em .5em; font-weight: bold; border: 1px solid; border-color: #CCC; color: #000; } #remote_keysPhone table a:hover { border: 1px solid; background-color: #999; text-decoration: none; border-color: #CCC; } #remote_keysPhone table a.pressed { border: 1px solid; background-color: #CCC; border-color: #CCC; } #remote_keysPhone table a.pressed:hover { background-color: #CCC; } #remote_keysPhone table a.noshift { } #remote_keysPhone table a.reqshift { } #remote_keysPhone table a.x-hidden { display: none; }
Next open modules/remote/init.php and on line 26 after #'play' => t('Play'), add:
'phone' => 'Phone',

Then open modules/remote/tmpl/default/ and add a file called phone.php and in it put this code:
<?php /** * List of quick keystrokes to send to a frontend /**/ ?> <script type="text/javascript"> <!-- // Send a key function send_key(key) { var r = new Ajax.Request('<?php echo root ?>remote/keys', { parameters: 'command='+key, asynchronous: false }); // Handle the response var results = r.transport.responseText.split("\n"); if (results[0].match(/^err:/)) { alert(results[0].substr(4)); return; } // Reset "shift" to off if (shift) handle_shift(); } // --> </script> <div id="remote_keysPhone"> <table width="266" height="291" border="0"> <tr> <td height="38" colspan="3" align="center" bgcolor="#FF0000"><p><a onclick="send_key('space')">Home</a></p></td> <td width="84" rowspan="2" align="center" bgcolor="#666666"><a onclick="send_key('enter')">Bookmark</a></td> </tr> <tr> <td width="55" align="center" bgcolor="#666666"><a onclick="send_key('pageup')"><?php echo t('Page Up') ?></a></td> <td width="48" align="center" bgcolor="#FFFFFF"><a onclick="send_key('up')"><?php echo t('Up') ?></a></td> <td width="61" align="center" bgcolor="#666666"><a onclick="send_key('pagedown')"><?php echo t('Page Down') ?></a></td> </tr> <tr> <td align="center" bgcolor="#FFFFFF"><a onclick="send_key('left')"> <?php echo t('Left') ?> </a></td> <td align="center" bgcolor="#FF0000"><a onclick="send_key('enter')"><?php echo t('Enter') ?></a></td> <td align="center" bgcolor="#FFFFFF"><a onclick="send_key('right')"><?php echo t('Right') ?></a></td> <td align="center" bgcolor="#666666"><a onclick="send_key('p')">Play/Pause</a></td> </tr> <tr> <td align="center"> </td> <td align="center" bgcolor="#FFFFFF"><a onclick="send_key('down')"> <?php echo t('Down') ?> </a></td> <td align="center"> </td> <td align="center" bgcolor="#FFFFFF"><a onclick="send_key('end')">Skip Ad</a></td> </tr> <tr> <td align="center" bgcolor="#FF0000"><a onclick="send_key('s')">Guide</a></td> <td align="center" bgcolor="#FFFFFF"><a onclick="send_key('i')">Info</a></td> <td align="center" bgcolor="#FF0000"><a onclick="send_key('m')">Menu</a></td> <td align="center" bgcolor="#FFFFFF"><a onclick="send_key('k')">Goto Bookmark</a></td> </tr> <tr> <td align="center" bgcolor="#FFFFFF"><a onclick="send_key('escape')"><?php echo t('Escape') ?></a></td> <td align="center" bgcolor="#FF0000"><a onclick="send_key('f1')">Help</a></td> <td align="center" bgcolor="#FFFFFF"> </td> <td align="center"> </td> </tr> <tr> <td align="center" bgcolor="#666666"><a onclick="send_key('1')">1</a></td> <td align="center" bgcolor="#666666"><a onclick="send_key('2')">2</a></td> <td align="center" bgcolor="#666666"><a onclick="send_key('3')">3</a></td> <td align="center"> </td> </tr> <tr> <td align="center" bgcolor="#666666"><a onclick="send_key('4')">4</a></td> <td align="center" bgcolor="#666666"><a onclick="send_key('5')">5</a></td> <td align="center" bgcolor="#666666"><a onclick="send_key('6')">6</a></td> <td align="center" bgcolor="#666666"><a onclick="send_key('|')">Mute</a></td> </tr> <tr> <td align="center" bgcolor="#666666"><a onclick="send_key('7')">7</a></td> <td align="center" bgcolor="#666666"><a onclick="send_key('8')">8</a></td> <td align="center" bgcolor="#666666"><a onclick="send_key('9')">9</a></td> <td align="center" bgcolor="#FFFFFF"><a onclick="send_key(']')">Vol +</a></td> </tr> <tr> <td align="center" bgcolor="#666666"><a onclick="send_key('/')">Favs</a></td> <td align="center" bgcolor="#666666"><a onclick="send_key('0')">0</a></td> <td align="center" bgcolor="#666666"><a onclick="send_key('%3F')">Set Fav</a></td> <td align="center" bgcolor="#FFFFFF"><a onclick="send_key('[')">Vol -</a></td> </tr> </table> </div>
The last thing is the home key brings you back to the main menu and uses the spacebar so you will need to go into your mythtv frontend and go to Utilities/Setup > Edit Keys > Jump Points and set Main menu to spacebar.

That should be it I will try and fill out more details about what everythings means but if you look through the code it is pretty self explanatory. I also may update this to add more buttons in the open spaces, I just added the ones I use the most.

Also I tried putting this in the <code> </code> tags but it didn't work well so sorry for the spacing issues. Suppose the true thing to do would be to link to a download off all the files. If I get time I will do that.