INTERACT FORUM

More => Old Versions => JRiver Media Center 26 for Windows => Topic started by: MaxA on March 26, 2020, 05:54:26 pm

Title: What does that means TranslateFlags="17" in Resource.xml?
Post by: MaxA on March 26, 2020, 05:54:26 pm
Hi,

Can you explain what does attributies TranslateFlags, NoShowAsShortcut and Param="2" means?

<Entry Key="Up" Command="10018" Param="2" TranslateFlags="13" NoShowAsShortcut="1" />

Thanks, Max
Title: Re: What does that means TranslateFlags="17" in Resource.xml?
Post by: RoderickGI on March 27, 2020, 01:24:50 am
It is all explained inside the Resource.xml file in green writing, although it is a little criptic.

Key="Up" is pretty obvious. It means this line applies to pressing the Up keyboard key.

Command="10018" is the MC Core Command that is to be issued when the Up key is pressed. In this case, "Volume Up". Reference https://wiki.jriver.com/index.php/Media_Center_Core_Commands

Param="2" refers to the parameter to be passed to the MCC (Media Centre Core Command) and is defined as "int nDeltaPercent", which I believe means "Integer Change in volume to apply in Percentage". So you should see a 2% increase in volume when you press the Up key, with this Hotkey.

TranslateFlags="13" defines when this Hotkey will be used. It is a compound number (for want of a better term), in that it is a number that can only be summed to in one way from the table in the Resource.xml file. That table is:
  TranslateFlags: flags that determine when and how an accelerator is translated (binary or'd together)
    1: don't translate in edits, comboboxes, and other data entry controls
    2: don't translate in fullscreen mode or theater view
    4: don't translate in any type of popup window
    8: only translate in fullscreen
    16: don't translate in IE, VB controls, or other unknown rich controls
    32: targets playback engine / display (DVD, image playback, etc.)
    64: only translate when Action Window is focused
    128: not in Theater View
    256: not in report controls
    512: not in web browser
    1024: not in video player
So "13" can only be summed from the above table by adding 8+4+1=13, which means that the Hotkey will not apply in edits, comboboxes, and other data entry controls, or in popup windows, and will only apply in fullscreen mode.

NoShowAsShortcut="1" is pretty obvious, and explained best by the text in the Resource.xml file:
"NoShowAsShortcut: 1 if you don't want MC to show this shortcut in menus, tooltips, etc."


Note that if a Hotkey is defined more than once in the Resource.xml file, I believe it is the last definition that gets used by MC. However, the same Hotkey can be defined multiple times and work differently in different areas of MC, as defined by the TranslateFlags setting.