Hi,
The cubieboard has an IR receiver but do not come with a IR remote,
one friend of me in China asked if he can control his cubieboard with
unused key on the TV remote, then he can use one remote to control
both TV and the board.
First i found that the IR driver has some ir code check in
https://github.com/linux-sunxi/linux-sunxi/blob/sunxi-3.0/drivers/input/keyboard/sun4i-ir.c#L459
After disabling the ir code check, i can get event from two ir remote
here i have. To test if your remote can be recognized, you can try the
following:
connect your board via mini usb cable
adb pull drivers/input/keyboard/sun4i-ir.ko sun4i-ir.ko.bak
adb shell mount -o remount,rw /system
wget
http://tom.linux-sunxi.org/cubieboard/sun4i-ir.ko #built with
IR_CHECK_ADDR_CODE undefined.
adb push sun4i-ir.ko /system/vendor/modules/
adb reboot
then you can test the remote with android getevent
adb shell
root@android:/ #
root@android:/ #
root@android:/ # getevent
add device 1: /dev/input/event4
name: "sun4i-ir"
add device 2: /dev/input/event3
name: "HID 1220:0008"
could not get driver version for /dev/input/mouse0, Not a typewriter
add device 3: /dev/input/event2
name: "HID 1220:0008"
add device 4: /dev/input/event0
name: "sun4i-keyboard"
could not get driver version for /dev/input/mice, Not a typewriter
add device 5: /dev/input/event1
name: "axp20-supplyer"
Now press the remote, if the remote can be recognized, there will be
something like,
/dev/input/event4: 0001 000c 00000001
/dev/input/event4: 0000 0000 00000000
/dev/input/event4: 0001 000c 00000002
/dev/input/event4: 0000 0000 00000001
/dev/input/event4: 0001 000c 00000000
/dev/input/event4: 0000 0000 00000000
000c is the code of the key pressed.
Now you can define this key's function in android.
adb pull /system/usr/keylayout/sun4i-ir.kl
edit sun4i-ir.kl you will see something like:
key 79 BACK WAKE_DROPPED
You can assign the function of key you just pressed to anything you
like, but notice that getevent shows the code in HEX, but sun4i-ir.kl
is decimal.
This may solve the volume key worry and the zoom and pinch problem
reported in the g+ community.
--
Keep simple, stay foolish.