Programming :: Read Keyboard Status (not: Wait For Keyboard Input)?
Jun 28, 2011has bash a command that reads the keyboard status and exits? I want to write a loop of this form:
Code:
while [ 1 ] do
sleep (1)
[code]....
has bash a command that reads the keyboard status and exits? I want to write a loop of this form:
Code:
while [ 1 ] do
sleep (1)
[code]....
I have a C program that may finish in seconds or weeks depending on the data. For the longer jobs I want to be able to press a key and get an intermediate result printed.
View 14 Replies View RelatedI have this little shell script which copies file names taken from inputfile:
Code:
while read line; do
cp -i $line something
[code]...
I've got a program that takes keyboard input with BufferedReader and readline(), but readline() is blocking so I can't increment any sort of counter to quit the application after a period of inactivity, because the program is just waiting for an input from readline(). Do I need to create multiple threads, where one thread counts down an inactivity timer, or is there some method of using non-blocking keyboard inputs?
View 1 Replies View RelatedI'm running lucid with a seal shield seal pup keyboard.
when i turn the thing on, after it boots, i have to wait about 2 minutes for the keyboard to start working.
I am trying to learn C++.I implemented a simple archive program, and I am in a situation in which the user is prompted by a menu to make a choice.So I have some cout instruction to illustrate the possible choices and then
int choice;
cin>>choice;
and everything works fine.I introduced this code in a "while" loop that checks wether the choice made by the user is valid or not:
bool check=true;
int choice;
while(check)
{
cin>>choice;
if(the choice is valid) {...;check=false}
else cout<<"please make an other choice"
}
What is happening is that if by mistake the user introduces a character in place of a number, the loop repeats indefinitely because the program, when it get to the "cin" instruction, does not pauses to wait for a new input.
I have a server listening on incoming client connections. Once the client establishes SSL connection with the server, the server waits on read() from the client. Only Client can disconnect the connection. I want to have a timer in the server program to wait for x secs after read() and then disconnect the Client connection.
View 3 Replies View RelatedI am trying to read one line at a time in perl and not wait for stdin eof to start the action:
Code:
foreach(<STDIN>){
<do something>
}
if i pipe ls into it, it waits for ls to be done before doing the action.
My keyboard status lights (Caps Lock, Num Lock, Scroll Lock) are non-functioning when in an X environment. The lights turn on and off as would be expected at the terminal.
xset can turn on the scroll lock, but but not the Caps or Num Lock.
numlockx can toggle the Num Lock light.
The functions of the keys on the keyboards works normally, it's just the lights don't update accordingly.
I have already run dpkg -reconfigure keyboard-configuration to no avail. and this is the information that /etc/default/keyboard has about my keyboard
Code: Select all$ grep -vE "^#|^$" /etc/default/keyboard
XKBMODEL="pc105"
XKBLAYOUT="us"
XKBVARIANT=""
XKBOPTIONS=""
BACKSPACE="guess"
The keyboard itself is a Corsair K70, if that matters.
I am using VNC viewer to remotely access a Linux machine. The problem is when I accessed it, I pressed a button which caused the status bar to disappear (containing menus such as 'Application', etc).
Then I couldn't get it again, even the title bar of Eclipse disappeared and I couldn't find any way to restore it. Even terminal is not getting opened.
I wanted to know how can I set a period of time to a tcp connection to wait for request or respond for tcp block read. which system call or function I can use? Does any body know a very simple quick and easy reference on web for socket programing that has lots of socket programing examples in it?
View 1 Replies View RelatedI know it is possible, and I have been trying everything I can find, but I can't seem to get it to work. I went to languages in YaST and enabled Japanese as a second language, and I have tried adding japanese as a secondary keyboard layout under configure desktop-> regional and language settings. I have a little flag in the system tray that I can click to change from US to Japanese, but all that does is change what the punctuation buttons do.
View 9 Replies View RelatedI installed SuSe Linux. By the installation I forgot to set the key-board to German. How can I change it now? I don't think I have to re-install the Linux again, right
View 3 Replies View RelatedThe issue I've been having is with Flash on websites; most notably, Livestream's Flash-based browser viewer, and Adult Swim's flash-based games. Clicking works perfectly fine, but the keyboard input is entirely disabled for the Flash area. Text boxes, or game controls, won't respond at all, even when everything else is still working.The only way to input any text into Flash-based text boxes is to write it somewhere else (Firefox's URL or Search bar, or in GEDIT), then copy+paste into the tect box (again, Ctrl+V won't work, only right-clicking and pasting will go through).
I've tried multiple versions of the Adobe Flash player, including the installer directly from Adobe's site, the adobe-flashplugin package in Synaptic, the flashplugin-installer package, and I believe I tried GNASH as well (although I'm not sure if that did anything).I haven't had a chance to attempt to downgrade either one yet, however, nor have I been able to test another browser.I've seen a few other issues of this sort pop up here before, but they've all either gotten no solutions, or they're a year or two old, or they're running into 64-bit-specific issues. Hopefully this is posted in the correct location, and fingers crossed someone has an answer (or better yet, a solution).
I have done a clean install of Ubuntu 10.04 on my laptop. However I don't like Evolution mail client and installed Thunderbird from the repositories. It installed fine and comes up with the wizard to fill account details in but for some reason you can't input anything from the keyboard - it seems greyed out. I tried uninstalling and re-installing but it's still the same. Everything else is fine and working.
View 9 Replies View Relatedhow to change my input language (the way typing in accents affects the output character).
Currently I am on a Brazilian abnt keyboard and an English system (which is what I want), but I am unable to output accented characters - which I sometimes want, when I am not programming. I need something to switch around, but cannot find where to configure additional languages (not keyboards) neither where to switch.
I am on 10.04 with a gnome desktop.
I want to create a script to send input to an already open window from the command line. The reason that I want to do this is to automatically control a game running on a emulator screen. So, for example, I want to send commands like "up" "up" "w" "s" ..
View 4 Replies View RelatedI switched to pure LXDE desktop in my Ubuntu and now my Keyboard Input Methods dialog doesn't show up. When I click on the menu item nothing happens. The Preferences menu item in the keyboard icon in the panel doesn't work either.
View 9 Replies View RelatedRunning natty. Main user account. In Ubuntu & Ubuntu Classic, both gnome, no keyboard or on-screen keyboard input. Compiz & metacity both bad. Mouse okay. Other user accounts okay. KDE okay.
Tracked problem to /home/{user}/.gconf/desktop/gnome/session/required_components/%gconf.xml. Removed file, problem goes away.
File contents:
<?xml version="1.0"?>
<gconf>
<entry name="windowmanager" mtime="1303412016" type="string">
<stringvalue>compiz</stringvalue>
</entry>
</gconf>
I just made a script to read out /dev/input/event3 into a file (My keyboard is identified here [ Machine is a laptop which runs on slax-atma distro ]). Then used a hexdump to convert the binary into hex. After that used a gwak script to print out the keys corresponding to each keyboard input. So now when I put this in my rc.local , It is taking down all the keys I press. Including login passwords (In short, each and every keys I press).Isn't this a big security risk, because intruder who has a physical access to my machine or has root password can put this file in rc.local and run a script to mail him all the details like my passwords, account and PIN numbers.
View 14 Replies View RelatedI am using gpg keys with passphrases set to connect to different jabber accounts. When I restore from hibernate I am prompted by two pinentry dialogs for these passphrases. But very often one of these dialogs that is not in focus steals keyboard input from the other dialog. Even worse, they steal keyboard input from fluxbox and other applications and I am unable to do anything until I enter it or click cancel if I do not want to input password right now. How can I forbid pinentry to steal keyboard input and to get it only if it is in focus? I am using pinentry-0.8.0 on Gentoo amd64 with USE="ncurses qt4" (/usr/bin/pinentry is a symlink pointing to pinentry-qt4).UPDATE:After some research, I found that pinentry accepts --no-global-grab option, which, according to the info page, should be used only by developers. Still unsure how to make it default: having#!/bin/zshexec /usr/bin/pinentry-qt4 --no-global-grab $@in place of /usr/bin/pinentry symlink does not work (this script is launched, but option is ignored), if I place it into /usr/local/bin it is not launched at all though I have /usr/local/bin in $PATH before /usr/bin.
View 1 Replies View RelatedBeen a long time since I was on ubuntu again. Saw the new 9.10 version and decided I should take it up again. Only problem is, and I've come across it quite alot, (but never a working solution). That my ctrl key isn't doing anything at all, therefor making every keyboard shortcut (copy/paste/new tab in firefox...etc) not working. It's not compiz his fault, i've had the same issue before i installed it.
Also i tried switching keyboard layouts, when i key press i don't see the ctrl key light up on screen, BUT when i press shift+ctrl, it does Anyone got a clue in how to revive my loving and overused ctrl button again ?
I'm running a 13" white Macbook. The keyboard worked fine, until today. I logged in and half the keys didn't work, the other half were numbers not the letters they were supposed to be. This started after log in, meaning I was able to enter my password properly: The problem starts when gnome boots up.
By copy and pasting, I installed Kubuntu, where the keyboard also works properly, so this is clearly a gnome problem. I haven't ruled out malicious software, which seems like the next step: How do I verify and replace all the software (gnome) that might be corrupted?
I am trying to get the sounds that are played on the Casio CTK-651 keyboard from the keyboard into ubuntu or windows. I can get the signal, but no sound is played back under Windows when it's connected with an AUX-to-USB connector. When I do it with the MIDI-to-USB connector in windows and ubuntu, whenever I press a key, I get what is programmed into LMMS through connecting in a channel. I can't get the piano or guitar or whatever sound that the keyboard is making into the computer. I can upload some video to show what I'm talking about with the aux connector.
View 1 Replies View RelatedI run Natty 64x (new install) and have setup to use two seperate x servers and no xinerama. When I start my computer everything seems fine on both monitors but once desktop is loaded and I start an app in the second monitor, I can't type anything and the window borders are missing. If I type "DISPLAY:=0.1 metacity" the problem gets fixed but I get an error that a window manager is running already.
I have AMD/Nvidia, GeForce 8800GT.
While typing commands it takes more time to type.let me know on how to correct this
View 3 Replies View RelatedI've found that my USB mouse causes some I/O bug BIOS, but in operation system it works fine. Problem is freezing GRUB caused by fake input from the mouse. Possible decision is disabling any input for grub, but I don't know how to do it.
View 6 Replies View RelatedI have a very strange problem with Fedora 13 on my home PC. When booting it just hangs at random points in the boot process. When it happend the first time, I thought the PC probably is completed frozen, but then I discovered that hitting the return button got the boot process going on again, but just step by step. That means on every boot I have to keep hitting the return button until gnome starts up, that's very annoying. So for any reason the boot process seems to switch to interactive mode somehow...
I already removed the kernel boot options rhgb and quiet to see, where exactly this happens in the boot process. But as I said, it seems to be completely random. Sometimes it's when "Starting udev", sometimes, when setting up eth card, when starting atd, and so on. It's different every time.
By the way, a similar thing happens when shutting down. It can take up to half an hour until the PC really shuts down. But it's usually going faster if I just keep hitting return after issueing the shutdown command (which actually looks a bit dull). But the PC finally shuts down at some point. That's not the case when booting up. I thought, maybe there's some kind of timeout problem. But even waiting for two hours, the PC does not startup without keeping hammering the return button
openSuse v11.1
Linux 2.6.27.39-0.2-default x86_64
VirtualBox v3.1.0
One user account completely ignores all keyboard input. No other account demonstrates this bizarre behavior. The faulty account has had occasional keyboard difficulty but it has always been related to the Virtual Machines (VirtualBox); the hosting account always functioned correctly.
Then the ban on keyboard input. Poof! "Keyboard? What keyboard? I don't see no stinking keyboard!"
It is not the physical keyboard. Three different hardware exhibit the same fault. It is not the motherboard; two mb's show the same fault. It is only that one account. And I even took the Windows route of re-installing the OS (what a waste of time that was).
If something changed, I am not aware of it (although something must have).
Like in xte "str ў", but with support of all characters.
View 1 Replies View Related