Simple iOS_8 _ keyboard processing and ios_8 keyboard processing

Source: Internet
Author: User

Simple iOS_8 _ keyboard processing and ios_8 keyboard processing

Finally:





BeyondViewController. h

//// BeyondViewController. h // 9 _ Simple keyboard processing /// Created by beyond on 14-7-25. // Copyright (c) 2014 com. beyond. all rights reserved. // # import <span style = "font-family: Arial, Helvetica, sans-serif;"> <UIKit/UIKit. h> </span> @ interface BeyondViewController: UIViewController-(IBAction) exitKeyboard :( UIButton *) sender; @ end </uikit>





BeyondViewController. m

//// BeyondViewController. m // 9 _ keyboard simple processing/* problems: 1. the pop-up keyboard may cover the controls on the interface. Solution: Use scrollView, or, dynamically reduce the Y value of the control (move above) 2. Click events of the two buttons on the toolBar, which have not yet been implemented * // Created by beyond on 14-7-25. // Copyright (c) 2014 com. beyond. all rights reserved. // # import "BeyondViewController. h "@ interface BeyondViewController () {// attached toolBar UIToolbar * _ toolBar on the keyboard;} @ end @ implementation BeyondViewController-(void) viewDidLoad {[super viewDidLoad]; // Add a toolbar [self addToolBarForKeyboard] for all keyboards;} // Add a toolbar for all keyboards-(void) addToolBarForKeyboard {// load xib for mainBundel without specifying the extension. xib NSArray * arrayXibObjects = [[NSBundle mainBundle] loadNibNamed: @ "KeyToolBar" owner: nil options: nil]; // KeyToolBar _ toolBar = arrayXibObjects [0]; // self. set toolBar NSArray * array = self. view. subviews; for (UIView * obj in array) {if ([obj isKindOfClass: [UITextField class]) {// Why do I want to convert it better, because the attribute inputAccessoryView of UIView is readOnly UITextField * obj2 = (UITextField *) obj; obj2.inputAccessoryView = _ toolBar;} // It is the 1st UIToolbarTextButton (the previous button) in the toolBar) add a click event // [[_ toolBar. subviews firstObject] addTarget: self action: @ selector (previuskeyboard :) forControlEvents: UIControlEventTouchUpInside]; // Add a click event for the 2nd UIToolbarTextButton (Next button) in the toolBar // [_ toolBar. subviews objectAtIndex: 2] addTarget: self action: @ selector (nextKeyboard :) forControlEvents: UIControlEventTouchUpInside]; // Add the click event [[_ toolBar. subviews lastObject] addTarget: self action: @ selector (exitKeyboard :) forControlEvents: UIControlEventTouchUpInside];} // In the toolBar, click the previous button-(void) previuskeyboard :( UIButton *) sender {NSLog (@ "click the previous button to activate the previous input box");} // In the toolBar, click the next button-(void) nextKeyboard :( UIButton *) sender {NSLog (@ "click the next button to activate the next input box");} // exit the keyboard-(IBAction) exitKeyboard :( UIButton *) sender {// Method 1: self. all text boxes inside the view (including child widgets ...) both quit the first responder [self. view endEditing: YES]; return; // Method 2: // traverse all controls in the uiview, resignFirstResponder/* for (int I = 0; I <self. view. subviews. count; I ++) {[self. view. subviews [I] resignFirstResponder];} */NSArray * array = self. view. subviews; for (UIView * obj in array) {if ([obj isKindOfClass: [UITextField class]) {[obj resignFirstResponder]; }}// method 3: // In self. at the beginning of the view, a full-screen transparent button is laid and connected. After you click in the blank area of the screen, you can call method 1 above to exit the keyboard} @ end




KeyToolBar. xib



















What is the simple usage on the keyboard?

I. general keyboard shortcuts

Key objective
Ctrl + C copy.
Ctrl + X cut.
Ctrl + V paste.
Ctrl + Z undo.
DELETE.
Shift + Delete permanently deletes the selected option, instead of placing it in the recycle bin.
Press CTRL to copy the selected item.
When you drag an item, press CTRL + SHIFT to create the shortcut key of the option.
F2 renames the selected project.
CTRL + right click to move the insert point to the start of the next word.
CTRL + Left click to move the insertion point to the start point of the previous word.
Press CTRL + down to move the insertion point to the starting position of the next segment.
CTRL + The up key moves the insert point to the beginning of the previous paragraph.
CTRL + SHIFT + any arrow key to highlight a piece of text.
SHIFT + any arrow keys in the window or desktop, or select the text in the document.
Ctrl + A select all content.
F3 searches for files or folders.
Alt + Enter to view the properties of the selected item.
Alt + F4 close the current project or exit the current program.
ALT + Enter displays the properties of the selected object.
Alt + Space key opens a shortcut menu for the current window.
Ctrl + F4 close the current document in a program that allows multiple documents to be opened at the same time.
Alt + Tab switch between open projects.
Alt + Esc switches cyclically in the order that the project is opened.
F6 cyclically switches screen elements in a window or on the desktop.
F4 displays the address column list in "My Computer" and "Windows Resource Manager.
Shift + F10 shows the shortcut menu of the selected item.
Alt + Space key displays the "System" menu in the current window.
Press Ctrl + Esc to display the Start Menu.
ALT + the corresponding menu is displayed with an underscore in the menu name.
The command name displayed on the Open menu contains an underscore to execute the corresponding command.
F10 activates the menu bar in the current program.
Open the next menu on the right or submenu on the right.
Open the next menu on the left or close the sub-menu.
F5 refresh the current window.
BackSpace can view the previous folder in "My Computer" or "Windows Resource Manager.
Esc cancels the current task.
When you insert a disc into a CD-ROM drive, press SHIFT to prevent the disc from playing automatically.

2. Shortcut Keys in the dialog box

Key objective
Ctrl + Tab move forward between tabs.
Ctrl + Shift + Tab move backward between tabs.
Tab moves forward between options.
Shift + Tab move backward between options.
ALT + underlined letters to execute the corresponding command or select the corresponding option.
Enter.
Space key if the active option is a check box, select or clear the check box.
Select a button when the arrow button is a set of options.
F1 displays help.
F4 displays the items in the current list.
If a folder is selected in the "Save as" or "open" dialog box, the upper-level folder is opened.

3. keyboard shortcuts

On the Microsoft keyboard or other compatible keyboards that contain Windows logo keys (WIN for short) and application keys (KEY for short), you can use the following shortcut keys.

Key objective
WIN displays or hides the Start Menu.
The WIN + BREAK dialog box displays "System Properties.
WIN + D Display desktop.
WIN + M minimizes all windows.
Windows with WIN + Shift + M restoration minimized.
WIN + E Open "my... the remaining full text>

Simple keyboard operations

Windows shortcut keys

I. Common usage:
F1 displays the Help content of the current program or windows.
F2 when you select a file, this means "RENAME"
F3 when you are on the desktop, open the "Search: All Files" dialog box.
F10 or ALT activates the menu bar of the current program
Windows key or CTRL + ESC open Start Menu
CTRL + ALT + DELETE open the close program dialog box in win9x
DELETE deletes the selected project. If it is a file, it will be placed in the recycle bin.
SHIFT + DELETE the selected project. If it is a file, it will be deleted directly instead of placed in the recycle bin.
CTRL + N create a new file
CTRL + O open the "open file" dialog box
CTRL + P open the "print" dialog box
CTRL + S save the file for the current operation
CTRL + X cut the selected project to the clipboard
CTRL + INSERT or CTRL + C copy the selected project to the clipboard
SHIFT + INSERT or CTRL + V paste the content in the clipboard to the current position
ALT + BACKSPACE or CTRL + Z undo the previous operation
ALT + SHIFT + BACKSPACE redo the Undo operation in the previous step
Windows key + M minimizes all opened Windows.
Windows key + CTRL + M restore the size and position of the window before the previous operation
Windows key + E Open Resource Manager
Windows key + F open the "Search: All Files" dialog box
Windows key + R open the "run" dialog box
Windows key + BREAK open "System Properties" dialog box
Windows key + CTRL + F open the "Search: Computer" dialog box
SHIFT + F10 or right-click to open the shortcut menu of the current active project
You can skip automatic playback of the CD by pressing SHIFT when it is placed on the CD. When you open the word, you can press it to skip the auto-start macro.

ALT + F4 close the current application
ALT + SPACEBAR open the menu at the top left corner of the program
ALT + TAB switch current program
ALT + ESC switch current program
ALT + ENTER switch the MSDOS window running in windows between the window and the full screen status
Print screen copies the current SCREEN to the clipboard as an image
ALT + print screen copies the current active program window to the clipboard in image mode
CTRL + F4 close the current text in the current application (such as in word)
CTRL + F6 switch to the next text in the current application (add shift to jump to the previous window)

In IE:

ALT + right arrow displays the previous page (forward key)
ALT + left arrow display the last page (Back key)
CTRL + TAB switch in various frameworks on the page (add shift to reverse)
F5 refresh
CTRL + F5 force refresh
Destination shortcut

Activate menu bar F10 in the program

Execute the corresponding command ALT + underlined letters on the menu

Disable

Front window CTRL + F4

Close the current window or exit the program ALT + F4

Copy CTRL + C

Cut CTRL + X... the remaining full text>

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.