raw-input

Windows key repeat settings affecting Raw Input messages

爷,独闯天下 提交于 2019-12-11 11:12:29
问题 It's supposed to be RAW input direct from the device, this is strange that it's affected by these settings: It won't get a WM_INPUT message until after the delay. Also the repeat rate is affecting it. I've tried also registering the raw input device with NO_LEGACY flag, no difference. This is with a DirectX11 application I'm having this problem. case WM_INPUT: {Input::handleInput(uMsg, wParam, lParam); break; } 回答1: There is no way to get around it apparently, a gamedev tutorial explained

Python client side in chat

穿精又带淫゛_ 提交于 2019-12-11 02:55:39
问题 I have a problem while trying to build the client side of a chat. I just in the begining, this is my code: import socket my_socket = socket.socket(socket.AF_INET,socket.SOCK_STREAM) my_socket.connect(("10.10.10.69",1234)) while True: message=raw_input("your message: ") if(message=="quit"): my_socket.close() break my_socket.send(message) data=my_socket.recv(1024) print "message from server:" , data The problem is the raw_input . When a user sends a message the other users are stacked on the

Maximum characters that can be stuffed into raw_input() in Python

微笑、不失礼 提交于 2019-12-11 01:32:43
问题 For an InterviewStreet challenge, we have to be able to accomodate for a 10,000 character String input from the keyboard, but when I copy/paste a 10k long word into my local testing, it cuts off at a thousand or so. What's the official limit in Python? And is there a way to change this? Thanks guys Here's the challenge by-the-by: http://www.interviewstreet.com/recruit/challenges/solve/view/4e1491425cf10/4edb8abd7cacd 回答1: Are you sure of the fact that your 10k long word doesn't contain

Registering a touch screen HID with RegisterRawInputDevices does not work

回眸只為那壹抹淺笑 提交于 2019-12-09 23:48:54
问题 I am trying to get raw input data from a Surface touch screen, using RAWINPUT API. Getting the devices list works good. But when I want to register the touch screen device with RegisterRawInputDevices, I have issues : the function returns false with 87 (ERROR_INVALID_PARAMETER) in GetLastError... I have tried different things that I read online but none work. I am using Interop on C# for very simple desktop console application, developping with Visual Studio 2013 on Windows 8.1. The target is

Simulating Raw Input on Windows

北城余情 提交于 2019-12-08 11:15:21
问题 I have an application that does some complicated things with raw input and I would like to have some automated tests for it. This is the code that sends input albeit chopped down a bit to make it easier to follow. Sending: GetRawInputDeviceList(nullptr, &numDevices, sizeof(RAWINPUTDEVICELIST)); rawInputDeviceList = new RAWINPUTDEVICELIST[numDevices]; GetRawInputDeviceList(rawInputDeviceList, &numDevices, sizeof(RAWINPUTDEVICELIST)); HGLOBAL hRaw = ::GlobalAlloc(GHND, sizeof(RAWINPUT));

Inputing floats, integers, or equations in raw_input to define a variable

我只是一个虾纸丫 提交于 2019-12-08 04:36:28
I've written this program so solve two equations based on values defined by the user. The constants kx and ky, I've defined as floats. For the range - variables start and end - I would like the user to either enter a number, or something like 6 * np.pi (6Pi). As it is now, I get the following error. How can I define this variable to allow users to enter multiple types of inputs? Thanks! Traceback (most recent call last): File "lab1_2.py", line 11, in <module> x = np.linspace(start, end, 256, endpoint=True) File "/Library/Frameworks/Python.framework/Versions/7.3/lib/python2.7/site- packages

In Python, how could I get a user input while simultaneously running the script?

自闭症网瘾萝莉.ら 提交于 2019-12-07 22:58:39
问题 In my program I am trying to take the chat from a website and printing it on my console. While that's going on I'm using raw_input to get chat from whoever is using it. My problem is that raw_input pauses the rest of the script until i say something or press enter. Is there a simple way to fix this? 回答1: You have to multithread. One thread for user input and another for the background tasks. The documentation is a bit complex (I'm pretty confused by it), but it's a start: http://docs.python

python raw_input odd behavior with accents containing strings

亡梦爱人 提交于 2019-12-07 16:53:58
问题 I'm writing a program that asks the user for input that contains accents. The user input string is tested to see if it matches a string declared in the program. As you can see below, my code is not working: code # -*- coding: utf-8 -*- testList = ['má'] myInput = raw_input('enter something here: ') print myInput, repr(myInput) print testList[0], repr(testList[0]) print myInput in testList output in eclipse with pydev enter something here: má m√° 'm\xe2\x88\x9a\xc2\xb0' má 'm\xc3\xa1' False

Is it possible to swallow a key in Raw Input?

房东的猫 提交于 2019-12-07 04:54:41
问题 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 all the information I need. Now I want to prevent those USB devices from being able to toggle NumLock. I am hoping that the Raw Input API might allow me to swallow the NumLock keypress? I’ve tried setting the WM_INPUT message’s Result to 1, but

How to make non-blocking raw_input when using eventlet.monkey_patch() and why it block everything, even when executed on another thread?

强颜欢笑 提交于 2019-12-06 11:24:50
问题 I wrote this minimum code to explain my case: import threading import time import eventlet eventlet.monkey_patch() def printing_function(): while True: # here i want to do some work print "printing" time.sleep(1) if __name__ == '__main__': thread = threading.Thread(target=printing_function) thread.start() while True: # here i want to wait for users input raw_input("raw input\n") print "inside main loop" time.sleep(1) Even i have 2 threads, both of them are blocked when i call raw_input. When