keyboard

How could I enable / disable keyboard Return Key manually in Swift?

旧街凉风 提交于 2020-01-23 06:36:27
问题 This question is not duplicated from these: How to disable/enable the return key in a UITextField? How to enable or disable the keyboard return key Enable and Disable Keyboard return key on demand in iOS I have two TextFields . @IBOutlet weak var textField1: UITextField! @IBOutlet weak var textField2: UITextField! textField1 has the Next button like the Return Key; textField2 has the Go button like the Return Key; textField1 textField2 I would like to enable the Go button of the second

How can I find portion of my view which isn't covered by the keyboard (UIModalPresenationStyleFormSheet)?

霸气de小男生 提交于 2020-01-23 01:24:47
问题 I've got a view controller showing a view with a UITextView, and I want to resize the view when the keyboard appears so that the UITextView isn't covered by the keyboard. I have this working correctly in almost all cases. I'm still seeing some weirdness on the iPad, only when the view controller is presented in ModalPresentationStyleFormSheet, and only in LandscapeRight orientation, as far as I can tell. Relevant parts of my view controller's -keyboardWillShow: // We'll store my frame above

Mac keyboard shortcuts not working on iOS Simulator

妖精的绣舞 提交于 2020-01-22 17:05:13
问题 All the mac keyboard short cuts like Cmd+Q (Quit Simulator app), Cmd+K (Toggle keyboard hide/show in Simulator) etc has stopped workings for iOS Simulator app since this morning suddenly. All other apps, including Xcode, shows the shortcut in menus and they are working fine. I noticed, the shortcut keys shows up against menu items momentarily on launch of simulator but then disappears completely (see attached)... I tried following but no success... Launch simulator (Open Xcode project and

Windows 7 Map CTRL + j to the Down Arrow Key

泪湿孤枕 提交于 2020-01-22 15:38:28
问题 I have been searching for months for a way to map a key combination ( CTRL + something ) to a directional key (like down or up). I desperately want in Visual Studio to be able to press CTRL + j and have the cursor move down a line. I hate having to move my hands off of the home row to move up and down for things like intellisense or even just navigating up and down lines. Does anyone have a solution for this? I would be ok with a Visual Studio-only solution, but something that works at the OS

Modifying keyboard toolbar / accessory view with WKWebView

和自甴很熟 提交于 2020-01-22 14:42:30
问题 I'm using a WKWebView with a content-editable div as the core of a rich-text editor, and would like to modify the top toolbar above the keyboard—the one that contains the autocorrect suggestions and formatting buttons. (Not sure if this counts as an input accessory view or not). I've found a few posts showing how to remove the bar, but none of them seems to work, and ideally I'd like to keep the autocorrect part anyway. At least one app, Ulysses, does this (though I don't know if it's with a

convert a keycode to the relevant display character

杀马特。学长 韩版系。学妹 提交于 2020-01-22 12:37:25
问题 In a C# Windows.Forms project I have a control that does not supply the KeyPressed event (It’s a COM control – ESRI map). It only supplies the KeyUp and KeyDown events, containing the KeyEventArgs structure. How can I convert the information in KeyEventArgs to a displayable Unicode character, taking the current active keyboard layout into account, etc.? 回答1: The trick is to use a set of user32.dll functions: GetWindowThreadProcessId, GetKeyboardLayout, GetKeyboardState and ToUnicodeEx. Use

Extend iOS 11 Safe Area to include the keyboard

白昼怎懂夜的黑 提交于 2020-01-22 07:15:46
问题 The new Safe Area layout guide introduced in iOS 11 works great to prevent content from displaying below bars, but it excludes the keyboard. That means that when a keyboard is displayed, content is still hidden behind it and this is the problem I am trying to solve. My approach is based on listening to keyboard notifications and then adjusting the safe area through additionalSafeAreaInsets . Here is my code: override func viewDidLoad() { let notificationCenter = NotificationCenter.default

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

UITableView won't scroll after editing view frame and origin

孤街醉人 提交于 2020-01-22 02:18:05
问题 I'm trying to implement a UITextView in a table cell at the bottom of a table view. I've tried the suggestions here Making a UITableView scroll when text field is selected, and other solutions as well, but they're a bit different because I have to artificially add extra height to the current view in order to create space for the keyboard. Here's what I added to the previous solution in order to port it to my app. -(void) keyboardWillShow:(NSNotification *)note { CGRect frame = self.view.frame

Is there a way to detect if a key has been pressed?

坚强是说给别人听的谎言 提交于 2020-01-21 18:55:25
问题 I am compiling and executing my programs in cygwin on a windows computer. I am quite inexperienced in C but I would like a way to detect if a key has been pressed without prompting the user(e.g me). My pseudo code with desirable functions is shown below. char ch; while(1){ if(KeyBeenPressed()){ //a key has been pressed before getting here ch=getKeyPressed(); if(ch=='0'){ printf("you have pressed 0"); } else{ printf("you did't press key 0"); } } //do other stuff } And my own try to solving