user-input

UWP VirtualKeyboard shows NumericPin layout in simple textbox

杀马特。学长 韩版系。学妹 提交于 2019-12-08 12:22:39
问题 I have multiple textbox controls in different views in my app. For each textbox inputScope is set to default or AlphaNumeric. In some scenarious when i open a ContentDialog and close it , KeyboardLayout becomes NumericPic layout for all textboxes, even if i click on windows taskbar keyboard button. NumericPic is not set anywhere, already checked in all code. Does someone knows anything about this ? Or maybe is a windows issue ? Checked on Lenovo Tablet , Windows 10 Home Single Language v 1607

Catching user-generated events in selenium webdriver

偶尔善良 提交于 2019-12-08 11:54:10
问题 Can we catch in Selenium WebDriver events generated by the user (or events in general)? I know we can check state of page f.e. with WebDriverWait and ExpectedConditions, but that is not always appropriate. Let's say I wanted to wait for user input to continue execution of test class. It would look something like this: driver.get("https://www.google.com"); waitForKey(driver, org.openqa.selenium.Keys.RETURN); /* rest of code */ driver.quit(); Where waitForKey would be implemented as: public

How to catch keyboard input with jQuery .keyup() function

大兔子大兔子 提交于 2019-12-08 11:27:59
问题 Working on a simple hangman game, and I'm trying to catch the user input with the keyup() , but when I log it to the console I'm realizing something isn't working right... this is my code: $(document).keyup(function(e) { userInput = e.value; console.log(userInput); }); I also tried doing this, but it isn't working either. $(document).keyup(function(e) { userInput = $(this).val(); console.log(userInput); }); oh, by the way, userInput is a global variable. 回答1: You have to get the value from

Continuous input commands

坚强是说给别人听的谎言 提交于 2019-12-08 07:31:01
问题 My program will read user keyboard commands in the form of " command parameter " with a space in between. It keeps carrying out individual commands until the next command is " exit ". Also, if the user messes up, the program should show an error but continue asking for commands (a feature I don't think I have completed).. Is the following code a good way of implementing this? Could it handle the user simply pressing the enter key w/o a command, junk input, etc? If anything, I would love to

limit python input to int

孤者浪人 提交于 2019-12-08 06:54:24
问题 How can i make the code limit the input of the user to integers. The code right now works perfect but i want it to instead of giving me an error when it inputs a String, it will just make an exception. def miles_to_km(): miles=eval(input('Amount of miles: ')) result= float(miles*1.609344) print(miles, 'Miles are equivalent to ', result, 'Kilometers') print('----------------------------------------------------------------') def km_to_miles(): km=eval(input('Amount of kilometers: ')) result=

User input is not promted in CentOS7 using systemctl or service command

不打扰是莪最后的温柔 提交于 2019-12-08 06:42:59
问题 Am trying to stop the system service using systemctl or service command. The command as follows systemctl start service_name or service service_name start In that stop method am asking user to enter password which is not display on console(Suspecting ran in background). Stop method as follows stop() { read -s -p "Please provide password to stop the service" passwd } The same ran in CentOS 6 using service command, its displayed on console and entered the input. Can anyone please suggest me

How to get the last key pressed without stopping the C program?

人走茶凉 提交于 2019-12-08 05:36:12
问题 Writing an application with command line interface and I would like to know at any time if F1 or ESC or an arrow key is pressed. What is the simplest way of doing this? I would like to avoid using a readline type library. This is a Linux specific question; the program is not multithreaded. 回答1: An implementation of kbhit() for Linux is presented in Beginning Linux Programming page 167. You can read it on-line at the link provided. EDIT: I mention kbhit() because it was posted as a solution

User input showing images - how to solve some of script problems?

我们两清 提交于 2019-12-08 05:22:29
问题 I am creating a web application which has a role to write Egyptian hieroglyphs by converting user input into the text field to the specific code and displaying hieroglyphs which correspond to specific code. Currently available codes are from A1 to A6, with possibilities for example as A1A, A1B, A4C, A4E (I don't know if this is important). This is what I got so far: <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale

Problems with 'int'

喜夏-厌秋 提交于 2019-12-08 02:41:44
问题 I'm new to programming, so I want to write a code that will let me input a 2 dimensional array (or a matrix in my case) and print it afterwards. #include <iostream> using namespace std; void printArray( const int *array, int count ) { for ( int i = 0; i < count; i++ ) cout << array[ i ] << " "; cout << endl; } int main () { int n; cout<<"Please enter the length of your matrix : "<<endl; cin>>n; int * y=new int [n]; for (int w = 0; w <= n-1; w++ ) { y[w] = new int [n]; cout<<"Insert the

User idle time while typing in input

淺唱寂寞╮ 提交于 2019-12-08 02:29:20
问题 The problem I'm having is a search function which should call my doSearch() -method after the user stopped typing for at least 100ms in my $("input#q) field. I tried to achieve this by using the logic of this answer, but I'm stuck with where I should set/unset the setInterval() which increments the idleTime . var idleTime = 0; $("input#q").keyup(function() { idleTime = 0; idleInterval = setInterval(function() { idleTimeIncrement(); }, 25); }); function idleTimeIncrement() { idleTime += 25; if