| |||||||
| Plugins Plugins developed and maintained by users. Want to create your own plugin? Start a thread in here. |
![]() |
| | Thread Tools | Display Modes |
| | #1 (permalink) |
| Portal Member Join Date: Jul 2006 Location: Lower Hutt
Posts: 156
Thanks: 1
Thanked 2 Times in 2 Posts
Country: | According to the Plugin tutorial, I can define strings for my GUI either by putting the text in the control's XML (<label>The string</label>), or by specifying a string Id within strings.xml (<label>73</label>). Are these the only options? Obviously, the former method means that translations won't be possible, and the latter means the user has to mess with their strings.xml(s) when installing the plugin; neither of these is really satisfactory... Likewise for keymap.xml - I want to override the default actions for some (most!) keys (only for my plugin, of course), but the only way I've found to make this work is for the user to manually cut-and-paste a section into keymap.xml for my plugin's GUI; again, this seems heavy-handed, and makes un/re-installing the plugin rather problematic. Also, each time the user upgrades or reinstalls MP, they will have to go through the same painful process again. It'd be nice if I could define <keys>...</keys> in the gui xml, and possibly have multiple <string></string> entries (one for each language, maybe defaulting to the first if the user-selected language is not found)... Or have I just missed the obvious, already present way to do these things? Given that my C# is fairly elementary so far this wouldn't surprise me... |
| | |
| | #2 (permalink) |
| Portal Designer | Well, for overwriting keys....I don't think you should overwrite them. Generally you would react to ACTIONS (which are caused by the user pressing whatever key, be it on the remote or keyboard, that the user has assigned to that ACTION. In the plugin you then intercept the ACTION (and not a keypress directly) and react accordingly. Lets say you wanted to do something when the user presses stop (which defaults to the 'b' button the keyboard, but the user can overwrite this in the configuration to whatever key he/she wants. The code would look something like this: Code: public override void OnAction(Action action)
{
switch (action.wID)
{
case Action.ActionType.ACTION_STOP:
// do whatever here
break;
default:
// let MP handle all other actions
base.OnAction(action);
break;
}
}
__________________ There are only two industries that refer to their customers as "users". - Edward Tufte |
| | |
| | #3 (permalink) |
| Portal Member Join Date: Jul 2006 Location: Lower Hutt
Posts: 156
Thanks: 1
Thanked 2 Times in 2 Posts
Country: | The thing is, I don't want the key to actually do anything except be a 'b' - the user is typing text into the plugin, and when the 'b' key is pressed I don't want the video to stop -I just want to get a 'b' so I can add it to the string. If I override the mapping in keymap to -1, this works perfectly (except the '!' still does the frame-rate etc)... |
| | |
![]() |
| Bookmarks |
| Tags |
| keys, plugin, strings |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| My Keys Plugin | mPod | Plugins | 69 | 2008-02-07 15:13 |
| How do I get a Plugin ID and strings.xml? | falkyre | Plugins | 6 | 2006-04-09 21:39 |
| How do I add strings to strings.xml? | CodeMonkey | Plugins | 3 | 2006-02-23 08:44 |
| Missing strings in the strings.xml file. | Anonymous | General Development (no feature request here!) | 5 | 2005-01-05 10:21 |