Questions tagged [user-input]

User Input is data that the user inputs into the program. It generally takes the form of a String, but may also be an integer, floating-point number, etc.

5580 questions
1
vote
1 answer

Formatting a html input box to numeric input only - Correctly formating the minus character

I'm trying to format a html text input box so that it only accepts numeric values (using javascript). This means the input can only be a digit, a minus or a dot/comma (a comma gets replaced with a dot anyway). The thing is, a minus must be prevented…
Gark Garcia
  • 450
  • 6
  • 14
1
vote
1 answer

How to pin mouse in center of screen with GLUT?

I want to pin my mouse in middle of screen I mean when user move mouse the only thing that he see is rotation in environment also mouse cursor never reach window border ... I want to handle my camera with mouse but when mouse reach window border or…
pooya
  • 901
  • 2
  • 15
  • 29
1
vote
3 answers

WPF Textbox use default text

I have a TextBox, which I want my users to enter a time value in the format XX:XX:XX. I already have validation in place to make sure they enter it in this format. However, now I'd like to have the colons there automatically. I'd like them to be in…
s73v3r
  • 1,751
  • 2
  • 22
  • 48
1
vote
1 answer

Why is this code not reading user input properly?

So I'm trying to write a code for a units converter based on user input for the value and the units. This code sometimes reads the input properly and prints the value and the units correctly, but sometimes it doesn't read either input. It doesn't…
Efraín González
  • 201
  • 1
  • 2
  • 5
1
vote
1 answer

C# - Dynamically create function body from user input string

I am trying to create a C# program that lets user's provide an implementation for for a function by inputting text into a text box. I provide the function header (input types, output type), they just need to provide actual implementation. I then…
Andrew
  • 1,355
  • 2
  • 13
  • 28
1
vote
1 answer

Timed single character input in SWI-Prolog

I'm trying to make a simple timed menu in SWI-Prolog. The user should be able to hit a key to select an option, or if they press nothing it will automatically select the default option after a few seconds. I wrote this to test the character…
Jamie
  • 21
  • 4
1
vote
0 answers

JS user input function

So i am running a online chat function using js that currently sends and receives messages and has a user count in the top right corner that updates when a user leaves or joins. I need help with making a js function that you can submit a name to…
JackGab
  • 37
  • 4
1
vote
1 answer

There must be a better way for multi inputs

Some background info; Over a period of in this case 5 years, i need to set a daily price, for every day of the month and for all years, since that can be different. So i came up with this input form example
Marc CLH
  • 39
  • 4
1
vote
1 answer

How to get user input using KeyCombination in JavaFX?

I am working on a simple in-fix to post-fix converter. I want to get the user's input from the keyboard. To enter some symbols, e.g."+", the user must press shift. I am using a KeyCombination object to capture whether the user is using shift or…
so8857
  • 351
  • 2
  • 14
1
vote
1 answer

MMIX changing characters in input

I have an assignment where I have to take an input in MMIX and return the exact same thing, with the exception that all spaces must be newlines. I've been trying for about 2 days now and have figured out how to take input and how to output it to…
1
vote
3 answers

Read user input "string" and "int" in one line separated by space (C)

I have some functions like push, pop, delete etc. for a singly linked list and implemented the following function to get user input: void user_input(){ char input[10]; while(fgets(input, 9, stdin)){ if(strncmp(input, "add", 3) == 0){ int…
NightWish
  • 51
  • 2
  • 9
1
vote
1 answer

Kotlin invoke constructor using reflection

For a simple machine language reader, I have a number of classes AaaInstruction, BbbInstruction, CccInstruction, etc. which are invoked as aaaInstruction(v1, v2, v3). The idea is that the input is given in the form: aaa v1 v2 v3 bbb v1 v2 v3 ccc…
l.B
  • 11
  • 2
1
vote
1 answer

Getchar saving only 1 character in c

So, I'm going to be up front, this may get my question taken down, but I don't have a lot to go off of so this may be an incomplete question, but I'm completely stuck. I am writing a program in C, to be able to count the occurrence of a character…
Tcranmer
  • 29
  • 1
  • 10
1
vote
2 answers

Swap two neighborhood elements of array java

I am pretty new to java, usually writing python code, so you can downvote me as much as you want if only it will help me with understanding. Is there more less "javish" way to swap two neighborhood elements of user-input array? Currently I…
Java lava
  • 11
  • 1
1
vote
0 answers

Save user input between "runs" in Python

I'm asking this because I think there is probably a better way to do this, and if not at least it can help someone that is trying to do this, even if it is clunky So, what I want is to ask the user some input, and then use that input to run the…
1 2 3
99
100