Questions tagged [keyboard]
A text input device. Use this tag to ask programming questions related to typing, keyboard hiding and more.
                                	
	keyboard
    
                            
                        
                    
            12,715
            questions
        
        
            832
            votes
        
        
            19
            answers
        
        
            279k
            views
        
    Xcode 6: Keyboard does not show up in simulator
                The keyboard does not show up when I run the simulator and click in the UITextView. How do I re-enable the keyboard?
It used to work but now it doesn't - I don't know what I might have clicked by ...
            
        
       
    
            726
            votes
        
        
            26
            answers
        
        
            88k
            views
        
    Using a piano keyboard as a computer keyboard [closed]
                I have RSI problems and have tried 30 different computer keyboards which all caused me pain. Playing piano does not cause me pain. I have played piano for around 20 years without any pain issues. I ...
            
        
       
    
            619
            votes
        
        
            34
            answers
        
        
            471k
            views
        
    Run javascript function when user finishes typing instead of on key up?
                I want to trigger an ajax request when the user has finished typing in a text box. I don't want it to run the function on every time the user types a letter because that would result in A LOT of ajax ...
            
        
       
    
            546
            votes
        
        
            49
            answers
        
        
            474k
            views
        
    How to show soft-keyboard when edittext is focused
                I want to automatically show the soft-keyboard when an EditText is focused (if the device does not have a physical keyboard) and I have two problems:
When my Activity is displayed, my EditText is ...
            
        
       
    
            499
            votes
        
        
            34
            answers
        
        
            368k
            views
        
    How can I dismiss the on screen keyboard?
                I am collecting user input with a TextFormField and when the user presses a FloatingActionButton indicating they are done, I want to dismiss the on screen keyboard.
How do I make the keyboard go away ...
            
        
       
    
            487
            votes
        
        
            30
            answers
        
        
            400k
            views
        
    Android: How do I prevent the soft keyboard from pushing my view up?
                I have a vertical sliding drawer at the bottom of my app. When the soft keyboard opens, it pushes the tab for the drawer up, so it sits atop the keyboard. I actually want it to remain at the bottom of ...
            
        
       
    
            442
            votes
        
        
            16
            answers
        
        
            370k
            views
        
    Binding arrow keys in JS/jQuery
                How do I go about binding a function to left and right arrow keys in Javascript and/or jQuery? I looked at the js-hotkey plugin for jQuery (wraps the built-in bind function to add an argument to ...
            
        
       
    
            401
            votes
        
        
            34
            answers
        
        
            326k
            views
        
    How to dismiss keyboard for UITextView with return key?
                In IB's library, the introduction tells us that when the return key is pressed, the keyboard for UITextView will disappear. But actually the return key can only act as '\n'. 
I can add a button and ...
            
        
       
    
            376
            votes
        
        
            33
            answers
        
        
            357k
            views
        
    Android: show soft keyboard automatically when focus is on an EditText
                I'm showing an input box using AlertDialog. The EditText inside the dialog itself is automatically focused when I call AlertDialog.show(), but the soft keyboard is not automatically shown.
How do I ...
            
        
       
    
            333
            votes
        
        
            38
            answers
        
        
            362k
            views
        
    How do I detect if software keyboard is visible on Android Device or not?
                Is there a way in Android to detect if the software (a.k.a. "soft") keyboard is visible on screen?
            
        
       
    
            288
            votes
        
        
            25
            answers
        
        
            285k
            views
        
    When the keyboard appears, the Flutter widgets resize. How to prevent this?
                I have a Column of Expanded widgets like this:
 return new Container(
      child: new Column(
        crossAxisAlignment: CrossAxisAlignment.stretch,
        children: <Widget>[
          new ...
            
        
       
    
            272
            votes
        
        
            31
            answers
        
        
            130k
            views
        
    How do you tell if caps lock is on using JavaScript?
                How do you tell if caps lock is on using JavaScript?
One caveat though: I did google it and the best solution I could find was to attach an onkeypress event to every input, then check each time if ...
            
        
       
    
            258
            votes
        
        
            16
            answers
        
        
            365k
            views
        
    Phone: numeric keyboard for text input
                Is there a way to force the number keyboard to come up on the phone for an <input type="text">? I just realized that <input type="number"> in HTML5 is for “floating-point numbers”, so it ...
            
        
       
    
            258
            votes
        
        
            45
            answers
        
        
            211k
            views
        
    Making a UITableView scroll when text field is selected
                After a lot of trial and error, I'm giving up and asking the question. I've seen a lot of people with similar problems but can't get all the answers to work right.
I have a UITableView which is ...
            
        
       
    
            233
            votes
        
        
            38
            answers
        
        
            269k
            views
        
    Move textfield when keyboard appears swift
                I'm using Swift for programing with iOS and I'm using this code to move the UITextField, but it does not work. I call the function keyboardWillShow correctly, but the textfield doesn't move. I'm using ...
            
        
       
    
            210
            votes
        
        
            30
            answers
        
        
            191k
            views
        
    How to hide soft input keyboard on flutter after clicking outside TextField/anywhere on screen?
                Currently, I know the method of hiding the soft keyboard using this code, by onTap methods of any widget.
FocusScope.of(context).requestFocus(new FocusNode());
But I want to hide the soft keyboard by ...
            
        
       
    
            209
            votes
        
        
            8
            answers
        
        
            58k
            views
        
    How to allow keyboard focus of links in Firefox?
                Go to this ultra-simple fiddle in a Webkit browser and click on on of the inputs:
http://jsfiddle.net/eK4TT/
<input type="text">
<input type="text">
<input type="text">
<a href="...
            
        
       
    
            194
            votes
        
        
            36
            answers
        
        
            125k
            views
        
    How to hide keyboard when using SwiftUI?
                How to hide keyboard using SwiftUI for below cases?
Case 1
I have TextField and I need to hide the keyboard when the user clicks the return button.
Case 2
I have TextField and I need to hide the ...
            
        
       
    
            185
            votes
        
        
            9
            answers
        
        
            66k
            views
        
    How to disable generating special characters when pressing the `alt+a`/`option+a` keybinding in Mac OS (`⌥+a` )? [closed]
                There is a behavior in my mac that I'm trying to disable.
When I'm in any text editor and typing a key combination using the alt/option+any letter, the output will be special characters.
For example:
...
            
        
       
    
            180
            votes
        
        
            8
            answers
        
        
            42k
            views
        
    Super slow lag/delay on initial keyboard animation of UITextField
                It takes roughly 3-4 seconds for the keyboard to pop up after I touch my UITextField. This only occurs on the first time the keyboard pops up since the app launched, afterwards the animation starts ...
            
        
       
    
            176
            votes
        
        
            6
            answers
        
        
            105k
            views
        
    How to detect modifier key states in WPF?
                Is there some global constructs that I can use whenever I need to access whether the Control, Shift, Alt buttons are down? For instance inside MouseDown event of a TreeView.
If so how?
            
        
       
    
            173
            votes
        
        
            25
            answers
        
        
            207k
            views
        
    Move a view up only when the keyboard covers an input field
                I am trying to build an input screen for the iPhone. The screen has a number of input fields. Most of them on the top of the screen, but two fields are at the bottom. 
When the user tries to edit the ...
            
        
       
    
            165
            votes
        
        
            9
            answers
        
        
            48k
            views
        
    Resharper Ctrl-T mapping lost
                I seem to have lost the Resharper Ctrl+T mapping to find classes quickly, I tried the solutions described here:
Keyboard shortcuts are not active in Visual Studio with Resharper installed
...
            
        
       
    
            159
            votes
        
        
            9
            answers
        
        
            389k
            views
        
    keycode 13 is for which key
                Which is the key on the keyboard having the keycode as 13?
switch(key) {
  case 37: 
    $.keynav.goLeft();
    break;
  case 38: 
    $.keynav.goUp();
    break;
  case 39: 
    $.keynav.goRight();
 ...
            
        
       
    
            155
            votes
        
        
            13
            answers
        
        
            188k
            views
        
    How do I show the number keyboard on an EditText in android?
                I just basically want to switch to the number pad mode as soon a certain EditText has the focus.
            
        
       
    
            148
            votes
        
        
            9
            answers
        
        
            281k
            views
        
    How can you make a custom keyboard in Android? [closed]
                I want to make a custom keyboard. I don't know how to do it using XML and Java. The following picture is a model of the keyboard I want to make. It only needs numbers.
            
        
       
    
            146
            votes
        
        
            8
            answers
        
        
            77k
            views
        
    Hide keyboard when scroll UITableView
                In my app i want hide keyboard when i start scrolling UITableView. I search about this in internet, and most answer is subclassing UITableView (http://stackoverflow.com/questions/3499810/tapping-a-...
            
        
       
    
            145
            votes
        
        
            17
            answers
        
        
            159k
            views
        
    How do I make an Android EditView 'Done' button and hide the keyboard when clicked?
                When the user clicks on the EditView, Android opens the keyboard so that user can write in the EditView.
The problem is, when the user is done writing, there is no way to hide the keyboard. The user ...
            
        
       
    
            138
            votes
        
        
            12
            answers
        
        
            284k
            views
        
    How to detect the currently pressed key?
                In Windows Forms, you can know, at any time, the current position of the cursor thanks to the Cursors class.
The same thing doesn't seem to be available for the keyboard. Is it possible to know if, ...
            
        
       
    
            137
            votes
        
        
            5
            answers
        
        
            536k
            views
        
    How to read keyboard input?
                I would like to read data from the keyboard in Python. I tried this code:
nb = input('Choose a number')
print('Number%s \n' % (nb))
But it doesn't work, either with eclipse nor in the terminal, it's ...
            
        
       
    
            134
            votes
        
        
            11
            answers
        
        
            116k
            views
        
    Xcode iOS 8 Keyboard types not supported
                I have a UITextField Ctrl-dragged as an @Outlet in my .swift class.
Now in viewDidLoad i'm using this code
self.myTextField.keyboardType = UIKeyboardType.DecimalPad
When i launch my app on simulator ...
            
        
       
    
            133
            votes
        
        
            5
            answers
        
        
            30k
            views
        
    Vim users, where do you rest your right hand? [closed]
                Longtime vim users, do you keep your fingers onjkl; or hjkl in normal mode?
Standard touch typing teaches us the home position for the right hand has the index finger on the j key, so your fingers ...
            
        
       
    
            128
            votes
        
        
            21
            answers
        
        
            131k
            views
        
    How can I programmatically check whether a keyboard is present in iOS app?
                I need to check the condition of keyboard visibility in my iOS app.
Pseudocode:
if(keyboardIsPresentOnWindow) {
    //Do action 1
}
else if (keyboardIsNotPresentOnWindow) {
    //Do action 2
}
How ...
            
        
       
    
            127
            votes
        
        
            16
            answers
        
        
            184k
            views
        
    Check if a key is down?
                Is there a way to detect if a key is currently down in JavaScript?
I know about the "keydown" event, but that's not what I need. Some time AFTER the key is pressed, I want to be able to detect if it ...
            
        
       
    
            122
            votes
        
        
            18
            answers
        
        
            89k
            views
        
    iPhone Keyboard Covers UITextField
                I have an app where, in Interface Builder, I set up a UIView that has a text field near the bottom of the view.  When I run the app and try to enter text into that field, the keyboard slides up ...
            
        
       
    
            121
            votes
        
        
            20
            answers
        
        
            195k
            views
        
    How to dismiss keyboard iOS programmatically when pressing return
                I created a UITextField programmatically making the UITextField a property of the viewController. I need to dismiss the keyboard with the return and the touch on the screen. I was able to get the ...
            
        
       
    
            118
            votes
        
        
            5
            answers
        
        
            91k
            views
        
    How can I check if a key is pressed during the click event with jQuery?
                I would like to catch a click event with jQuery and be able to tell if a key was pressed at the same time so I can fork within the callback function based on the keypress event.
For example:
$("...
            
        
       
    
            117
            votes
        
        
            31
            answers
        
        
            80k
            views
        
    Not able to type in textfield in iphone simulator using Mac Keyboard?
                I'm working on a basic iOS app which supports both portrait and landscape modes. When the iPhone simulator keyboard is open in landscape and I'm switching the app to portrait mode I'm unable to type ...
            
        
       
    
            112
            votes
        
        
            4
            answers
        
        
            110k
            views
        
    How to develop a soft keyboard for Android? [closed]
                I would like to play around with some ideas and develop a soft keyboard for Android to replace the default one.
Is there any general information about soft keyboard development for Android out there? ...
            
        
       
    
            111
            votes
        
        
            9
            answers
        
        
            87k
            views
        
    How to remove auto focus/keyboard popup of a field when the screen shows up?
                I have a screen where the first field is an EditText, and it gains the focus at startup, also popups the numeric input type, which is very annoying
How can I make sure that when the activity is ...
            
        
       
    
            110
            votes
        
        
            8
            answers
        
        
            179k
            views
        
    How to force keyboard with numbers in mobile website in Android
                I have a mobile website and it has some HTML input elements in it, like this:
<input type="text" name="txtAccessoryCost" size="6" />
I have embedded the site into a WebView for possible ...
            
        
       
    
            109
            votes
        
        
            6
            answers
        
        
            248k
            views
        
    How do I detect keypresses in Javascript?
                After looking around on the internet, I've seen a lot of suggestions (use window.onkeypress, use jQuery, etc.) but for almost every option there's a counterargument. How can I  detect a keypress in ...
            
        
       
    
            103
            votes
        
        
            9
            answers
        
        
            164k
            views
        
    prevent mobile default keyboard when focusing an <input> from showing
                this is how i'm trying
<script type="text/javascript">
  $(document).ready(function(){
    $('#dateIn,#dateOut').click(function(e){
      e.preventDefault();
    }); 
  });
</script&...
            
        
       
    
            102
            votes
        
        
            8
            answers
        
        
            146k
            views
        
    Use "ENTER" key on softkeyboard instead of clicking button
                Hello
I've got a searched EditText and search Button. When I type the searched text, I'd like to use ENTER key on softkeyboard instead of search Button to activate search function.
Thanks for help in ...
            
        
       
    
            102
            votes
        
        
            8
            answers
        
        
            135k
            views
        
    Where can I find a list of Mac virtual key codes?
                I'm using CGEventCreateKeyboardEvent and need to know what CGKeyCode values to use.
Specifically, I am after the key code for the Command key. The docs give examples for other keys: z is 6, shift is ...
            
        
       
    
            100
            votes
        
        
            4
            answers
        
        
            106k
            views
        
    How to detect when a TextField is selected in Flutter?
                I have a Flutter TextField which gets covered by the soft keyboard when the field is selected. I need to scroll the field up and out of the way when the keyboard is displayed. This is a pretty common ...
            
        
       
    
            99
            votes
        
        
            20
            answers
        
        
            104k
            views
        
    Automatic popping up keyboard on start Activity
                I got a relative simple question. I have an activity with a lot of EditText's in them. When I open the activity it automatically focusses to the first EditText and displays the virtual keyboard.
How ...
            
        
       
    
            99
            votes
        
        
            23
            answers
        
        
            54k
            views
        
    Really weird eclipse keyboard behavior/bug?
                I am using Helios on Mac Snow Leopard. I don't know why but all of a sudden my arrow keys and delete button start not working only on Eclipse (so Eclipse ignores them) but the rest of the buttons ...
            
        
       
    
            94
            votes
        
        
            7
            answers
        
        
            69k
            views
        
    Programmatically align a toolbar on top of the iPhone keyboard
                In several cases I want to add a toolbar to the top of the iPhone keyboard (as in iPhone Safari when you're navigating form elements, for example).  
Currently I am specifying the toolbar's rectangle ...
            
        
       
    
            90
            votes
        
        
            15
            answers
        
        
            199k
            views
        
    Handling key-press events (F1-F12) using JavaScript and jQuery, cross-browser
                I want to handle F1-F12 keys using JavaScript and jQuery.
I am not sure what pitfalls there are to avoid, and I am not currently able to test implementations in any other browsers than Internet ...