Scrappy
Posts: 2
Joined: Fri Jan 15, 2016 7:27 pm

Using a USB Keypad with Pi

Fri Jan 15, 2016 7:31 pm

So I am taking a class at college and my prof basically threw us a final project saying we have to learn how to use the Pi, make a noteworthy project, and have it all completed in a scary short amount of time.

I have never used the pi before, and actually, mine hasn't been delivered yet but I want to start asking questions now.

My project involves a USB keypad. I know there are non-usb ones I can wire to the breadboard, but I was wondering if it is possible for the pi to use a numeric USB keypad, like this one.
http://www.ebay.com/itm/USB-19-keys-Num ... xygPtSxfyd

Thanks!

Navyscourge
Posts: 258
Joined: Sat Oct 24, 2015 1:50 pm

Re: Using a USB Keypad with Pi

Fri Jan 15, 2016 10:12 pm

I cannot say for that keypad, but these things usually plug in like a keyboard; they work like a keyboard with a limited set of keys

User avatar
DougieLawson
Posts: 39121
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: Using a USB Keypad with Pi

Fri Jan 15, 2016 10:24 pm

It's a USB HID device, it should "just work".
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

Scrappy
Posts: 2
Joined: Fri Jan 15, 2016 7:27 pm

Re: Using a USB Keypad with Pi

Fri Jan 15, 2016 10:31 pm

Okay thanks for your replies guys. As for getting it to work, do I need to set up some drivers or code anything for input to work, or since it's a HID USB it literally will just work out of the box? If not, could you link some set up information? I do want to learn how to do this myself since its for a class, so please don't think I'm just asking for free code (: thanks!

User avatar
DougieLawson
Posts: 39121
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: Using a USB Keypad with Pi

Sat Jan 16, 2016 12:03 am

Plug in, start pressing buttons and numbers should appear. Nothing special needed.
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

sspross
Posts: 3
Joined: Sat Jan 30, 2016 11:27 am

Re: Using a USB Keypad with Pi

Sat Jan 30, 2016 11:30 am

I bought a hama 00053224 keypad[1] and I want to use it with my raspberry pi to easily enter digits. Is there a way to install or configure a driver for it on raspbian jessie?

If I just plug it in over USB and start typing, nothing happens on the command line.

[1] https://www.hama.com/00053224/hama-keypad

User avatar
rpdom
Posts: 17173
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: Using a USB Keypad with Pi

Sat Jan 30, 2016 12:41 pm

Plug it in. In a terminal, type lsusb (That's lower-case LSUSB) and post the output here. That will show what the device says it is and may help identify a driver.

sspross
Posts: 3
Joined: Sat Jan 30, 2016 11:27 am

Re: Using a USB Keypad with Pi

Sat Jan 30, 2016 1:02 pm

lsusb output (I have a Canon printer connected too):

Code: Select all

Bus 001 Device 004: ID 04a9:1772 Canon, Inc.
Bus 001 Device 008: ID 05a4:8003 Ortek Technology, Inc.
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp. SMSC9512/9514 Fast Ethernet Adapter
Bus 001 Device 002: ID 0424:9514 Standard Microsystems Corp.
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Its Bus 001 Device 008: ID 05a4:8003 Ortek Technology, Inc.

I also tried capturing input with python-evdev. I can see the keypad:

Code: Select all

>>> from evdev import InputDevice, list_devices
>>> devices = [InputDevice(fn) for fn in list_devices()]
>>> for dev in devices:
...  print(dev.fn, dev.name, dev.phys)
...
('/dev/input/event1', 'Keypad USB Keypad     ', 'usb-3f980000.usb-1.5/input1')
('/dev/input/event0', 'Keypad USB Keypad     ', 'usb-3f980000.usb-1.5/input0')
But nothing happens if I try to capture the input.

sspross
Posts: 3
Joined: Sat Jan 30, 2016 11:27 am

Re: Using a USB Keypad with Pi

Sun Jan 31, 2016 9:47 am

I think it has to do with the numlock settings, because I can see the same stuff as in http://unix.stackexchange.com/questions ... ian-wheezy

Does anyone know how I can change this? I tried editing /etc/kbd/config, uncommenting LEDS=+num. But it doesn't help.

EDIT: I've opened a question on stackexchange: http://raspberrypi.stackexchange.com/qu ... ian-jessie

Return to “Beginners”