The raw input API provides a stable and robust way for applications to accept raw input from any HID (Human Interface Devices), including the keyboard and mouse.
Questions tagged [raw-input]
623 questions
5
votes
0 answers
Extra mouse buttons with Raw Input API
Im currently using RawInput to get mouse input, but it seems to not detect more than 3 buttons. It says it has support for X1 and X2 as well, but none of my mice seem to trigger them. Ive looked around, but Im not finding anything on google about…

zacaj
- 1,987
- 1
- 19
- 39
5
votes
1 answer
Get a String from a collection of keys presses retrieved using Raw Input API
I am using the Raw Input API to get a collection of key presses from a keyboard (actually, a magnetic stripe card reader that emulates a keyboard). Here are a couple of code excerpts so you can have an idea of how I'm getting the…

MarioVW
- 2,225
- 3
- 22
- 28
5
votes
4 answers
EOFError in Python script
I have the following code fragment:
def database(self):
databasename=""
host=""
user=""
password=""
try:
self.fp=file("detailing.dat","rb")
except IOError:
self.fp=file("detailing.dat","wb")
…

user46646
- 153,461
- 44
- 78
- 84
5
votes
0 answers
IMessageFilter not working under administrative privileges
I am using an IMessageFilter for tracking the user input by mouse and keyboard.
static void Main()
{
try
{
AddKeyboardMouseDevice(this.Handle);
RegisterDevices();
}
catch (Exception ex)
{
…

Ravi Kanth
- 1,182
- 13
- 38
5
votes
1 answer
user input with node.js
I have the following Node.js code that behaves strangely:
#!/usr/bin/env node
"use strict";
var readline = require('readline');
var rl = readline.createInterface({
input: process.stdin,
output: process.stdout
});
function input(prompt)…

Jabba
- 19,598
- 6
- 52
- 45
5
votes
0 answers
Python - Add hook/callback for when cursor moves when entering raw_input?
I am trying to write a version of the interactive interpreter which has syntax highlighting.
Here's what I have so far which works reasonably well (uses blessings and pygments modules)...
import code
import readline
import threading
import…

Leo Parmeson
- 51
- 3
5
votes
2 answers
How to print over raw_input's line in Python?
Usually, when raw_input asks you to type something in and press Return, feedback is printed on a new line. How can I print over the prompt's line? Could a CR work in this case?
Demo:
prompt = "Question: "
answer = raw_input(prompt)
print…

octosquidopus
- 3,517
- 8
- 35
- 53
5
votes
9 answers
How to use raw_input with argv?
I'm doing ex13 from Learn Python The Hard Way
I'm trying to pass:
python ex13.py raw_input() raw_input() raw_input()
my code is below:
from sys import argv
script, first, second, third = argv
print "The script is called:", script
print "Your…

J A
- 53
- 1
- 1
- 3
5
votes
1 answer
Python continuously parse console input
I am writing a little Python script that parses the input from a QR reader (which is seen as a keyboard by the system).
At the moment I am using raw_input() but this function waits for an EOF/end-of-line symbol in order to submit the received string…

mαττjαĸøb
- 315
- 4
- 18
5
votes
1 answer
Python cancel raw_input/input via writing to stdin?
For starters, I'm on python 2.7.5 and Windows x64, my app is targeted at those parameters.
I'm in need of a way to cancel a raw_input after a certain amount of time has passed. Currently I have my main thread starting two child threads, one is the…

Bryan Lott
- 143
- 2
- 9
5
votes
2 answers
Starting raw_input() with pre determined text
I'd like to be able to get input from the user (through raw_input() or a module) and be able to have text automatically be already entered that they can add to, delete, or modify. I know in javascript when you're using a prompt, you can do it…

Brennan Wilkes
- 213
- 3
- 4
- 13
5
votes
3 answers
Is it possible to swallow a key in Raw Input?
I am using the Raw Input API because I need to be able to respond to keys from different USB HID devices differently, even if it is the same key.
My window receives the WM_INPUT messages correctly. I can retrieve the RAWKEYBOARD structure to obtain…

Timwi
- 65,159
- 33
- 165
- 230
4
votes
3 answers
Getting device input (mouse, keyboard ...) on LINUX
I am building cross-platform game engine and now I am focused on Input system.
I have written an abstract Input system which passes the messages up
and is beeing fed by platform dependent modules, running in separate thread.
In windows I have…

relaxxx
- 7,566
- 8
- 37
- 64
4
votes
2 answers
Is it possible to use Windows Raw Input API without a window (ie from a console application)?
Is it possible to use Windows Raw Input API without a window (ie from a console application)?
I've tried using RegisterRawInputDevices but my message loops doesn't seem to get any events from GetMessage and hence just 'hangs' there.

Adam M-W
- 3,509
- 9
- 49
- 69
4
votes
1 answer
Killing stdout in python breaks get_line_buffer()
So I'm using some libraries that (unfortunately and much to my chagrin) print to stdout for certain debug info. Okay, no problem, I just disabled it with:
import sys,os
sys.stdout = open(os.devnull,'wb')
I've recently added code for getting user…

TheSchwa
- 853
- 10
- 19