Questions tagged [keyboard-input]
105 questions
0
votes
1 answer
No keyboard input AS3
So I'm trying to get keyboard input from the user to move a character. It works in another program that I was using, and I copy pasted, but it isn't working in this one. It gives me Line 87, Column 38 1119: Access of possibly undefined property…

kevorski
- 816
- 1
- 11
- 29
0
votes
0 answers
How to find which keyboard key has been pressed using GetAsyncKeyState()?
I am currently having trouble correctly retrieving some of the keys on a standard keyboard (specifically F keys, arrow keys etc). I am cycling through all 256 ASCII characters using GetAsyncKeyState() on each integer to see if it is pressed, and if…

Alex Blacklock
- 1
- 1
- 1
0
votes
3 answers
Fill in an array from a single formatted keyboard line in C
How can I fill in a double or int array from a single, arbitrarily long, formatted (e.g. space delimited) keyboard line?
For instance:
Enter the elements of the array:
2 32 12.2 4 5 ...
should result in
=> array[0] = 2
=> array[1] = 32 etc.
I…

hko
- 139
- 3
- 10
0
votes
3 answers
How to call multiple functions in an if() statements in c#
So I need a c# if() statement which should look something like this, maybe? Code:
...
if(CurrentGameState != gameState.gameLoading && gameState.mainMenu && keyboardState.IsKeyDown(Keys.Escape))
{
CurrentGameState = gameState.mainmenu;
}
//I…

PowerUser
- 812
- 1
- 11
- 32
0
votes
1 answer
Detect keyboard input after windows recognition of the key
I am building a program that would print out the pressed buttons' values on the screen. I need it to work also when the program's window is not active. I tried using GetAsyncKeyState(int), which works fine. However, I can attach certain strings to…

Jonas Hoffmann
- 315
- 7
- 19
0
votes
3 answers
How to determine which player it will start by sending a Virtual-Key VK_LAUNCH_MEDIA_SELECT
Under Win2K(or later), by sending a Virtual-Key VK_LAUNCH_MEDIA_SELECT, can start a player.
If more than one player software installed, how to determine which one it will start?
A sample VBS code:
Wscript.CreateObject("Wscript.Shell").Sendkeys…

neorobin
- 139
- 1
- 6
-1
votes
1 answer
Pygame get_pressed()
I've been checking a lot of tutorials, I've been testing it myself, I read the official papers a hundred of times.
How the heck does pygame.key.get_pressed() work?
It looks like it isn't used at all in gaming. Can you suggest me some raw code, no…
user8511634
-1
votes
1 answer
Produce typing lag on purpose
I have to use USB barcode scanner in application running on remote desktop. This scanner is being recognised by Windows as keyboard. When I try to scan barcode however, every 3th or 4th character is being changed to another one. When I type numbers…

Siocki
- 53
- 2
- 9
-1
votes
1 answer
How to send a numeric value via ssh to the raspberry pi console
So I already have a SSH connection working but I'm looking for a command that can write a number like '1' into the console on the raspberry pi.
Thanks Sabifa

Sabifa
- 1
- 2
-1
votes
1 answer
Trap keyboard input from windows logon screen
I want to do following things to be done my Java project:-
Lock Windows desktop.
Detect key press event when windows desktop is locked.
Save entered keys from keyboard in a text file.
First step is done using this code:
Runtime rt =…

Vivek Kumar
- 21
- 6
-2
votes
3 answers
How can I keep running a loop until the key is pressed (C++)
I know this question has been asked several times on the net, but I could not find any of those answers helpful.
I want to keep running a loop and break it once the user press a key (e.g. enter or esc). I don't want it to ask user any input during…

user3720389
- 27
- 1
- 8
-2
votes
1 answer
Press the 'enter' key to move forward
I would like my program to only move forward when the enter key is pressed (not any other key).
This is what I have so far:
while (getline(in, line) ) {
cout << line << endl;;
cin.ignore();
}

user3233964
- 49
- 5
-3
votes
1 answer
How to take input in swift
I was trying to get Boolean data with readLine()! but cannot input it
There was a compilation error saying
error: cannot convert value of type 'String' to specified type 'Bool'

MMALI3287
- 1
- 1
- 4
-3
votes
2 answers
Simple Pong Game Keyboard Input
(The game is not complete yet but nevertheless)
Using the keyboard input does not do anything, I believe this is due to KeyListener not being defined properly. Here is my code:
mainClass:
import java.awt.Color;
import java.awt.Graphics;
import…

Tom
- 9
-5
votes
3 answers
In C#, how to take null input from keyboard into nullable type boolean variable?
I want to do something like this -
using System;
class MainClass
{
public static void Main ()
{
bool? input;
Console.WriteLine ("Are you Major?");
input = bool.Parse (Console.ReadLine ());
IsMajor (input);
…

Suraj
- 724
- 1
- 9
- 17