keyboard-events

RawKeyEvent wrong characters in Windows10 [Flutter desktop]

廉价感情. 提交于 2020-04-18 06:09:20
问题 I'm testing RawKeyboardListener in a Flutter Desktop project (Windows 10). Events work fine, but i receive wrong keys label, as you can see below: Is it a "keyboard layout" issue, like if the app was expecting events from an android keyboard with different key positions (As you can see in the .gif i receive and "Unknown Android key code")? How can i fix that? Also, if i print event.isControlPressed it always return false even if i'm pressing it. This is the code i'm using: import 'dart:io';

Scroll with keyboard's up/down arrows keys in React?

痴心易碎 提交于 2020-03-19 07:52:42
问题 I have a custom listbox, a div that contains a vertical list of other div children. I want to add an up/down arrows keys navigation to change which child is currently selected. So when I click the first item and press the down arrow key , it should allow me to select the second item (following item). And if I click the up arrow key , it should select back the first item (previous item). const renderInboxSummary = targetDetailsData.map((todo, index) => { const hasNewMessageInd = todo

Detecting the Asterisk Key on KeyDown Event

醉酒当歌 提交于 2020-01-25 04:29:06
问题 Firstly I have seen the following answer https://stackoverflow.com/a/7731051/626442 and it is not quite sufficient for my needs. I have written an editor which has basic intellisense capabilities (see A New and Full Implementation of Generic Intellisense for an insight). I have implemented some basic SQL Server completion using this editor, but I keep getting intellisense popping up when I type the * key. I want to prevent this. Currently I do the following: private void TextArea_KeyDown

Detect MS Surface Virtual Keyboard in Javascript

≯℡__Kan透↙ 提交于 2020-01-23 09:07:27
问题 Is there a way to detect when the virtual keyboard of the MS Surface is being displayed in a web page via Javascript. The virtual keyboard is covering up the active text field on a page, and I need to be able to detect this so that I can re-layout the page to work better with the remaining window area. 来源: https://stackoverflow.com/questions/29997889/detect-ms-surface-virtual-keyboard-in-javascript

Make popup of the key pressed in a customized keyboard

痞子三分冷 提交于 2020-01-22 05:51:26
问题 I'm using keyboardview to have my own keyboard. Works fine, but I cannot do the effect of enlarging the key pressed, as does the Android keyboard These are the parts that use <android.inputmethodservice.KeyboardView android:id="@+id/keyboardview" style="@style/Widget.KeyboardView" android:layout_width="fill_parent" android:layout_height="wrap_content" android:focusable="true" android:focusableInTouchMode="true" android:shadowRadius="0" android:visibility="visible" /> . <style name="Widget

SDL 2.0 Key repeat and delay

99封情书 提交于 2020-01-21 12:17:11
问题 I'm having a problem with SDL 2.0 keyboard input in pong-like game. When I order to move to the left by pressing left arrow, it is processed by SDL_PollEvents() and responds correctly if the key was pressed once. However, if I keep the key pressed, I get a short delay (as long as Windows key repeat delay) before moving continuously. Here is function processing events: void Event::PlayerEvent (Player &player) { while (SDL_PollEvent (&mainEvent)) { switch (mainEvent.type) { case SDL_KEYDOWN :

Create a simple, unmodified key binding in WPF

青春壹個敷衍的年華 提交于 2020-01-21 10:54:50
问题 I'm trying to create a very simple WPF application. I'd like to have an command handler called when the user presses "H" (not Control-H or Alt-H, just H). If I use the following in code-behind code: var gesture = new KeyGesture(Key.H, ModifierKeys.None); var inputBinding = new InputBinding(MyRoutedCommand, gesture); InputBindings.Add(inputBinding); I immediately get an exception saying that the key and modifier combination isn't supported for KeyGesture. (I get the same exception if I create

How to dispatch KeyboardEvent in Chrome extensions

无人久伴 提交于 2020-01-17 06:40:33
问题 Does Chrome allow firing KeyboardEvent by using content script in Extensions? I was trying to change every character entered to the page to the same character, but when I load the extension, the "dispatchEvent()" function gave me "Uncaught RangeError: maximum call stack size exceeded", can someone check my code? Thanks! So in the content script I first standard keyboard input, then create a new keyboardevent and dispatch it. The error is on "dispatchEvent()" function. Manifest.JSON {

How to dispatch KeyboardEvent in Chrome extensions

删除回忆录丶 提交于 2020-01-17 06:39:27
问题 Does Chrome allow firing KeyboardEvent by using content script in Extensions? I was trying to change every character entered to the page to the same character, but when I load the extension, the "dispatchEvent()" function gave me "Uncaught RangeError: maximum call stack size exceeded", can someone check my code? Thanks! So in the content script I first standard keyboard input, then create a new keyboardevent and dispatch it. The error is on "dispatchEvent()" function. Manifest.JSON {

better way to interrupt my python code when subprocess is running?

有些话、适合烂在心里 提交于 2020-01-15 06:53:10
问题 I recently answered a question here The question was: how to interrupt a python script when a subprocess is running (possibly windows-specific). I suggested to create a thread to run the subprocess on, and wait on the mainloop for CTRL+C / KeyboardInterrupt exception so the child process can be killed. It works, but bit of a hack because I did this: Basically, I make a non-cpu active (but polling) loop which waits 100ms then checks for the shared boolean done . If the subprocess exits, the