keyboard-events

Listen for keyboard events and mouse movement outside of Electron app

五迷三道 提交于 2019-12-03 11:30:45
I've been getting into a few Electron projects and I am trying to figure out how you could listen for any keypresses or and track mouse movement when the app is in the background. I am using the menubar plugin so the app is still running in the background. I tried using the global-shortcut API but it looks like that is for shortcuts only and you can't register individual keystrokes. I've also looked over the API and have yet to find an event for keystrokes and mouse movements outside the app's main screen. justin.m.chase This is outside of the realm of normal use-cases for an electron

Disabling keys on keyboard

拟墨画扇 提交于 2019-12-03 09:47:58
问题 I am new to Objective-C, and I am looking to limit a user from switching from the alphabet portion of a normal keyboard to the numeric/punctuation side. This being said, I would like to disable the button on the keyboard that does the switch. Maybe I'm putting in the wrong search parameters, but I'm finding little on Google and even less in my reference books. How would I go about actually disabling a button on an iOS keyboard? With alpha/numeric/punctuation characters this would be easily

Restricting input length and characters for Entry field in Xamarin.Forms

£可爱£侵袭症+ 提交于 2019-12-03 08:19:59
问题 How can I restrict the length and characters entered in an Entry control in Xamarin.Forms. Do I need to create a custom control? Is there a way I can derive from Entry (or another control) so I can apply the necessary per-platform input limitations. An example would be a numeric field that is restricted to a maximum of 3 characters, digits only. Setting the Keyboard property of an Entry control to Keyboard.Numeric only sets the keyboard for iOS. It does not restrict the actual text entry - i

macOS App: handling key combinations bound to global keyboard shortcuts

爷,独闯天下 提交于 2019-12-03 08:15:46
In some apps, it makes sense for the app to directly handle keyboard shortcuts which are otherwise bound to system wide combinations. For example, ⌘-Space (normally Spotlight) or ⌘-Tab (normally app switcher). This works in various Mac apps, such as VMWare Fusion, Apple's own Screen Sharing and Remote Desktop clients (forwarding the events to the VM or server, respectively, instead of handling them locally), and also some similar third-party apps in the App Store. We would like to implement such a mode in the app we're working on, but are having a hard time working out how to do it. I should

UISearchbar keyboard search button Action

懵懂的女人 提交于 2019-12-03 04:14:20
I'm using UISearchBar when I input text on UISearchBar the keyboard shows. At that time, keyboard return key is "Search". I want to implement event when I press the keyboard search button. How can I implement the action? On UITextField it has -(BOOL)textFieldShouldReturn:(UITextField *)textField; But on UISearchBar it doesn't have return action. Thank you for your helping. Milo Add UISearchBarDelegate in .h Also set SearchBar's object delegate to self. Add this to the UISearchBarDelegate's method: - (void)searchBarSearchButtonClicked:(UISearchBar *)searchBar { [searchBar resignFirstResponder];

Creating a simple JavaScript class with jQuery

丶灬走出姿态 提交于 2019-12-03 02:52:12
问题 I'm trying to understand jQuery classes but it is not going very well. My goal is to use a class this way (or to learn a better way to do it): var player = new Player($("playerElement")); player.InitEvents(); Using other people's examples, this is what I tried: $.Player = function ($) { }; $.Player.prototype.InitEvents = function () { $(this).keypress(function (e) { var key = e.which; if (key == 100) { MoveRight(); } if (key == 97) { MoveLeft(); } }); }; $.Player.prototype.MoveRight =

Restricting input length and characters for Entry field in Xamarin.Forms

ぃ、小莉子 提交于 2019-12-02 22:07:08
How can I restrict the length and characters entered in an Entry control in Xamarin.Forms. Do I need to create a custom control? Is there a way I can derive from Entry (or another control) so I can apply the necessary per-platform input limitations. An example would be a numeric field that is restricted to a maximum of 3 characters, digits only. Setting the Keyboard property of an Entry control to Keyboard.Numeric only sets the keyboard for iOS. It does not restrict the actual text entry - i.e. I can still enter non-digit characters. Nor do I see a way to limit the length of entry. Femil

Make popup of the key pressed in a customized keyboard

て烟熏妆下的殇ゞ 提交于 2019-12-02 21:01:05
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.KeyboardView" parent="android:Widget.KeyboardView"> <item name="android:background">@drawable/naranja<

detect the appear and disappear of international keyboard

早过忘川 提交于 2019-12-02 20:47:41
问题 When a keyboard appears, is there a way to detect that it's an international keyboard (with an extra ribbon on top of normal keyboard to show the international characters) and also get it's frame size? I need to use that info to move upward (if needed) the view above the keyboard. 回答1: Check out this article: http://mobile.tutsplus.com/tutorials/iphone/ios-sdk-keeping-content-from-underneath-the-keyboard/ It addresses most of your questions. In addition to notifications, text views will

How to capture enter key being pressed on pages containing multiple forms?

南笙酒味 提交于 2019-12-02 17:39:37
I have inherited a web application where the usual ability to press return in any of the input fields has been disabled for the very good reason that the page contains multiple forms, and the application would not be able to determine (or, so I am told) which form to action. The application has been designed so there are no submit buttons (as in input type="submit") and, instead, the designers have gone for onclick handling. Here are two buttons that are defined on one of the pages, included for illustration <input type="button" value="LOGIN" name="btnLoginOk" onclick="submit(); />" <input