LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 03-01-2024, 08:19 AM   #1
ShaggyDog
LQ Newbie
 
Registered: Mar 2024
Posts: 4

Rep: Reputation: 0
Stopping input from a specific keyboard from propagating to UI


Hi, I'm new to Linux, this is my first time posting here. If I posted in the wrong subforum please let me know, I'll try to rectify this.

I'm trying to set up a kiosk machine. This is a PC with a touchscreen and no physical mouse or keyboard attached during normal operation.

Currently I'm working with Debian 12, but I plan to look around for a potentially more suitable distro. This is not set in stone yet.
The kiosk has two USB peripherals - an NFC card scanner and a QR code/bar code/MRZ scanner. As far as the OS is concerned, these behave like USB keyboards. When something is scanned, they send the keystrokes and the data gets written into whatever text box/editor window/console window has focus.

I was able to read the input from these devices programmatically by reading the following files:

/dev/input/by-id/usb-HOUSESMart_PROTOCOL-if01-event-kbd
/dev/input/by-id/usb-Newtologic_NT7730_XXXXXX-event-kbd

however this does not prevent the key strokes from also reaching the UI and getting typed in if a text box is focused. This isn't a huge problem for us, because our kiosk app doesn't have a text input on most screens. But on some screens it does. And if a user is typing into a text input field, and he scans something (say he has his phone in his other hand, and he accidentally moves it close to the NFC scanner and it gets scanned) the data will be written into the text box. I need to prevent this.

I need a way to prevent the events from those two "keyboards" from reaching the UI, but not disable them completely, so that I still get the data by reading those input files. Is there a way to do this?

The solution can be some code that is run every time our app starts, (Ideally something I can do in C#) or a system setting that is performed once during the machine setup. Either one is fine.

I also need to make sure I only limit those two keyboards. I don't want to limit all keyboards across the board, as there are situations where a keyboard will be used, whether virual or physical. The device id's don't seem to change no matter how many times I plug in and unplug them, so those can be relied on to identify the devices.

For completeness, our kiosk app is a .NET8 Blazor webapp, most likely to be accessed from a browser like Chrome. Or it may be hosted in a .NET MAUI container, if that's already supported on Linux. Point is it will be one specific app, and I have control over which one it will be, so if there is a way to say "Hey, don't send key strokes from this keyboard to this app", I can go that way too.
 
Old 03-06-2024, 03:57 AM   #2
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 22,101

Rep: Reputation: 7365Reputation: 7365Reputation: 7365Reputation: 7365Reputation: 7365Reputation: 7365Reputation: 7365Reputation: 7365Reputation: 7365Reputation: 7365Reputation: 7365
debian should be fine I think. What I can imagine you add a process which will continuously read those devices and save their data somewhere (in files or?) and it won't be sent to UI.
C# is not really suitable for this.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Bridged VLAN TAP adapter no propagating on bridge interface scheidel21 Linux - Networking 1 01-28-2016 12:34 PM
chown not propagating recursiverly while applying as root cilbuper Ubuntu 5 12-21-2014 03:02 PM
Repeated "input: AT Translated Set 2 keyboard as /class/input/input" messages AcerKev Mandriva 2 09-16-2007 08:35 AM
Permissions propagating to subfolders & files linus Linux - General 2 06-21-2007 12:58 PM
sendmail: propagating plus extension in aliases Berhanie Linux - General 0 10-09-2005 01:09 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 05:17 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration