Author Topic: How to enter numbers?  (Read 3716 times)

0 Members and 1 Guest are viewing this topic.

LightsOn

  • Jr. Member
  • **
  • Posts: 18
  • Karma: 4
    • View Profile
How to enter numbers?
« on: March 14, 2017, 09:22:46 AM »
Hi All,

I hope someone can point me in the right direction if possible.  I want to be able to say “Go to channel” and then speak a number.  I want for the action to be the same as when I enter numbers on the PVR TV guide interface with my remote control.  Thus numbers are entered and the guide jumps to that point.

I wish to do it this way and not with a payload as the channel ID’s by name work great already but by number they are different to what I have / want in Kodi.

Any suggestion on how I can do this? Thank you in advance.

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: How to enter numbers?
« Reply #1 on: March 14, 2017, 10:24:07 AM »
It's a bit difficult for us because we do not have access to a PVR in Kodi but I will try to help.

1 - Are you able to enter the channel numbers on your regular PC keyboard in order to navigate the guide, and do you then need to press enter to select that channel?

2 - What is the range of valid channel numbers on your system?

3 - Do you want to play the channel right away or just highlight / select it?

When answering, please keep in mind that we have never used any of the PVR / live channel features in Kodi so assume that we know nothing and try to provide as much information as possible.

LightsOn

  • Jr. Member
  • **
  • Posts: 18
  • Karma: 4
    • View Profile
Re: How to enter numbers?
« Reply #2 on: March 14, 2017, 10:44:15 AM »
1 - Are you able to enter the channel numbers on your regular PC keyboard in order to navigate the guide, and do you then need to press enter to select that channel?
A: when on the TV guide if I simply press a number on a numpad, keyboard, or the remote, a box pops up and the numbers are entered into it. Once enter is pressed the box disappears and that channel number selected is moved to.

2 - What is the range of valid channel numbers on your system?
A: I simply need 0 > 9 as you would have on a keyboard so I could call any combination of numbers such as “got to channel 1 0 2” for example.

3 - Do you want to play the channel right away or just highlight / select it?
A: I simply just seek to be able to emulate entering numbers.  I tried using XJson.Btn.KB but this does not do sole numbers, it is like a multi tap.  Also I did not know how to make it so it knew what to send as I assume many if statements would be required?

I hope this helps somewhat and thank you for trying to help me out – I appreciate it.

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: How to enter numbers?
« Reply #3 on: March 14, 2017, 10:58:28 AM »
This method uses keyboard emulation and will probably work the way you expect as long as VoxCommando is running on the same computer as Kodi.

If not sure what to do with the code below see:
http://voxcommando.com/mediawiki/index.php?title=XML_on_the_forum

Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 2.2.3.5-->
<command id="866" name="Go to channel" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="" loopMax="" description="">
  <action>
    <cmdType>SendKeys</cmdType>
    <params>
      <param>{1}</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <phrase>Go to channel</phrase>
  <payloadDictation>payloadDictation: Spelling</payloadDictation>
</command>

LightsOn

  • Jr. Member
  • **
  • Posts: 18
  • Karma: 4
    • View Profile
Re: How to enter numbers?
« Reply #4 on: March 14, 2017, 12:04:49 PM »
Brilliant - exactly what i wanted - thank you  :)

I tried adding another action with send key {ENTER} so the selection would be selected afterwards but this does not seem to work - i think there needs to be a little delay - is that possible?

Thank you again.

LightsOn

  • Jr. Member
  • **
  • Posts: 18
  • Karma: 4
    • View Profile
Re: How to enter numbers?
« Reply #5 on: March 14, 2017, 12:18:33 PM »
Okay found solution.  Added a 1 second pause with VC.pause then used XJson.Btn.KB 'enter' - all works like a charm.

Thanks again.

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: How to enter numbers?
« Reply #6 on: March 14, 2017, 12:19:40 PM »
It's possible.  I have no way to test it myself.

http://voxcommando.com/mediawiki/index.php?title=Actions#Pause

If your command is not working I recommend you post the XML for your command here so we can check it.

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: How to enter numbers?
« Reply #7 on: March 14, 2017, 01:21:34 PM »
Okay found solution.  Added a 1 second pause with VC.pause then used XJson.Btn.KB 'enter' - all works like a charm.

Thanks again.

You could probably get away with much less than a full second pause.

LightsOn

  • Jr. Member
  • **
  • Posts: 18
  • Karma: 4
    • View Profile
Re: How to enter numbers?
« Reply #8 on: March 15, 2017, 06:15:11 AM »
I think I could too, but it does allow me to briefly see the number entered so in fact it works really well for me as it is. 

Thank you again for such quick and helpful replies.

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: How to enter numbers?
« Reply #9 on: March 15, 2017, 08:29:33 AM »
You're welcome, and welcome to the community.  ^-^