INTERACT FORUM

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: Custom hot keys get caught when editing text  (Read 1758 times)

boomclack

  • Recent member
  • *
  • Posts: 5
Custom hot keys get caught when editing text
« on: August 12, 2015, 09:17:46 am »

Hi

I've assigned some custom hotkeys (without modifiers), only to discover that they get caught when editing a text-field.

For example I assigned spacebar to play/pause - and when editing a text-field, pressing spacebar still acts as a short cut, not even giving me a space!

How can I avoid this wihtout using modifiers for my short cuts?

Logged

blgentry

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 8014
Re: Custom hot keys get caught when editing text
« Reply #1 on: August 12, 2015, 09:36:48 am »

You need to add Translate Flags to tell it where to use the shortcuts and where to ignore them.  There's a table in the Resource.xml file that tells you what each flag controls.  I've been using 21 as my TranslateFlags for Spacebar (as Play/Pause) and it seems to work perfectly for me.  Like this:

Code: [Select]
<Entry Key="Space" Command="10000" Param="0" TranslateFlags="21" />
Test it out and see how it works for you.

Brian.

Logged

boomclack

  • Recent member
  • *
  • Posts: 5
Re: Custom hot keys get caught when editing text
« Reply #2 on: August 12, 2015, 09:45:24 am »

You need to add Translate Flags to tell it where to use the shortcuts and where to ignore them.  There's a table in the Resource.xml file that tells you what each flag controls.  I've been using 21 as my TranslateFlags for Spacebar (as Play/Pause) and it seems to work perfectly for me.  Like this:

Code: [Select]
<Entry Key="Space" Command="10000" Param="0" TranslateFlags="21" />
Test it out and see how it works for you.

Brian.


Thanks Brian - exactly what I was looking for.

My follow-up question is then how to combine flags?
The documentation in the default custom resources file says "binary or'd together" ... so together means without delimiters?
So combining e.g. flags 1 and 4 would simply be 14?

Your own flag - 21 - is 1 and 2 combined?
Logged

blgentry

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 8014
Re: Custom hot keys get caught when editing text
« Reply #3 on: August 12, 2015, 09:52:17 am »

Shortest answer:  Add the flags together you want to use.

"Binary OR'ed" might not be the easiest thing to understand.  Notice the values are all powers of 2.  They are each one binary digit in a binary word.  Well, they are the decimal representation of one binary digit.  So they want you to "turn on the digit" for each flag you want to use.

In decimal that means simply adding them together.  So my flags of 21 look like:

0010101 in binary.

Which means I'm using flags 1, 4, and 16 as 1 + 4 + 16 = 21  .

I hope that makes some sort of sense.  :)

Brian.
Logged

boomclack

  • Recent member
  • *
  • Posts: 5
Re: Custom hot keys get caught when editing text
« Reply #4 on: August 12, 2015, 10:07:36 am »

Thanks again...

I think the documentation is extremely lacking regarding this topic.
Even though I do a lot of PHP programming, this really had me puzzled.

I think the MediaCenter team should use some resources on properly documenting the program.
ALso, if this application is targeted for the mainstream user (which seems to be the case), then having to edit a xml file is a no-go.

Anyway, thanks for clarifying ...  :)
Logged
Pages: [1]   Go Up