Bug Numeric keypad problem (solved)
#1
I have version 14.1 38e4046.
When the Numeric Dialog is presented, keystrokes from the numeric keypad of a keyboard are ignored. Keystrokes from the numbers across the top of the keyboard are accepted.
This is important to me as I have an "Ortek" remote and that sends numbers as if they came from the numeric keypad.
I have the same version of Kodi (38e4046) running on Ubuntu and there the numeric keyboard works fine.
I ran debug logging and looked at the code.
The root cause seems to be that the numeric keypad is returning unicode 0 instead of the correct value. This can be seen in the debug output (for keypad 2 pressed):
13:45:49 T:1961250816 DEBUG: Keyboard: scancode: 0x50, sym: 0x0102, unicode: 0x0000, modifier: 0x0
For some reason this works differently in Raspberry Pi Raspbian from how it works in Ubuntu.
I am considering making a code patch to check for keystrokes in the keypad range with zero unicode value and force the correct unicode value. (In CKeyboardStat:TonguerocessKeyDown).
Does anybody have any other insight into this problem?

Peter
Reply
#2
Have you tried checking the keyboard.xml for the two installations with different behaviour.
I ask because there were queries a while back about the numeric keys on the ordinary keyboard, as a result of which new entries were defined specifically for those keys.
Suggested mods to correct the deficiency were:
Code:
Additions to map the Keyboard numeric pad keys:

<keymap>
  <global>
    <keyboard>
      <!-- these keys come from XBMC_keytable.cpp -->
      <numpadzero>Number0</numpadzero>
      <numpadone>Number1</numpadone>
      <numpadtwo>Number2</numpadtwo>
      <numpadthree>Number3</numpadthree>
      <numpadfour>Number4</numpadfour>
      <numpadfive>Number5</numpadfive>
      <numpadsix>Number6</numpadsix>
      <numpadseven>Number7</numpadseven>
      <numpadeight>Number8</numpadeight>
      <numpadnine>Number9</numpadnine>
      <!-- here's the remaining keys.  enter and forward slash are the same as the standard keyboard.  mapped below they do nothing so map them however you like -->
      <numpaddivide>noop</numpaddivide>
      <numpadtimes>noop</numpadtimes>
      <numpadminus>noop</numpadminus>
      <numpadplus>noop</numpadplus>
      <numpadperiod>noop</numpadperiod>
    </keyboard>
  </global>
</keymap>
Derek
Reply
#3
"Have you tried checking the keyboard.xml for the two installations with different behaviour."
Yes that is the first thing I tried.
The keyboard.xml already has the numpad defined as <numpadzero>Number0</numpadzero> for 0 to 9. I tried explicitly setting those also in the section <NumericInput> </NumericInput>, but that had no effect. I found that no matter what I set for the keys in Keyboard.xml it was ignored. Then I looked at the source code and I found that while it is in the numeric dialog or virtual keyboard dialog it bypasses key translation and only uses the actual value of the keys. I assume that is so that when you are in a dialog or virtual keyboard you may want to type actual words and will be rather frustrated if your "p" comes out as "Play", your "f" comes out as "Fastforward" and so on.

Peter
Reply
#4
My only further input is:
1) I'm unsure what the Numeric Dialog is
2) Ortek remote is discussed in this thread
3) Possibly your trouble comes from your Raspbian+Kodi, and may not occur in the specialised RPi distros?
HTH
Derek
Reply
#5
There are some instructions here for setting the right permission on input devices when using raspbian.
Reply
#6
(2015-04-11, 10:22)dandnsmith Wrote: My only further input is:
1) I'm unsure what the Numeric Dialog is
2) Ortek remote is discussed in this thread
3) Possibly your trouble comes from your Raspbian+Kodi, and may not occur in the specialised RPi distros?
HTH

The numeric dialog appears when you are in the channel list for tv or watching live tv and you start entering a number. A dialog comes up to let you finish typing in the channel number. What I see is the first digit that I typed and nothing more is accepted from the numeric keypad, although numbers from the top row are accepted.
The problem is specific to raspberry pi and kodi. I tried the same version of kodi on ubuntu and the problem does not happen there.
Sinmce it happens on the numeric kepad of a normal keyboard, it is not something specific to the Ortek remote.
Anyway I will try patching the program.
Reply
#7
Thanks for the added info, and good luck with the patching.
I don't have a TV input, which explains why I don't see that dialogue.
I wasn't entirely sure whether you'd tried a 'normal' keyboard with the RPi setup - but it appears you have.
Derek
Reply
#8
Add this line to /etc/init.d/rc.local
Code:
chmod 0777 /dev/tty0
Reply
#9
(2015-04-12, 11:41)cpcbegin Wrote: Add this line to /etc/init.d/rc.local
Code:
chmod 0777 /dev/tty0

Thanks for the suggestion. I tried it but it makes no difference.
Reply
#10
I have my patch and it is working on my two raspberry pi's. It is a workaround. I do not know the ultimate cause of the failure of kodi to receive the unicode values for the numeric keypad, but this resolves it by pushing in the correct values.

Code:
--- a/xbmc/input/KeyboardStat.cpp
+++ b/xbmc/input/KeyboardStat.cpp
@@ -86,6 +86,12 @@
   if (keysym.mod & XBMCKMOD_META)
     modifiers |= CKey::MODIFIER_META;

+// PB - Handle num keypad in Raspi
+  if (keysym.sym >= XBMCK_KP0 && keysym.sym <= XBMCK_KP9
+      && keysym.unicode == 0) {
+    keysym.unicode = 0x0030 + (int) keysym.sym - (int) XBMCK_KP0;
+  }
+
   CLog::Log(LOGDEBUG, "Keyboard: scancode: 0x%02x, sym: 0x%04x, unicode: 0x%04x, modifier: 0x%x", keysym.scancode, keysym.sym, keysym.unicode, keysym.mod);

   // The keysym.unicode is usually valid, even if it is zero. A zero
Reply
#11
im having the exact issue as the OP, what i dont understand is what he did to fix the issue, on my remote when i hit a number i get the number pad and the last digit i pressed so if i go to enter 25 i see the number pad pop up and i see a 2.. until i hit the 5 then i see just the five on the number pad.
Main System - HTPC - Intel I3 6300 - Asrock z170 - 16 GB DDR4 - 128gb SSD - 65" UHD HDR Sony Android TV - Pioneer VSX 1130-K - 7.2.2 speakers
Other devices currently in use - 55" 3D UHD LG TV - 2 Fire TV's - Nexus Player - MiniMX s905 - Voyo Vmac Mini
Ubuntu Server - 12 TB NAS - MYSQL - Torrent Box
Reply



Logout Mark Read Team Forum Stats Members Help
Numeric keypad problem (solved)0
This forum uses Lukasz Tkacz MyBB addons.