Sponsored Content
Top Forums Programming Read 1 of 2 keyboards connected Post 302980896 by bakunin on Sunday 4th of September 2016 05:22:42 PM
Old 09-04-2016
Quote:
Originally Posted by SerKan
2 usb keyboards connected to a normal x86
One keyboard working as usual in xorg, but I need that the other one doesn't send anything to xorg but instead I want to process its keystrokes with some kind of background process.
First a bit of theory: you communicate with a UNIX system by using a "tty": a "terminal" consisting of a keyboard and a screen, usually connected via a serial line.

If you connect to a UNIX system over a network you use a so-called "terminal emulator program" (many times "xterm", but that is not the only one) to emulate such a terminal and its serial connection is emulated via the network connection.

There is a special form of a tty, which is called console. This is not connected via the standard serial line but directly attached to the computer. Perhaps the local screen attached to your VGA-card and the (first) keyboard form this console.

Now, after that much theory, to your specific question: this might work, but not necessarily with a USB-attached keyboard and definitely not with a background process. Background processes are part of a process hierarchy, headed by some foreground process: this is usually the shell from which you initiated the background process, typically by issuing the command:

Code:
$ /path/to/command -someoptions &

Since the shell you typed that in was already connected to some tty (the one which keyboard you used to type it, probably the console) the background process inherited this connection. You can cut it off from this (by using the nohup command) but per default itis attached to the one you used to call it. Furthermore, a single USB-attached keyboard is not a terminal.

I hope this helps.

bakunin
This User Gave Thanks to bakunin For This Post:
 

10 More Discussions You Might Find Interesting

1. AIX

How can I get Information about who is connected???

Hello, I'm new here and I come from Germany. At our AIX-ORACLE-System someone has deleted one important file and we'd like to find out who did this, next time. Is there any command to find out who is connected? I'm not trying to find out if it's root, etc., I'd like to get the DNS-Name or... (3 Replies)
Discussion started by: Huch
3 Replies

2. Programming

Connected or not connected !

Hello ! I've got a question . I really don't het this point. Let's supose that I have a client connected to a server. I want the server IMEDIATLY know if the client is diconnected . How can I realize this ? :mad: Amd I'm just curios about one thing. I have a server and multiple clients... (3 Replies)
Discussion started by: !_30
3 Replies

3. IP Networking

check whether connected to network

hi... can anyone pls suggest a few methods to check whether a computer is connected to any network, using the terminal, not GUI. thanks eskay (1 Reply)
Discussion started by: eskay_karthik
1 Replies

4. UNIX for Advanced & Expert Users

linux connected to as400

we have a as400 5rev4 and want to use a rhel server to use as a file server. We exported a drive on the rhel box and then mounted it on the as400. We can see the top directory in our mounted as400 directory but when we attempt access subdirectories we get a no matching object error. When we open... (2 Replies)
Discussion started by: javagair
2 Replies

5. AIX

How do I know to which storage I am connected

Hello everyone. We have a environment where we have DS8K storage and ES800 storage, the way to check to which storage the box is connected is using the LUN ID I get frm " pcmpath query device " command. for ex: 75CXX - DS8K storage 26860 - ES 800 Storage I was told to check... (4 Replies)
Discussion started by: nivaspIND
4 Replies

6. IP Networking

Am I Connected?

Be Gentle folks, I am a baby OpenSuSe 11.2 user :-) In windows Vista, there is a world in the systray when you are Internet connected and not just local. I have searched all over for a .RPM for the Network Manager or another packeg in Suse that can show me the same thing or something close. ... (0 Replies)
Discussion started by: donmaxwelliii
0 Replies

7. UNIX for Dummies Questions & Answers

Non Internet connected distribution

Hi all I've been a Debian user since solidly since about 1997 so I'm fairly experienced Linux user as a whole but unfortunately the monoculture has hit be hard recently. I'm working off a Laptop a lot of the time which spends up to 2-4 weeks without an Internet connection. A few weeks ago it... (1 Reply)
Discussion started by: pointyhat
1 Replies

8. UNIX for Dummies Questions & Answers

Ftp showing connected only

hi, good morning. Anyone can help me out. A trying to ftp from server A to server B. from server A to B its working fine but from server B to A, its only showing connected only: finap7 #ftp 10.10.10.210 Connected to 10.10.10.210. I refresh the inetd but nothing is happening. Please... (1 Reply)
Discussion started by: kamaldev
1 Replies

9. OS X (Apple)

How to see connected macs through terminal?

Been a while since I've been here; I have my iMac and MBpro connected via firewire, and they can see each other when I open the finder windows. But I'd like to be able to 'see' each computer on the other via the terminal application; and I can't see them right now. I can transfer files via the... (0 Replies)
Discussion started by: Straitsfan
0 Replies

10. IP Networking

Connected to IANA anyway, why?

May someone can answer this. Anytime I ignite my laptop to go online I see via etherape that I am connected to IANA as shown below. Is my provider redirecting me there, the cable under the sea, what is the reason for this? This happened with a pretty normal desktop PC, as well with my ancient... (2 Replies)
Discussion started by: 1in10
2 Replies
SETUPCON(1)						    Console-setup User's Manual 					       SETUPCON(1)

NAME
setupcon - sets up the font and the keyboard on the console SYNOPSIS
setupcon [OPTION]... [VARIANT] DESCRIPTION
setupcon is a program for fast and easy setup of the font and the keyboard on the console. Most of the time you invoke setupcon without arguments. The keyboard configuration is specified in ~/.keyboard or /etc/default/keyboard. The font configuration is specified in ~/.console-setup or /etc/default/console-setup. Consult keyboard(5) and console-setup(5) for instructions how to configure these two files. If you have to switch often between different encodings, keyboards or languages, you can prepare several alternative configuration files for setupcon. Suppose that most of the time you will use Greek language with Greek keyboard layout, but sometimes you need to type in Ger- man with German keyboard layout. In this situation you should customize the main configuration files (keyboard and console-setup) for Greek. Also, create alternative configuration files for German named keyboard.german and console-setup.german. Then in order to configure the console for Greek you will simply run the command with no arguments: setupcon and in order to configure the console for German you will use setupcon german. OPTIONS
VARIANT Specifies which configuration file to use. With no variant, the configuration files of setupcon are named console-setup and key- board. On the other hand, if you use e.g. chukchi as VARIANT then the configuration files are console-setup.chukchi and key- board.chukchi. In this way you can have easy access to several different configurations - for example one for the Chukchi language and another for the default configuration. -v, --verbose Be more verbose. Use this option if something goes wrong or while experimenting with the configuration files. -k, --keyboard-only Setup the keyboard only, do not setup the font or the terminal. On Linux it is enough to do this configuration only once. -f, --font-only Setup the font only, do not setup the keyboard or the terminal. On Linux this configuration should be repeated each time a new con- sole driver is activated (for example when the frame buffer becomes active). -t, --terminal-only Setup the terminal only, do not setup the keyboard or the font. --current-tty Setup the only the current virtual terminal. --force Do not check whether we are on the console. Notice that you can be forced to hard-reboot your computer if you run setupcon with this option and the screen is controlled by a X server. --save This option can be useful if you want to use setupcon early in the boot process while /usr is not yet mounted and the required data are not available. This option will make setupcon copy the required files in /etc/console-setup/ in order to make them available before /usr is mounted. If you use setupcon early in the boot process, then you should run it with this option after every change of the console configuration. --save-only The same as --save, but does not setup anything. This option can be useful if you want to save the required files while the screen is controlled by a X server. --save-keyboard FILE For use by initrd builders. Do not configure anything. Save an usable keyboard layout in FILE. --setup-dir DIR For use by initrd builders. Do not configure anything. Arrange in the directory DIR everything necessary in order to configure the console. The file DIR/morefiles lists all binaries the initrd builder has to install in the initrd image. All other files in DIR have to be copied unchanged in the initrd. In order to configure the console one has to run the script DIR/bin/setupcon. -h, --help Display usage information. FILES
~/.console-setup ~/.keyboard /etc/default/console-setup /etc/default/keyboard /etc/default/console-setup.VARIANT /etc/default/keyboard.VARIANT /etc/console-setup/ SEE ALSO
keyboard(5), console-setup(5) console-setup 2011-03-17 SETUPCON(1)
All times are GMT -4. The time now is 10:06 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy