Anyone have any experience with this?
I want to hook up PC to a TV, have a simple webpage on it with a 10-foot style user interface, and navigate the page mainly using the up/down/left/right/OK buttons on the remote. HDMI-CEC can allow my TV remote to communicate with a computer, e.g. a Raspberry Pi with LibreELEC on it. But I want to try a desktop OS with a web browser open.
I looked at the tabindex attribute. That allows you to tab and shift-tab forward and back through a series of elements and use the :focus pseudo-class to style the "selected" one, but it isn't going to allow up/down on a grid.
Worst case scenario, I use event listeners and do whatever I need to do to highlight the correct elements using arrow keys, such as detecting and comparing the x/y positions of all the elements to choose which one to jump to. Even then I might have to find a way to override the default behavior of the TV remote to make sure it can replace the keyboard input. I was wondering if there were any standards related to handling TV remote input, but I didn't see any.
(Score: 3, Interesting) by RS3 on Friday March 03, @05:38PM (12 children)
I haven't done this, but I've worked at companies where they mostly emulated a remote control, better stated, wrote software that outputted pulsetrains into an IR LED to control various audio, video, etc. things. From what I remember there was no standard at the time, and not even between similar devices, not even from one thing to another of a particular brand. Sometimes a particular model would be dropped by a manufacturer, and the replacement model would use different IR codes. Sigh.
Anyway, very brief websearch turns up lots of products and projects. Here's one of the first ones I saw: https://fanshop.ocinside.de [ocinside.de] and https://www.ocinside.de/modding_en/usb_ir_receiver/ [ocinside.de]
This looks awesome: https://www.instructables.com/DIY-USB-IR-receiver/ [instructables.com]
Another: https://www.pishop.us/product/flirc-rpi-usb-xbmc-ir-remote-receiver/ [pishop.us]
(Score: 3, Interesting) by RS3 on Friday March 03, @05:50PM (11 children)
It seemed obvious, but in case it's not, some reverse-engineering might be needed to capture your remote's IR pulse trains, and then the software (case statement) will output the proper key codes (emulate a USB keyboard).
Also, there are already nice remote controls that do exactly what you want, but maybe you have a good reason to use an existing TV remote control? The ones I'm referring to are mostly used by people doing presentation using a computer and projector, and maybe PowerPoint or some similar presentation / slideshow software. The devices are optimized for the task, and often have some optional modes. One I had had a stupid button that would do something stupid- I forget now, but it might have sent Alt-F4 (close program) or something similarly stupid such that the person talking in front of a crowd would interrupt their own slideshow and they or someone (like me) would have to fix it. I almost disassembled it and removed the button, but IIRC it was someone else's.
The one I have is an "SIIG", but it's 2.4GHz, not IR. I don't even know if SIIG are still around...
(Score: 3, Interesting) by Freeman on Friday March 03, @06:00PM (6 children)
I have a different problem. My dad got some random media player off amazon. He thought it was an MP3 player, but never returned it. He eventually just gave the thing to me, without a remote. Which makes the thing a paperweight, because the "universal remote" that I have was never able to do anything with the device.
I believe this is the exact thing: https://www.amazon.com/AGPtEK-1080P-Digital-Media-Player/dp/B00MVRC9AO [amazon.com]
I'm at a loss as to what to do to turn it into, not a paperweight. The thing seems to function properly, but with no external controls and no remote. I'm up the creek without a paddle.
Joshua 1:9 "Be strong and of a good courage; be not afraid, neither be thou dismayed: for the Lord thy God is with thee"
(Score: 3, Interesting) by RS3 on Friday March 03, @07:29PM
I was going to ask which creek, but restraint of wisdom stopped me. :)
That said, it looks like it'd make a great paddle if you attach a handle. :)
Do you have a table or chair that wobbles and needs a thick shim? :)
Sorry, nobody is entertaining me today so I had to do it myself.
But seriously, in some cases like yours the simplest / cheapest thing is to try to find a remote on ebay or poshmark or wherever. You might even be able to find the part number for the remote.
My initial reaction was to employ "fuzzing", but that could take forever. You know, where you build something that starts sending every possible sequence of pulses, but you don't know how long the pulse train needs to be, the speed (frequency), etc. So, back to trying to buy a remote for it...
(Score: 2) by janrinok on Saturday March 04, @08:15AM
I suspect that you have already tried this, but just in case you haven't, you should be able to get a 'replacement' remote control from here:
https://www.amazon.com/stores/page/57A3591C-BA47-4208-BA0A-8DE3056FC858?ingress=0&visitId=9cc10526-07c5-453e-bab6-35967a3dcc56 [amazon.com]
They appear to have made the original device or at least marketed it. I might be worth a quick email enquiry.
(Score: 0) by Anonymous Coward on Saturday March 04, @11:56PM
https://www.ebay.co.uk/itm/165890720218?epid=28014727719 [ebay.co.uk]
It's the B model, but if the remote works you could copy it and then put one of them back on ebay.
(Score: 2) by takyon on Sunday March 05, @01:34AM (2 children)
Did you try plugging a USB keyboard, mouse, or hub + both into the USB port?
[SIG] 10/28/2017: Soylent Upgrade v14 [soylentnews.org]
(Score: 2) by Freeman on Monday March 06, @04:54PM (1 child)
Not sure I have, but it's definitely worth a shot.
Joshua 1:9 "Be strong and of a good courage; be not afraid, neither be thou dismayed: for the Lord thy God is with thee"
(Score: 2) by takyon on Monday March 06, @06:02PM
Most of the Chinesium media boxes use Android. I think there's a high chance of this working.
I'd try hooking up a keyboard first and using the arrow keys, enter, backspace, and escape to move around.
Later see if you can get to a Bluetooth menu to connect a Bluetooth mouse or console-style controller if you don't want to try a USB hub.
The USB port could also be your ticket to wiping and replacing the OS.
[SIG] 10/28/2017: Soylent Upgrade v14 [soylentnews.org]
(Score: 2) by takyon on Friday March 03, @07:11PM (3 children)
I can control a LibreELEC (Kodi) installation on a PC using the TV's remote. HDMI-CEC [wikipedia.org] allows the input from the remote to work on a PC connected by HDMI, or even other devices (for example, a TV remote can be used to control an Amazon Fire TV stick instead of the remote it comes with).
[SIG] 10/28/2017: Soylent Upgrade v14 [soylentnews.org]
(Score: 3, Informative) by NotSanguine on Friday March 03, @08:43PM
I use an Inteset remote [amazon.com] to control my Mythtv frontend among other things.
What I'd suggest is to use ir-keytable [mankier.com] (rc_keymap [mankier.com]) to map the remote control buttons to the browser commands.
This works well for Mythtv (you can set buttons to execute arbitrary functions). Perhaps that could help?
No, no, you're not thinking; you're just being logical. --Niels Bohr
(Score: 1, Informative) by Anonymous Coward on Saturday March 04, @02:27AM
If Kodi works, then any Linux distribution should work. Make sure you have the right devices and drivers set up (zcat /proc/config.gz | grep -i CEC). I believe Raspberry Pis have support already compiled in. If you are connected to a supporting TV, you should see it in the ring buffer. Adding in a CEC library will allow you to do two-way communication. Then, you need a keymap and something to respond to them to execute received commands and a CEC client to send commands to the TV. Now if I were you, I would not have the browser receive the commands in the way you suggest.
Instead, I would use one of three approaches. The first is using browser automation software to receive them. That can tell the browser what to do using a webdriver. While writing the software, if you find virtual mice easier, you can have the browser draw a virtual mouse and x/y coordinates to show you how it is moving; for production, you can turn those assists off and just use the UI hints for where the mouse is pointing. Otherwise, you can use a number of techniques to set focus or move around the browser using a driver.
The second main technique that could work depending on what you are envisioning is to use Server Sent Events. Your map sends commands to the parent backend, which runs the frontend in a browser as a child to your UI web page. The JS on the page opens a connection to an SSE endpoint. As your backend gets commands from the IR keymap, it sends events to the front that manipulates the UI.
The third main technique is to put the browser as receiving commands. You can use the KeyboardEvent to handle the input directly. That way you can avoid having to TAB around the UI and have more control on the interface. The JS can set focus or do whatever else you want. Which you choose is whatever approach, languages, and architecture you are more comfortable with as well as what your stack is already doing.
(Score: 1, Informative) by Anonymous Coward on Saturday March 04, @05:06PM
I know nothing about CEC limitations, an IR capture device and https://lirc.org/ [lirc.org] would let you map IR input to whatever X11 events you like.
(Score: 2) by NotSanguine on Friday March 03, @08:58PM
to do something similar with a fanless PC connected to my receiver, so i can run Podgrab [osradar.com] and other web-based stuff, but I haven't been motivated enough to mess with it.
I'd be interested to hear how (and how it was done) it goes for you, as it may help motivate me. Thanks!
No, no, you're not thinking; you're just being logical. --Niels Bohr
(Score: -1, Offtopic) by Anonymous Coward on Saturday March 04, @07:22AM
Takyon always splays his particles when there is Right wing counter particles in the vicinity. Runaway has gone off the runway with his assertion that pro-2nd Amendment actually encourages pedophilia. Not surprised, since the boy is from Arkanasas, the state with the highest, or near the highest, percentage of pedophiles. Not to mention, Josh Dugger. Christians, did I mention Josh Dugger? Runaway is along the same lines. Possum eating, squirrel-killing, cabbage-growing Arkansas dirt farmer and pedophile. Look it up. All Soylentils should have enough information to query the Arkansas State database for perverts. Not going to say what might turn up, but there is a reason Runaway is so concerned about cross-dressers, especially ones that might have been in the US Navy? General Mess Talent Show? Starring Ms. Arkansas? Some never recover from their time in the Navy. Thank you for your alleged service, Runaway!
(Score: 3, Interesting) by RamiK on Saturday March 04, @09:40AM (1 child)
They typically have a full sized keyboard with some coming with gyros for the mouse while others coming with a touchpad. Random first hits examples:
https://www.aliexpress.com/item/1005005260648640.html [aliexpress.com]
https://www.aliexpress.com/item/1005005266947728.html [aliexpress.com]
Note that even that is pushing it so be sure to look up "air mouse review" and such on youtube to get and idea of what it's like on android tv and keep in mind those interfaces are made for the job but they still suck.
compiling...
(Score: 2) by RamiK on Saturday March 04, @09:43AM
Here, this should give you a clue on what to expect: https://www.youtube.com/watch?v=-ket7x8hjVo [youtube.com]
compiling...
(Score: 1) by shrewdsheep on Saturday March 04, @05:43PM
Use something like this: https://www.amazon.com/Rii-Bluetooth-Keyboard-Smartphones-Mac-Black/dp/B07T13GLY3/ref=sr_1_21?crid=25IOH9YAK73BY&keywords=small+keyboard&qid=1677951307&sprefix=smal+keyboard%2Caps%2C173&sr=8-21 [amazon.com]
Also forget LibreELEC et al. Use a standard Linux distro with autologin and autostart of Kodi. For webrowsing, exit Kodi, fire up the browser and be happy with the mini keyboard. Your remote should go to recycled e-waste.
It's a hobby maker project, i hear? Well, then use a RPi/Pico for IR sensing, write a server that translates presses into Web-commands on the PC using Selenium. Don't forget to encode more complex commands into a type of morse code entered on the remote and test the family for memorizing it every morning (also helps against Alzheimer's).