keyboard

Detox: how to test multiline TextInput

我怕爱的太早我们不能终老 提交于 2020-01-04 05:51:08
问题 I'm trying to use detox to test a form in my react-native app. One of the inputs in the form has multiline={true} . I am trying to run the following test: const inputElement = element(by.id('input_multiline')); await expect(inputElement).toBeVisible(); await inputElement.typeText('line1\n'); await inputElement.typeText('line2\n'); await inputElement.typeText('line3\n'); const submitElement = element(by.id('submit')); await submitElement.toBeVisible(); await submitElement.tap(); This test

How can I check if the hide button pf iPad's keyboard was pressed?

∥☆過路亽.° 提交于 2020-01-04 05:28:54
问题 I want to trigger a function that will depend on which method the user used to resign a textField's first responder. If it was resigned by selecting another textField, it does nothing, else triggers a function. Is this possible? 回答1: Found out how. You just have to listen to the UIKeyboardWillHideNotification notification: - (void)viewDidLoad { [super viewDidLoad]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(methodYouWantToCall) name

Dispatching keyboard event doesn't work in JavaScript

蹲街弑〆低调 提交于 2020-01-04 05:22:20
问题 I'm trying to simulate user input in browser with JavaScript. Click events are created and dispatched successfully but for some reasons a similar code for keyboard events doesn't seem to work at all. var event = document.createEvent("KeyboardEvent"); event.initKeyEvent("keydown", true, true, window, false, false, false, false, 87, 0); document.getElementById("id").dispatchEvent(event); This returns true but the corresponding character doesn't appear in the input. I tried with keypress and

Android Lollipop soft keyboard doesn't accept keypresses with GL surface

谁都会走 提交于 2020-01-04 05:22:18
问题 In a current fullscreen opengl based project I work on, I have some GL based graphical elements, notably a text entry field. For the use to enter text when this element has the focus, I display the soft keyboard (which appears fine). On android version before 5.0, the Google Keyboard was working fine, sending key events like for hardware keyboards. On android Lollipop, some other keyboards like Swiftkey or the free Hacker's keyboard are still working, but the Google Keyboard isn't anymore.

onInputShowListener Android - Is it possible to detect if any soft keyboard is shown?

放肆的年华 提交于 2020-01-04 01:55:32
问题 after fixing another problem in my Android Application, i came to another thing. It would be important that i can do something, like hide some visual elements, if the SoftKeyboard so a Input like Swipe or the normal Android Keyboard is shown. I've tried the onConfigurationChange="KeyboardShow" (pseudocode) but had no change to get a event when for example skype got shown. So now my question is, is there any solution or function or listener, with which i can handle such a action? I hope

How to detect key press without using an input tag in Blazor

可紊 提交于 2020-01-04 01:46:27
问题 I want to be able to capture keyboard input without using an HTML INPUT tag in Blazor. Once the key is pressed i will display a graphic to represent the letter pressed. Something like this @page "/counter" @using Microsoft.AspNetCore.Components.Web <div @onkeypress="e => KeyPress(e)"> Press any letter key </div> @code { private void KeyPress(KeyboardEventArgs e) { var letter = e.Key; } } The KeyPress method does not appear to be called when I set a breakpoint on it. Any help much appreciated.

detect automatic key-repeats in curses

随声附和 提交于 2020-01-03 21:00:57
问题 I'm writing a little text mode application using curses on Linux. For keyboard input I use the curses functions. Key auto-repeats work, e.g. if I hold a key down I get multiple key events until I release the key again. Is it also possible to distinguish between real key events and those generated by the key repeat logic? Background: The application is a little data-entry front-end where the user can modify integer numbers of certain parameters. In the long run the application will work

Scroll RecyclerView up accordingly when keyboard opens

扶醉桌前 提交于 2020-01-03 17:30:30
问题 I have created a chat activity and like facebook messenger, there is an EditText at the bottom and above is the RecyclerView of messages. When Keyboard opens, I want to scroll RecyclerView up exactly how much it should scroll up. To be more specific, lets assume there are 5 messages in the RecyclerView and currently 3rd message is just above the EditText. So when keyboard is open, I want to keep 3rd message just above the EditText like before. I have searched but could not find. If this is a

Low level keyboard hook

谁说我不能喝 提交于 2020-01-03 16:55:22
问题 I just bought a new keyboard, and I'm interested in tracking exactly how many keypresses/strokes I make during the entire life of the keyboard. (I would want to just record keyUp, as I don't care about repeats) I've been googling around for the best way to do this, but I don't even know what approach to take, so I'm having trouble searching intelligently. Also, the only language I've really worked with is C#. Haven't done anything with C/C++ or WinAPI Is it difficult to modify the Win 7

C#: In a KeyDown event, what should I use to check what key is down?

巧了我就是萌 提交于 2020-01-03 13:07:11
问题 In a KeyDown event, I have the KeyEventArgs to work with. It has (among other things) these three properties: e.KeyCode e.KeyData e.KeyValue Which one should I use for what? 回答1: Edit: Somehow I misread your question to include checking a valid character. Did you modify it? I've added a description of each. KeyCode is the Keys enumeration value for the key that is down KeyData is the same as KeyCode, but combined with any SHIFT/CTRL/ALT keys KeyValue is simply an integer representation of