This relates generally to electronic devices with input devices such as touch-sensitive surfaces, including but not limited to electronic devices that use gesture recognition techniques to process inputs.
Input devices such as touch-sensitive surfaces are widely used to provide input to electronic devices to manipulate user interfaces and objects therein on a display. But conventional methods for performing these manipulations are cumbersome, inefficient, and limited. In some cases, conventional methods of processing inputs are limited in functionality with respect to the complexity and number of inputs that can be recognized. In some cases, conventional methods of processing inputs impose increased computational load on the electronic device as the complexity and number of inputs that must be recognized increases. In addition, conventional methods take longer than necessary, thereby wasting energy. This latter consideration is particularly important in battery-operated devices.
Accordingly, there is a need for electronic devices with improved methods and interfaces for processing inputs and recognizing gestures. Such methods and interfaces optionally complement or replace conventional methods for processing inputs and recognizing gestures. Such methods and interfaces reduce the number, extent, and/or nature of the inputs from a user and produce a more efficient human-machine interface. For battery-operated devices, such methods and interfaces conserve power and increase the time between battery charges.
The above deficiencies and other problems associated with user interfaces for electronic devices with touch-sensitive surfaces are reduced or eliminated by the disclosed devices. In some embodiments, the device is a desktop computer. In some embodiments, the device is portable (e.g., a notebook computer, tablet computer, or handheld device). In some embodiments, the device is a personal electronic device (e.g., a wearable electronic device, such as a watch). In some embodiments, the device has a touchpad. In some embodiments, the device has a touch-sensitive display (also known as a “touch screen” or “touch-screen display”). In some embodiments, the device has a graphical user interface (GUI), one or more processors, memory and one or more modules, programs or sets of instructions stored in the memory for performing multiple functions. In some embodiments, the user interacts with the GUI primarily through stylus and/or finger contacts and gestures on the touch-sensitive surface. In some embodiments, the functions optionally include image editing, drawing, presenting, word processing, spreadsheet making, game playing, telephoning, video conferencing, e-mailing, instant messaging, workout support, digital photographing, digital videoing, web browsing, digital music playing, note taking, and/or digital video playing. Executable instructions for performing these functions are, optionally, included in a non-transitory computer readable storage medium or other computer program product configured for execution by one or more processors.
In accordance with some embodiments, a method is performed at an electronic device with an input device. The method includes detecting an input via the input device, and, in response to detecting the input, monitoring the input using a gesture recognizer. The gesture recognizer includes a plurality of component gesture recognizers that define requirements for recognition of a gesture. A first component gesture recognizer from the plurality of component gesture recognizers defines a first requirement for recognition of the gesture, and a second component gesture recognizer from the plurality of component gesture recognizers defines a second requirement for recognition of the gesture. The method includes, in accordance with a determination that the input satisfies first gesture recognition criteria that include the first requirement of the first component gesture recognizer and the second requirement of the second component gesture recognizer, recognizing a first gesture using the gesture recognizer.
In accordance with some embodiments, a method is performed at an electronic device with a display and an input device. The method includes displaying, on the display, a user interface of an application. The user interface includes a plurality of views arranged in a view hierarchy. The view hierarchy defines a first relationship between a first view and a second view. The first view includes a first gesture recognizer, and the second view includes a second gesture recognizer. The method includes detecting, via the input device, an input at a first location that corresponds to the displayed user interface, and processing the input using a gesture recognition hierarchy that includes the first gesture recognizer and the second gesture recognizer. A second relationship between the first gesture recognizer and the second gesture recognizer is determined based on the first relationship between the first view and the second view in the view hierarchy.
In accordance with some embodiments, a method is performed at an electronic device with an input device. The method includes detecting an input via the input device, and, in response to detecting the input, monitoring the input using a gesture recognition tree having a plurality of nodes. Each respective node of the gesture recognition tree corresponds to a respective gesture recognizer or a respective component gesture recognizer, and one or more nodes include one or more parameters that describe the input. Monitoring the input using the gesture recognition tree includes: processing the input using a first node of the plurality of nodes, including determining a value of a first parameter of the one or more parameters; conveying the first parameter from the first node to a second node of the plurality of nodes; and processing the input using the second node, including determining, based on the first parameter, whether the input satisfies a gesture recognition requirement defined by the second node.
In accordance with some embodiments, an electronic device includes a display, a touch-sensitive surface, optionally one or more sensors to detect intensities of contacts with the touch-sensitive surface, optionally one or more tactile output generators, one or more processors, and memory storing one or more programs; the one or more programs are configured to be executed by the one or more processors and the one or more programs include instructions for performing or causing performance of the operations of any of the methods described herein. In accordance with some embodiments, a computer readable storage medium has stored therein instructions, which, when executed by an electronic device with a display, a touch-sensitive surface, optionally one or more sensors to detect intensities of contacts with the touch-sensitive surface, and optionally one or more tactile output generators, cause the device to perform or cause performance of the operations of any of the methods described herein. In accordance with some embodiments, a graphical user interface on an electronic device with a display, a touch-sensitive surface, optionally one or more sensors to detect intensities of contacts with the touch-sensitive surface, optionally one or more tactile output generators, a memory, and one or more processors to execute one or more programs stored in the memory includes one or more of the elements displayed in any of the methods described herein, which are updated in response to inputs, as described in any of the methods described herein. In accordance with some embodiments, an electronic device includes: a display, a touch-sensitive surface, optionally one or more sensors to detect intensities of contacts with the touch-sensitive surface, and optionally one or more tactile output generators; and means for performing or causing performance of the operations of any of the methods described herein. In accordance with some embodiments, an information processing apparatus, for use in an electronic device with a display, a touch-sensitive surface, optionally one or more sensors to detect intensities of contacts with the touch-sensitive surface, and optionally one or more tactile output generators, includes means for performing or causing performance of the operations of any of the methods described herein.
Thus, electronic devices with displays, touch-sensitive surfaces, optionally one or more sensors to detect intensities of contacts with the touch-sensitive surface, optionally one or more tactile output generators, optionally one or more device orientation sensors, and optionally an audio system, are provided with improved methods and interfaces for processing inputs and recognizing gestures, thereby increasing the effectiveness, efficiency, and user satisfaction with such devices. Such methods and interfaces may complement or replace conventional methods for processing inputs and recognizing gestures.
For a better understanding of the various described embodiments, reference should be made to the Description of Embodiments below, in conjunction with the following drawings in which like reference numerals refer to corresponding parts throughout the figures.
Many electronic devices have graphical user interface and input devices, such as touch-sensitive surfaces, for receiving inputs by a user. As the number and complexity of input gestures increases, processing inputs and recognizing such gestures becomes more difficult and imposes greater computational loads on electronic devices that use conventional gesture recognition techniques. The embodiments disclosed herein provide more efficient ways for an electronic device to process inputs and recognize gestures (e.g., using modular gesture recognizers that divide larger sets of input processing requirements into smaller subsets).
Below,
Reference will now be made in detail to embodiments, examples of which are illustrated in the accompanying drawings. In the following detailed description, numerous specific details are set forth in order to provide a thorough understanding of the various described embodiments. However, it will be apparent to one of ordinary skill in the art that the various described embodiments may be practiced without these specific details. In other instances, well-known methods, procedures, components, circuits, and networks have not been described in detail so as not to unnecessarily obscure aspects of the embodiments.
It will also be understood that, although the terms first, second, etc. are, in some instances, used herein to describe various elements, these elements should not be limited by these terms. These terms are only used to distinguish one element from another. For example, a first contact could be termed a second contact, and, similarly, a second contact could be termed a first contact, without departing from the scope of the various described embodiments. The first contact and the second contact are both contacts, but they are not the same contact, unless the context clearly indicates otherwise.
The terminology used in the description of the various described embodiments herein is for the purpose of describing particular embodiments only and is not intended to be limiting. As used in the description of the various described embodiments and the appended claims, the singular forms “a,” “an,” and “the” are intended to include the plural forms as well, unless the context clearly indicates otherwise. It will also be understood that the term “and/or” as used herein refers to and encompasses any and all possible combinations of one or more of the associated listed items. It will be further understood that the terms “includes,” “including,” “comprises,” and/or “comprising,” when used in this specification, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof.
As used herein, the term “if” is, optionally, construed to mean “when” or “upon” or “in response to determining” or “in response to detecting,” depending on the context. Similarly, the phrase “if it is determined” or “if [a stated condition or event] is detected” is, optionally, construed to mean “upon determining” or “in response to determining” or “upon detecting [the stated condition or event]” or “in response to detecting [the stated condition or event],” depending on the context.
Embodiments of electronic devices, user interfaces for such devices, and associated processes for using such devices are described. In some embodiments, the device is a portable communications device, such as a mobile telephone, that also contains other functions, such as PDA and/or music player functions. Example embodiments of portable multifunction devices include, without limitation, the iPhone®, iPod Touch®, and iPad® devices from Apple Inc. of Cupertino, Calif. Other portable electronic devices, such as laptops or tablet computers with touch-sensitive surfaces (e.g., touch-screen displays and/or touchpads), are, optionally, used. It should also be understood that, in some embodiments, the device is not a portable communications device, but is a desktop computer with a touch-sensitive surface (e.g., a touch-screen display and/or a touchpad).
In the discussion that follows, an electronic device that includes a display and a touch-sensitive surface is described. It should be understood, however, that the electronic device optionally includes one or more other physical user-interface devices, such as a physical keyboard, a mouse and/or a joystick.
The device typically supports a variety of applications, such as one or more of the following: a note taking application, a drawing application, a presentation application, a word processing application, a website creation application, a disk authoring application, a spreadsheet application, a gaming application, a telephone application, a video conferencing application, an e-mail application, an instant messaging application, a workout support application, a photo management application, a digital camera application, a digital video camera application, a web browsing application, a digital music player application, and/or a digital video player application.
The various applications that are executed on the device optionally use at least one common physical user-interface device, such as the touch-sensitive surface. One or more functions of the touch-sensitive surface as well as corresponding information displayed on the device are, optionally, adjusted and/or varied from one application to the next and/or within a respective application. In this way, a common physical architecture (such as the touch-sensitive surface) of the device optionally supports the variety of applications with user interfaces that are intuitive and transparent to the user.
Attention is now directed toward embodiments of portable devices with touch-sensitive displays.
As used in the specification and claims, the term “tactile output” refers to physical displacement of a device relative to a previous position of the device, physical displacement of a component (e.g., a touch-sensitive surface) of a device relative to another component (e.g., housing) of the device, or displacement of the component relative to a center of mass of the device that will be detected by a user with the user's sense of touch. For example, in situations where the device or the component of the device is in contact with a surface of a user that is sensitive to touch (e.g., a finger, palm, or other part of a user's hand), the tactile output generated by the physical displacement will be interpreted by the user as a tactile sensation corresponding to a perceived change in physical characteristics of the device or the component of the device. For example, movement of a touch-sensitive surface (e.g., a touch-sensitive display or trackpad) is, optionally, interpreted by the user as a “down click” or “up click” of a physical actuator button. In some cases, a user will feel a tactile sensation such as an “down click” or “up click” even when there is no movement of a physical actuator button associated with the touch-sensitive surface that is physically pressed (e.g., displaced) by the user's movements. As another example, movement of the touch-sensitive surface is, optionally, interpreted or sensed by the user as “roughness” of the touch-sensitive surface, even when there is no change in smoothness of the touch-sensitive surface. While such interpretations of touch by a user will be subject to the individualized sensory perceptions of the user, there are many sensory perceptions of touch that are common to a large majority of users. Thus, when a tactile output is described as corresponding to a particular sensory perception of a user (e.g., an “up click,” a “down click,” “roughness”), unless otherwise stated, the generated tactile output corresponds to physical displacement of the device or a component thereof that will generate the described sensory perception for a typical (or average) user. Using tactile outputs to provide haptic feedback to a user enhances the operability of the device and makes the user-device interface more efficient (e.g., by helping the user to provide proper inputs and reducing user mistakes when operating/interacting with the device) which, additionally, reduces power usage and improves battery life of the device by enabling the user to use the device more quickly and efficiently.
In some embodiments, a tactile output pattern specifies characteristics of a tactile output, such as the amplitude of the tactile output, the shape of a movement waveform of the tactile output, the frequency of the tactile output, and/or the duration of the tactile output.
When tactile outputs with different tactile output patterns are generated by a device (e.g., via one or more tactile output generators that move a moveable mass to generate tactile outputs), the tactile outputs may invoke different haptic sensations in a user holding or touching the device. While the sensation of the user is based on the user's perception of the tactile output, most users will be able to identify changes in waveform, frequency, and amplitude of tactile outputs generated by the device. Thus, the waveform, frequency and amplitude can be adjusted to indicate to the user that different operations have been performed. As such, tactile outputs with tactile output patterns that are designed, selected, and/or engineered to simulate characteristics (e.g., size, material, weight, stiffness, smoothness, etc.); behaviors (e.g., oscillation, displacement, acceleration, rotation, expansion, etc.); and/or interactions (e.g., collision, adhesion, repulsion, attraction, friction, etc.) of objects in a given environment (e.g., a user interface that includes graphical features and objects, a simulated physical environment with virtual boundaries and virtual objects, a real physical environment with physical boundaries and physical objects, and/or a combination of any of the above) will, in some circumstances, provide helpful feedback to users that reduces input errors and increases the efficiency of the user's operation of the device. Additionally, tactile outputs are, optionally, generated to correspond to feedback that is unrelated to a simulated physical characteristic, such as an input threshold or a selection of an object. Such tactile outputs will, in some circumstances, provide helpful feedback to users that reduces input errors and increases the efficiency of the user's operation of the device.
In some embodiments, a tactile output with a suitable tactile output pattern serves as a cue for the occurrence of an event of interest in a user interface or behind the scenes in a device. Examples of the events of interest include activation of an affordance (e.g., a real or virtual button, or toggle switch) provided on the device or in a user interface, success or failure of a requested operation, reaching or crossing a boundary in a user interface, entry into a new state, switching of input focus between objects, activation of a new mode, reaching or crossing an input threshold, detection or recognition of a type of input or gesture, etc. In some embodiments, tactile outputs are provided to serve as a warning or an alert for an impending event or outcome that would occur unless a redirection or interruption input is timely detected. Tactile outputs are also used in other contexts to enrich the user experience, improve the accessibility of the device to users with visual or motor difficulties or other accessibility needs, and/or improve efficiency and functionality of the user interface and/or the device. Tactile outputs are optionally accompanied with audio outputs and/or visible user interface changes, which further enhance a user's experience when the user interacts with a user interface and/or the device, and facilitate better conveyance of information regarding the state of the user interface and/or the device, and which reduce input errors and increase the efficiency of the user's operation of the device.
It should be appreciated that device 100 is only one example of a portable multifunction device, and that device 100 optionally has more or fewer components than shown, optionally combines two or more components, or optionally has a different configuration or arrangement of the components. The various components shown in
Memory 102 optionally includes high-speed random access memory and optionally also includes non-volatile memory, such as one or more magnetic disk storage devices, flash memory devices, or other non-volatile solid-state memory devices. Access to memory 102 by other components of device 100, such as CPU(s) 120 and the peripherals interface 118, is, optionally, controlled by memory controller 122.
Peripherals interface 118 can be used to couple input and output peripherals of the device to CPU(s) 120 and memory 102. The one or more processors 120 run or execute various software programs and/or sets of instructions stored in memory 102 to perform various functions for device 100 and to process data.
In some embodiments, peripherals interface 118, CPU(s) 120, and memory controller 122 are, optionally, implemented on a single chip, such as chip 104. In some other embodiments, they are, optionally, implemented on separate chips.
RF (radio frequency) circuitry 108 receives and sends RF signals, also called electromagnetic signals. RF circuitry 108 converts electrical signals to/from electromagnetic signals and communicates with communications networks and other communications devices via the electromagnetic signals. RF circuitry 108 optionally includes well-known circuitry for performing these functions, including but not limited to an antenna system, an RF transceiver, one or more amplifiers, a tuner, one or more oscillators, a digital signal processor, a CODEC chipset, a subscriber identity module (SIM) card, memory, and so forth. RF circuitry 108 optionally communicates with networks, such as the Internet, also referred to as the World Wide Web (WWW), an intranet and/or a wireless network, such as a cellular telephone network, a wireless local area network (LAN) and/or a metropolitan area network (MAN), and other devices by wireless communication. The wireless communication optionally uses any of a plurality of communications standards, protocols and technologies, including but not limited to Global System for Mobile Communications (GSM), Enhanced Data GSM Environment (EDGE), high-speed downlink packet access (HSDPA), high-speed uplink packet access (HSUPA), Evolution, Data-Only (EV-DO), HSPA, HSPA+, Dual-Cell HSPA (DC-HSPA), long term evolution (LTE), near field communication (NFC), wideband code division multiple access (W-CDMA), code division multiple access (CDMA), time division multiple access (TDMA), Bluetooth, Wireless Fidelity (Wi-Fi) (e.g., IEEE 802.11a, IEEE 802.11ac, IEEE 802.11ax, IEEE 802.11b, IEEE 802.11g and/or IEEE 802.11n), voice over Internet Protocol (VoIP), Wi-MAX, a protocol for e-mail (e.g., Internet message access protocol (IMAP) and/or post office protocol (POP)), instant messaging (e.g., extensible messaging and presence protocol (XMPP), Session Initiation Protocol for Instant Messaging and Presence Leveraging Extensions (SIMPLE), Instant Messaging and Presence Service (IMPS)), and/or Short Message Service (SMS), or any other suitable communication protocol, including communication protocols not yet developed as of the filing date of this document.
Audio circuitry 110, speaker 111, and microphone 113 provide an audio interface between a user and device 100. Audio circuitry 110 receives audio data from peripherals interface 118, converts the audio data to an electrical signal, and transmits the electrical signal to speaker 111. Speaker 111 converts the electrical signal to human-audible sound waves. Audio circuitry 110 also receives electrical signals converted by microphone 113 from sound waves. Audio circuitry 110 converts the electrical signal to audio data and transmits the audio data to peripherals interface 118 for processing. Audio data is, optionally, retrieved from and/or transmitted to memory 102 and/or RF circuitry 108 by peripherals interface 118. In some embodiments, audio circuitry 110 also includes a headset jack (e.g., 212,
I/O subsystem 106 couples input/output peripherals on device 100, such as touch-sensitive display system 112 and other input or control devices 116, with peripherals interface 118. I/O subsystem 106 optionally includes display controller 156, optical sensor controller 158, intensity sensor controller 159, haptic feedback controller 161, and one or more input controllers 160 for other input or control devices. The one or more input controllers 160 receive/send electrical signals from/to other input or control devices 116. The other input or control devices 116 optionally include physical buttons (e.g., push buttons, rocker buttons, etc.), dials, slider switches, joysticks, click wheels, and so forth. In some alternate embodiments, input controller(s) 160 are, optionally, coupled with any (or none) of the following: a keyboard, infrared port, USB port, stylus, and/or a pointer device such as a mouse. The one or more buttons (e.g., 208,
Touch-sensitive display system 112 provides an input interface and an output interface between the device and a user. Display controller 156 receives and/or sends electrical signals from/to touch-sensitive display system 112. Touch-sensitive display system 112 displays visual output to the user. The visual output optionally includes graphics, text, icons, video, and any combination thereof (collectively termed “graphics”). In some embodiments, some or all of the visual output corresponds to user interface objects. As used herein, the term “affordance” refers to a user-interactive graphical user interface object (e.g., a graphical user interface object that is configured to respond to inputs directed toward the graphical user interface object). Examples of user-interactive graphical user interface objects include, without limitation, a button, slider, icon, selectable menu item, switch, hyperlink, or other user interface control.
Touch-sensitive display system 112 has a touch-sensitive surface, sensor or set of sensors that accepts input from the user based on haptic and/or tactile contact. Touch-sensitive display system 112 and display controller 156 (along with any associated modules and/or sets of instructions in memory 102) detect contact (and any movement or breaking of the contact) on touch-sensitive display system 112 and converts the detected contact into interaction with user-interface objects (e.g., one or more soft keys, icons, web pages or images) that are displayed on touch-sensitive display system 112. In some embodiments, a point of contact between touch-sensitive display system 112 and the user corresponds to a finger of the user or a stylus.
Touch-sensitive display system 112 optionally uses LCD (liquid crystal display) technology, LPD (light emitting polymer display) technology, or LED (light emitting diode) technology, although other display technologies are used in other embodiments. Touch-sensitive display system 112 and display controller 156 optionally detect contact and any movement or breaking thereof using any of a plurality of touch sensing technologies now known or later developed, including but not limited to capacitive, resistive, infrared, and surface acoustic wave technologies, as well as other proximity sensor arrays or other elements for determining one or more points of contact with touch-sensitive display system 112. In some embodiments, projected mutual capacitance sensing technology is used, such as that found in the iPhone®, iPod Touch®, and iPad® from Apple Inc. of Cupertino, Calif.
Touch-sensitive display system 112 optionally has a video resolution in excess of 100 dpi. In some embodiments, the touch screen video resolution is in excess of 400 dpi (e.g., 500 dpi, 800 dpi, or greater). The user optionally makes contact with touch-sensitive display system 112 using any suitable object or appendage, such as a stylus, a finger, and so forth. In some embodiments, the user interface is designed to work with finger-based contacts and gestures, which can be less precise than stylus-based input due to the larger area of contact of a finger on the touch screen. In some embodiments, the device translates the rough finger-based input into a precise pointer/cursor position or command for performing the actions desired by the user.
In some embodiments, in addition to the touch screen, device 100 optionally includes a touchpad (not shown) for activating or deactivating particular functions. In some embodiments, the touchpad is a touch-sensitive area of the device that, unlike the touch screen, does not display visual output. The touchpad is, optionally, a touch-sensitive surface that is separate from touch-sensitive display system 112 or an extension of the touch-sensitive surface formed by the touch screen.
Device 100 also includes power system 162 for powering the various components. Power system 162 optionally includes a power management system, one or more power sources (e.g., battery, alternating current (AC)), a recharging system, a power failure detection circuit, a power converter or inverter, a power status indicator (e.g., a light-emitting diode (LED)) and any other components associated with the generation, management and distribution of power in portable devices.
Device 100 optionally also includes one or more optical sensors 164.
Device 100 optionally also includes one or more contact intensity sensors 165.
Device 100 optionally also includes one or more proximity sensors 166.
Device 100 optionally also includes one or more tactile output generators 167.
Device 100 optionally also includes one or more accelerometers 168.
In some embodiments, the software components stored in memory 102 include operating system 126, communication module (or set of instructions) 128, contact/motion module (or set of instructions) 130, graphics module (or set of instructions) 132, haptic feedback module (or set of instructions) 133, text input module (or set of instructions) 134, Global Positioning System (GPS) module (or set of instructions) 135, and applications (or sets of instructions) 136. Furthermore, in some embodiments, memory 102 stores device/global internal state 157, as shown in
Operating system 126 (e.g., iOS, Darwin, RTXC, LINUX, UNIX, OS X, WINDOWS, or an embedded operating system such as VxWorks) includes various software components and/or drivers for controlling and managing general system tasks (e.g., memory management, storage device control, power management, etc.) and facilitates communication between various hardware and software components.
Communication module 128 facilitates communication with other devices over one or more external ports 124 and also includes various software components for handling data received by RF circuitry 108 and/or external port 124. External port 124 (e.g., Universal Serial Bus (USB), FIREWIRE, etc.) is adapted for coupling directly to other devices or indirectly over a network (e.g., the Internet, wireless LAN, etc.). In some embodiments, the external port is a multi-pin (e.g., 30-pin) connector that is the same as, or similar to and/or compatible with the 30-pin connector used in some iPhone®, iPod Touch®, and iPad® devices from Apple Inc. of Cupertino, Calif. In some embodiments, the external port is a Lightning connector that is the same as, or similar to and/or compatible with the Lightning connector used in some iPhone®, iPod Touch®, and iPad® devices from Apple Inc. of Cupertino, Calif.
Contact/motion module 130 optionally detects contact with touch-sensitive display system 112 (in conjunction with display controller 156) and other touch-sensitive devices (e.g., a touchpad or physical click wheel). Contact/motion module 130 includes various software components for performing various operations related to detection of contact (e.g., by a finger or by a stylus), such as determining if contact has occurred (e.g., detecting a finger-down event), determining an intensity of the contact (e.g., the force or pressure of the contact or a substitute for the force or pressure of the contact), determining if there is movement of the contact and tracking the movement across the touch-sensitive surface (e.g., detecting one or more finger-dragging events), and determining if the contact has ceased (e.g., detecting a finger-up event or a break in contact). Contact/motion module 130 receives contact data from the touch-sensitive surface. Determining movement of the point of contact, which is represented by a series of contact data, optionally includes determining speed (magnitude), velocity (magnitude and direction), and/or an acceleration (a change in magnitude and/or direction) of the point of contact. These operations are, optionally, applied to single contacts (e.g., one finger contacts or stylus contacts) or to multiple simultaneous contacts (e.g., “multitouch”/multiple finger contacts). In some embodiments, contact/motion module 130 and display controller 156 detect contact on a touchpad.
Contact/motion module 130 optionally detects a gesture input by a user. Different gestures on the touch-sensitive surface have different contact patterns (e.g., different motions, timings, and/or intensities of detected contacts). Thus, a gesture is, optionally, detected by detecting a particular contact pattern. For example, detecting a finger tap gesture includes detecting a finger-down event followed by detecting a finger-up (lift off) event at the same position (or substantially the same position) as the finger-down event (e.g., at the position of an icon). As another example, detecting a finger swipe gesture on the touch-sensitive surface includes detecting a finger-down event followed by detecting one or more finger-dragging events, and subsequently followed by detecting a finger-up (lift off) event. Similarly, tap, swipe, drag, and other gestures are optionally detected for a stylus by detecting a particular contact pattern for the stylus.
In some embodiments, detecting a finger tap gesture depends on the length of time between detecting the finger-down event and the finger-up event, but is independent of the intensity of the finger contact between detecting the finger-down event and the finger-up event. In some embodiments, a tap gesture is detected in accordance with a determination that the length of time between the finger-down event and the finger-up event is less than a predetermined value (e.g., less than 0.1, 0.2, 0.3, 0.4 or 0.5 seconds), independent of whether the intensity of the finger contact during the tap meets a given intensity threshold (greater than a nominal contact-detection intensity threshold), such as a light press or deep press intensity threshold. Thus, a finger tap gesture can satisfy particular input criteria that do not require that the characteristic intensity of a contact satisfy a given intensity threshold in order for the particular input criteria to be met. For clarity, the finger contact in a tap gesture typically needs to satisfy a nominal contact-detection intensity threshold, below which the contact is not detected, in order for the finger-down event to be detected. A similar analysis applies to detecting a tap gesture by a stylus or other contact. In cases where the device is capable of detecting a finger or stylus contact hovering over a touch sensitive surface, the nominal contact-detection intensity threshold optionally does not correspond to physical contact between the finger or stylus and the touch sensitive surface.
The same concepts apply in an analogous manner to other types of gestures. For example, a swipe gesture, a pinch gesture, a depinch gesture, and/or a long press gesture are optionally detected based on the satisfaction of criteria that are either independent of intensities of contacts included in the gesture, or do not require that contact(s) that perform the gesture reach intensity thresholds in order to be recognized. For example, a swipe gesture is detected based on an amount of movement of one or more contacts; a pinch gesture is detected based on movement of two or more contacts towards each other; a depinch gesture is detected based on movement of two or more contacts away from each other; and a long press gesture is detected based on a duration of the contact on the touch-sensitive surface with less than a threshold amount of movement. As such, the statement that particular gesture recognition criteria do not require that the intensity of the contact(s) meet a respective intensity threshold in order for the particular gesture recognition criteria to be met means that the particular gesture recognition criteria are capable of being satisfied if the contact(s) in the gesture do not reach the respective intensity threshold, and are also capable of being satisfied in circumstances where one or more of the contacts in the gesture do reach or exceed the respective intensity threshold. In some embodiments, a tap gesture is detected based on a determination that the finger-down and finger-up event are detected within a predefined time period, without regard to whether the contact is above or below the respective intensity threshold during the predefined time period, and a swipe gesture is detected based on a determination that the contact movement is greater than a predefined magnitude, even if the contact is above the respective intensity threshold at the end of the contact movement. Even in implementations where detection of a gesture is influenced by the intensity of contacts performing the gesture (e.g., the device detects a long press more quickly when the intensity of the contact is above an intensity threshold or delays detection of a tap input when the intensity of the contact is higher), the detection of those gestures does not require that the contacts reach a particular intensity threshold so long as the criteria for recognizing the gesture can be met in circumstances where the contact does not reach the particular intensity threshold (e.g., even if the amount of time that it takes to recognize the gesture changes).
Contact intensity thresholds, duration thresholds, and movement thresholds are, in some circumstances, combined in a variety of different combinations in order to create heuristics for distinguishing two or more different gestures directed to the same input element or region so that multiple different interactions with the same input element are enabled to provide a richer set of user interactions and responses. The statement that a particular set of gesture recognition criteria do not require that the intensity of the contact(s) meet a respective intensity threshold in order for the particular gesture recognition criteria to be met does not preclude the concurrent evaluation of other intensity-dependent gesture recognition criteria to identify other gestures that do have a criteria that is met when a gesture includes a contact with an intensity above the respective intensity threshold. For example, in some circumstances, first gesture recognition criteria for a first gesture—which do not require that the intensity of the contact(s) meet a respective intensity threshold in order for the first gesture recognition criteria to be met—are in competition with second gesture recognition criteria for a second gesture—which are dependent on the contact(s) reaching the respective intensity threshold. In such competitions, the gesture is, optionally, not recognized as meeting the first gesture recognition criteria for the first gesture if the second gesture recognition criteria for the second gesture are met first. For example, if a contact reaches the respective intensity threshold before the contact moves by a predefined amount of movement, a deep press gesture is detected rather than a swipe gesture. Conversely, if the contact moves by the predefined amount of movement before the contact reaches the respective intensity threshold, a swipe gesture is detected rather than a deep press gesture. Even in such circumstances, the first gesture recognition criteria for the first gesture still do not require that the intensity of the contact(s) meet a respective intensity threshold in order for the first gesture recognition criteria to be met because if the contact stayed below the respective intensity threshold until an end of the gesture (e.g., a swipe gesture with a contact that does not increase to an intensity above the respective intensity threshold), the gesture would have been recognized by the first gesture recognition criteria as a swipe gesture. As such, particular gesture recognition criteria that do not require that the intensity of the contact(s) meet a respective intensity threshold in order for the particular gesture recognition criteria to be met will (A) in some circumstances ignore the intensity of the contact with respect to the intensity threshold (e.g. for a tap gesture) and/or (B) in some circumstances still be dependent on the intensity of the contact with respect to the intensity threshold in the sense that the particular gesture recognition criteria (e.g., for a long press gesture) will fail if a competing set of intensity-dependent gesture recognition criteria (e.g., for a deep press gesture) recognize an input as corresponding to an intensity-dependent gesture before the particular gesture recognition criteria recognize a gesture corresponding to the input (e.g., for a long press gesture that is competing with a deep press gesture for recognition).
Graphics module 132 includes various known software components for rendering and displaying graphics on touch-sensitive display system 112 or other display, including components for changing the visual impact (e.g., brightness, transparency, saturation, contrast or other visual property) of graphics that are displayed. As used herein, the term “graphics” includes any object that can be displayed to a user, including without limitation text, web pages, icons (such as user-interface objects including soft keys), digital images, videos, animations and the like.
In some embodiments, graphics module 132 stores data representing graphics to be used. Each graphic is, optionally, assigned a corresponding code. Graphics module 132 receives, from applications etc., one or more codes specifying graphics to be displayed along with, if necessary, coordinate data and other graphic property data, and then generates screen image data to output to display controller 156.
Haptic feedback module 133 includes various software components for generating instructions (e.g., instructions used by haptic feedback controller 161) to produce tactile outputs using tactile output generator(s) 167 at one or more locations on device 100 in response to user interactions with device 100.
Text input module 134, which is, optionally, a component of graphics module 132, provides soft keyboards for entering text in various applications (e.g., contacts 137, e-mail 140, IM 141, browser 147, and any other application that needs text input).
GPS module 135 determines the location of the device and provides this information for use in various applications (e.g., to telephone 138 for use in location-based dialing, to camera 143 as picture/video metadata, and to applications that provide location-based services such as weather widgets, local yellow page widgets, and map/navigation widgets).
Applications 136 optionally include the following modules (or sets of instructions), or a subset or superset thereof:
Examples of other applications 136 that are, optionally, stored in memory 102 include other word processing applications, other image editing applications, drawing applications, presentation applications, JAVA-enabled applications, encryption, digital rights management, voice recognition, and voice replication.
In conjunction with touch-sensitive display system 112, display controller 156, contact module 130, graphics module 132, and text input module 134, contacts module 137 includes executable instructions to manage an address book or contact list (e.g., stored in application internal state 192 of contacts module 137 in memory 102 or memory 370), including: adding name(s) to the address book; deleting name(s) from the address book; associating telephone number(s), e-mail address(es), physical address(es) or other information with a name; associating an image with a name; categorizing and sorting names; providing telephone numbers and/or e-mail addresses to initiate and/or facilitate communications by telephone 138, video conference 139, e-mail 140, or IM 141; and so forth.
In conjunction with RF circuitry 108, audio circuitry 110, speaker 111, microphone 113, touch-sensitive display system 112, display controller 156, contact module 130, graphics module 132, and text input module 134, telephone module 138 includes executable instructions to enter a sequence of characters corresponding to a telephone number, access one or more telephone numbers in address book 137, modify a telephone number that has been entered, dial a respective telephone number, conduct a conversation and disconnect or hang up when the conversation is completed. As noted above, the wireless communication optionally uses any of a plurality of communications standards, protocols and technologies.
In conjunction with RF circuitry 108, audio circuitry 110, speaker 111, microphone 113, touch-sensitive display system 112, display controller 156, optical sensor(s) 164, optical sensor controller 158, contact module 130, graphics module 132, text input module 134, contact list 137, and telephone module 138, videoconferencing module 139 includes executable instructions to initiate, conduct, and terminate a video conference between a user and one or more other participants in accordance with user instructions.
In conjunction with RF circuitry 108, touch-sensitive display system 112, display controller 156, contact module 130, graphics module 132, and text input module 134, e-mail client module 140 includes executable instructions to create, send, receive, and manage e-mail in response to user instructions. In conjunction with image management module 144, e-mail client module 140 makes it very easy to create and send e-mails with still or video images taken with camera module 143.
In conjunction with RF circuitry 108, touch-sensitive display system 112, display controller 156, contact module 130, graphics module 132, and text input module 134, the instant messaging module 141 includes executable instructions to enter a sequence of characters corresponding to an instant message, to modify previously entered characters, to transmit a respective instant message (for example, using a Short Message Service (SMS) or Multimedia Message Service (MMS) protocol for telephony-based instant messages or using XMPP, SIMPLE, Apple Push Notification Service (APNs) or IMPS for Internet-based instant messages), to receive instant messages, and to view received instant messages. In some embodiments, transmitted and/or received instant messages optionally include graphics, photos, audio files, video files and/or other attachments as are supported in a MMS and/or an Enhanced Messaging Service (EMS). As used herein, “instant messaging” refers to both telephony-based messages (e.g., messages sent using SMS or MMS) and Internet-based messages (e.g., messages sent using XMPP, SIMPLE, APNs, or IMPS).
In conjunction with RF circuitry 108, touch-sensitive display system 112, display controller 156, contact module 130, graphics module 132, text input module 134, GPS module 135, map module 154, and video and music player module 152, workout support module 142 includes executable instructions to create workouts (e.g., with time, distance, and/or calorie burning goals); communicate with workout sensors (in sports devices and smart watches); receive workout sensor data; calibrate sensors used to monitor a workout; select and play music for a workout; and display, store and transmit workout data.
In conjunction with touch-sensitive display system 112, display controller 156, optical sensor(s) 164, optical sensor controller 158, contact module 130, graphics module 132, and image management module 144, camera module 143 includes executable instructions to capture still images or video (including a video stream) and store them into memory 102, modify characteristics of a still image or video, and/or delete a still image or video from memory 102.
In conjunction with touch-sensitive display system 112, display controller 156, contact module 130, graphics module 132, text input module 134, and camera module 143, image management module 144 includes executable instructions to arrange, modify (e.g., edit), or otherwise manipulate, label, delete, present (e.g., in a digital slide show or album), and store still and/or video images.
In conjunction with RF circuitry 108, touch-sensitive display system 112, display system controller 156, contact module 130, graphics module 132, and text input module 134, browser module 147 includes executable instructions to browse the Internet in accordance with user instructions, including searching, linking to, receiving, and displaying web pages or portions thereof, as well as attachments and other files linked to web pages.
In conjunction with RF circuitry 108, touch-sensitive display system 112, display system controller 156, contact module 130, graphics module 132, text input module 134, e-mail client module 140, and browser module 147, calendar module 148 includes executable instructions to create, display, modify, and store calendars and data associated with calendars (e.g., calendar entries, to do lists, etc.) in accordance with user instructions.
In conjunction with RF circuitry 108, touch-sensitive display system 112, display system controller 156, contact module 130, graphics module 132, text input module 134, and browser module 147, widget modules 149 are mini-applications that are, optionally, downloaded and used by a user (e.g., weather widget 149-1, stocks widget 149-2, calculator widget 149-3, alarm clock widget 149-4, and dictionary widget 149-5) or created by the user (e.g., user-created widget 149-6). In some embodiments, a widget includes an HTML (Hypertext Markup Language) file, a CSS (Cascading Style Sheets) file, and a JavaScript file. In some embodiments, a widget includes an XML (Extensible Markup Language) file and a JavaScript file (e.g., Yahoo! Widgets).
In conjunction with RF circuitry 108, touch-sensitive display system 112, display system controller 156, contact module 130, graphics module 132, text input module 134, and browser module 147, the widget creator module 150 includes executable instructions to create widgets (e.g., turning a user-specified portion of a web page into a widget).
In conjunction with touch-sensitive display system 112, display system controller 156, contact module 130, graphics module 132, and text input module 134, search module 151 includes executable instructions to search for text, music, sound, image, video, and/or other files in memory 102 that match one or more search criteria (e.g., one or more user-specified search terms) in accordance with user instructions.
In conjunction with touch-sensitive display system 112, display system controller 156, contact module 130, graphics module 132, audio circuitry 110, speaker 111, RF circuitry 108, and browser module 147, video and music player module 152 includes executable instructions that allow the user to download and play back recorded music and other sound files stored in one or more file formats, such as MP3 or AAC files, and executable instructions to display, present or otherwise play back videos (e.g., on touch-sensitive display system 112, or on an external display connected wirelessly or via external port 124). In some embodiments, device 100 optionally includes the functionality of an MP3 player, such as an iPod (trademark of Apple Inc.).
In conjunction with touch-sensitive display system 112, display controller 156, contact module 130, graphics module 132, and text input module 134, notes module 153 includes executable instructions to create and manage notes, to do lists, and the like in accordance with user instructions.
In conjunction with RF circuitry 108, touch-sensitive display system 112, display system controller 156, contact module 130, graphics module 132, text input module 134, GPS module 135, and browser module 147, map module 154 includes executable instructions to receive, display, modify, and store maps and data associated with maps (e.g., driving directions; data on stores and other points of interest at or near a particular location; and other location-based data) in accordance with user instructions.
In conjunction with touch-sensitive display system 112, display system controller 156, contact module 130, graphics module 132, audio circuitry 110, speaker 111, RF circuitry 108, text input module 134, e-mail client module 140, and browser module 147, online video module 155 includes executable instructions that allow the user to access, browse, receive (e.g., by streaming and/or download), play back (e.g., on the touch screen 112, or on an external display connected wirelessly or via external port 124), send an e-mail with a link to a particular online video, and otherwise manage online videos in one or more file formats, such as H.264. In some embodiments, instant messaging module 141, rather than e-mail client module 140, is used to send a link to a particular online video.
Each of the above identified modules and applications correspond to a set of executable instructions for performing one or more functions described above and the methods described in this application (e.g., the computer-implemented methods and other information processing methods described herein). These modules (i.e., sets of instructions) need not be implemented as separate software programs, procedures or modules, and thus various subsets of these modules are, optionally, combined or otherwise re-arranged in various embodiments. In some embodiments, memory 102 optionally stores a subset of the modules and data structures identified above. Furthermore, memory 102 optionally stores additional modules and data structures not described above.
In some embodiments, device 100 is a device where operation of a predefined set of functions on the device is performed exclusively through a touch screen and/or a touchpad. By using a touch screen and/or a touchpad as the primary input control device for operation of device 100, the number of physical input control devices (such as push buttons, dials, and the like) on device 100 is, optionally, reduced.
The predefined set of functions that are performed exclusively through a touch screen and/or a touchpad optionally include navigation between user interfaces. In some embodiments, the touchpad, when touched by the user, navigates device 100 to a main, home, or root menu from any user interface that is displayed on device 100. In such embodiments, a “menu button” is implemented using a touchpad. In some other embodiments, the menu button is a physical push button or other physical input control device instead of a touchpad.
Event sorter 170 receives event information and determines the application 136-1 and application view 191 of application 136-1 to which to deliver the event information. Event sorter 170 includes event monitor 171 and event dispatcher module 174. In some embodiments, application 136-1 includes application internal state 192, which indicates the current application view(s) displayed on touch-sensitive display system 112 when the application is active or executing. In some embodiments, device/global internal state 157 is used by event sorter 170 to determine which application(s) is (are) currently active, and application internal state 192 is used by event sorter 170 to determine application views 191 to which to deliver event information.
In some embodiments, application internal state 192 includes additional information, such as one or more of: resume information to be used when application 136-1 resumes execution, user interface state information that indicates information being displayed or that is ready for display by application 136-1, a state queue for enabling the user to go back to a prior state or view of application 136-1, and a redo/undo queue of previous actions taken by the user.
Event monitor 171 receives event information from peripherals interface 118. Event information includes information about a sub-event (sometimes referred to simply as an “event” or “input event”) (e.g., a user touch on touch-sensitive display system 112, as part of a multi-touch gesture, or a movement of a touch across touch-sensitive display system 112, or a press of a mouse button, etc.). Event information for an input (e.g., a touch) may include one or more of: a location, timestamp, direction, and speed of the input. Peripherals interface 118 transmits information it receives from I/O subsystem 106 (e.g., from touch-sensitive display system 112, one or more sensor(s) 164, 165, and/or one or more input devices 350, 355) or a sensor, such as proximity sensor 166, accelerometer(s) 168, and/or microphone 113 (through audio circuitry 110). Information that peripherals interface 118 receives from I/O subsystem 106 includes information from touch-sensitive display system 112 or a touch-sensitive surface.
In some embodiments, event monitor 171 sends requests to the peripherals interface 118 at predetermined intervals. In response, peripherals interface 118 transmits event information. In other embodiments, peripheral interface 118 transmits event information only when there is a significant event (e.g., receiving an input above a predetermined noise threshold and/or for more than a predetermined duration).
In some embodiments, event sorter 170 also includes a hit view determination module 172 and/or an active event recognizer determination module 173.
Hit view determination module 172 provides software procedures for determining where a sub-event has taken place within one or more views, when touch-sensitive display system 112 displays more than one view. Views are made up of controls and other elements that a user can see on the display.
Another aspect of the user interface associated with an application is a set of views, sometimes herein called application views or user interface windows, in which information is displayed and touch-based gestures occur. The application views (of a respective application) in which a touch is detected optionally correspond to programmatic levels within a programmatic or view hierarchy of the application. For example, the lowest level view in which a touch is detected is, optionally, called the hit view, and the set of events that are recognized as proper inputs are, optionally, determined based, at least in part, on the hit view of the initial touch that begins a touch-based gesture.
While a view is often thought of as being a window or other portion of a user interface, more technically a view is the portion of an application that manages a particular area or region of the application's user interface. A view is typically implemented as an instance of a particular class, or one of its subclasses, and manages a rectangular area in an application window. Thus, a view is an object having an associated display region or user interface portion, and also one or more computer programs, sometimes called “methods,” associated with the class of which the view is an instance. Views are responsible for drawing content, handling multitouch events, and managing the layout of any subviews. Drawing content involves using various graphics technologies to draw shapes, images, and text inside a view's rectangular area. A view responds to touch events in its rectangular area either by using gesture recognizers or by handling touch events directly. In the view hierarchy, parent views are responsible for positioning and sizing their child views and can do so dynamically. This ability to modify child views dynamically enables views to adjust to changing conditions, such as interface rotations and animations.
Views can be viewed as building blocks that a programmer or application developer uses to construct the user interface of an application. Rather than use one view to present all content for the application, several views are typically used to build a view hierarchy. Each view in the hierarchy presents a particular portion of the application's user interface and is often optimized for a specific type of content. For example, an application can have distinct views specifically for presenting images, text and other types of content.
Hit view determination module 172 receives information related to sub-events of a touch-based gesture. When an application has multiple views organized in a hierarchy, hit view determination module 172 identifies a hit view as the lowest view in the hierarchy which should handle the sub-event. In most circumstances, the hit view is the lowest level view in which an initiating sub-event occurs (i.e., the first sub-event in the sequence of sub-events that form an event or potential event). Once the hit view is identified by the hit view determination module, the hit view typically receives all sub-events related to the same touch or input source for which it was identified as the hit view.
Active event recognizer determination module 173 determines which view or views within a view hierarchy should receive a particular sequence of sub-events. In some embodiments, active event recognizer determination module 173 determines that only the hit view should receive a particular sequence of sub-events. In other embodiments, active event recognizer determination module 173 determines that all views that include the physical location of a sub-event are actively involved views, and therefore determines that all actively involved views should receive a particular sequence of sub-events. In other embodiments, even if touch sub-events were entirely confined to the area associated with one particular view, views higher in the hierarchy would still remain as actively involved views.
Event dispatcher module 174 dispatches the event information to an event recognizer (e.g., event recognizer 180). In embodiments including active event recognizer determination module 173, event dispatcher module 174 delivers the event information to an event recognizer determined by active event recognizer determination module 173. In some embodiments, event dispatcher module 174 stores in an event queue the event information, which is retrieved by a respective event receiver module 182.
In some embodiments, operating system 126 includes event sorter 170. Alternatively, application 136-1 includes event sorter 170. In yet other embodiments, event sorter 170 is a stand-alone module, or a part of another module stored in memory 102, such as contact/motion module 130.
In some embodiments, application 136-1 includes a plurality of event handlers 190 and one or more application views 191, each of which includes instructions for handling touch events that occur within a respective view of the application's user interface. Each application view 191 of the application 136-1 includes one or more event recognizers 180. Typically, a respective application view 191 includes a plurality of event recognizers 180. In other embodiments, one or more of event recognizers 180 are part of a separate module, such as application-independent software module 195 (e.g., a user interface kit) or a higher level object from which application 136-1 inherits methods and other properties. In some embodiments, a respective event handler 190 includes one or more of: data updater 176, object updater 177, GUI updater 178, and/or event data 179 received from event sorter 170. Event handler 190 optionally utilizes or calls data updater 176, object updater 177 or GUI updater 178 to update the application internal state 192. Alternatively, one or more of the application views 191 includes one or more respective event handlers 190. Also, in some embodiments, one or more of data updater 176, object updater 177, and GUI updater 178 are included in a respective application view 191.
A respective event recognizer 180 receives event information (e.g., event data 179) from event sorter 170, and identifies an event from the event information. Event recognizer 180 includes a plurality of component event recognizers 181. In some embodiments, the component event recognizers 181 used to form an event recognizer 180 are provided by application-independent software module 195.
A respective component gesture recognizer 181 of an event recognizer 180 includes component event recognizer-specific code 182, which optionally includes event definitions 184. Component gesture recognizer 181 also includes state/phase information 185 and one or more ports 187. In some embodiments, component event recognizer 181 also includes one or more parameter values 186.
Component event recognizer 181 receives event information from port 187-1. The event information includes information about a sub-event, for example, a touch or a touch movement. Depending on the sub-event, the event information also includes additional information, such as location of the sub-event. When the sub-event concerns motion of a touch, the event information optionally also includes speed and direction of the sub-event. In some embodiments, events include rotation of the device from one orientation to another (e.g., from a portrait orientation to a landscape orientation, or vice versa), and the event information includes corresponding information about the current orientation (also called device attitude) of the device.
Component event recognizer-specific code 182 is used to compare the event information to predefined event or sub-event definitions and, based on the comparison, determines an event or sub-event, or determines or updates the state of an event or sub-event. In some embodiments, component event recognizer-specific code 182 includes event definitions 184. Event definitions 184 contain definitions of requirements that must be satisfied in order for an event recognizer 180 to recognize the event (or gesture) defined by its component event recognizers 181 (e.g., a location requirement, a minimum and/or maximum movement requirement, a minimum or maximum timing requirement, an intensity threshold requirement, etc.). In some embodiments, a requirement is associated with a particular sub-event including, for example, touch begin, touch end, touch stationary, touch movement, touch cancellation, and multiple touching. In some embodiments, the event definitions 184 also include information for (e.g., identifying) one or more associated event handlers 190.
A respective component event recognizer 181 also includes a state/phase 185, which indicates the state of a state machine for the respective component event recognizer; state/phase 185 can have various state values, such as “event possible,” “event active,” “event ended”, “event failed” and others. When a respective component event recognizer 181 of a respective event recognizer 180 determines that a respective sub-event does not match the event definitions 184, the respective component event recognizer 181 enters the “failed” state, which causes the respective event recognizer 180 to enter an event impossible or event failed state, after which it disregards subsequent sub-events of the touch-based gesture. In this situation, other event recognizers, if any, that remain active for the hit view continue to track and process sub-events of an ongoing touch-based gesture.
In some embodiments, a respective component event recognizer 181 includes a plurality of ports 187 that indicate how the event delivery system should perform sub-event delivery to component event recognizers 181 in actively involved event recognizers 180. In some embodiments, ports 187 define the relationships (e.g., the connections, and thus the flow of information) of component event recognizers in a gesture recognition tree structure. In some embodiments, a respective component event recognizer includes one or more parameter values 186 that store values of different properties from earlier-received input events or sub-events of a touch input, for comparison with later-received input events or sub-events. For example, a component event recognizer includes an initial location parameter that stores the initial location of a touch input as identified from the earliest-received input event for the touch input, for comparison with current locations of the touch input as identified from later-received input events to determine whether the touch input has moved across the touch-sensitive surface, and by how much.
In some embodiments, a respective event recognizer 180 activates event handler 190 associated with an event when one or more particular sub-events of an event are recognized. In some embodiments, a respective event recognizer 180 delivers event information associated with the event to event handler 190. Activating an event handler 190 is distinct from sending (and deferred sending) sub-events to a respective hit view. In some embodiments, event recognizer 180 throws a flag associated with the recognized event, and event handler 190 associated with the flag catches the flag and performs a predefined process.
In some embodiments, data updater 176 creates and updates data used in application 136-1. For example, data updater 176 updates the telephone number used in contacts module 137, or stores a video file used in video and music player module 152. In some embodiments, object updater 177 creates and updates objects used in application 136-1. For example, object updater 177 creates a new user-interface object or updates the position of a user-interface object. GUI updater 178 updates the GUI. For example, GUI updater 178 prepares display information and sends it to graphics module 132 for display on a touch-sensitive display.
In some embodiments, event handler(s) 190 includes or has access to data updater 176, object updater 177, and GUI updater 178. In some embodiments, data updater 176, object updater 177, and GUI updater 178 are included in a single module of a respective application 136-1 or application view 191. In other embodiments, they are included in two or more software modules.
It shall be understood that the foregoing discussion regarding event handling of user touches on touch-sensitive displays also applies to other forms of user inputs to operate multifunction devices 100 with input-devices, not all of which are initiated on touch screens. For example, mouse movement and mouse button presses, optionally coordinated with single or multiple keyboard presses or holds; contact movements such as taps, drags, scrolls, etc., on touch-pads; pen stylus inputs; movement of the device; oral instructions; detected eye movements; biometric inputs; and/or any combination thereof are optionally utilized as inputs corresponding to sub-events which define an event to be recognized.
Device 100 optionally also includes one or more physical buttons, such as “home” or menu button 204. As described previously, menu button 204 is, optionally, used to navigate to any application 136 in a set of applications that are, optionally executed on device 100. Alternatively, in some embodiments, the menu button is implemented as a soft key in a GUI displayed on the touch-screen display.
In some embodiments, device 100 includes the touch-screen display, menu button 204 (sometimes called home button 204), push button 206 for powering the device on/off and locking the device, volume adjustment button(s) 208, Subscriber Identity Module (SIM) card slot 210, head set jack 212, and docking/charging external port 124. Push button 206 is, optionally, used to turn the power on/off on the device by depressing the button and holding the button in the depressed state for a predefined time interval; to lock the device by depressing the button and releasing the button before the predefined time interval has elapsed; and/or to unlock the device or initiate an unlock process. In some embodiments, device 100 also accepts verbal input for activation or deactivation of some functions through microphone 113. Device 100 also, optionally, includes one or more contact intensity sensors 165 for detecting intensities of contacts on touch-sensitive display system 112 and/or one or more tactile output generators 167 for generating tactile outputs for a user of device 100.
Each of the above identified elements in
Attention is now directed towards embodiments of user interfaces (“UI”) that are, optionally, implemented on portable multifunction device 100.
It should be noted that the icon labels illustrated in
Additionally, while the following examples are given primarily with reference to finger inputs (e.g., finger contacts, finger tap gestures, finger swipe gestures, etc.), it should be understood that, in some embodiments, one or more of the finger inputs are replaced with input from another input device (e.g., a mouse based input or a stylus input). For example, a swipe gesture is, optionally, replaced with a mouse click (e.g., instead of a contact) followed by movement of the cursor along the path of the swipe (e.g., instead of movement of the contact). As another example, a tap gesture is, optionally, replaced with a mouse click while the cursor is located over the location of the tap gesture (e.g., instead of detection of the contact followed by ceasing to detect the contact). Similarly, when multiple user inputs are simultaneously detected, it should be understood that multiple computer mice are, optionally, used simultaneously, or a mouse and finger contacts are, optionally, used simultaneously.
As used herein, the term “focus selector” refers to an input element that indicates a current part of a user interface with which a user is interacting. In some implementations that include a cursor or other location marker, the cursor acts as a “focus selector,” so that when an input (e.g., a press input) is detected on a touch-sensitive surface (e.g., touchpad 355 in
In some embodiments, the response of the device to inputs detected by the device depends on criteria based on the contact intensity during the input. For example, for some “light press” inputs, the intensity of a contact exceeding a first intensity threshold during the input triggers a first response. In some embodiments, the response of the device to inputs detected by the device depends on criteria that include both the contact intensity during the input and time-based criteria. For example, for some “deep press” inputs, the intensity of a contact exceeding a second intensity threshold during the input, greater than the first intensity threshold for a light press, triggers a second response only if a delay time has elapsed between meeting the first intensity threshold and meeting the second intensity threshold. This delay time is typically less than 200 ms (milliseconds) in duration (e.g., 40, 100, or 120 ms, depending on the magnitude of the second intensity threshold, with the delay time increasing as the second intensity threshold increases). This delay time helps to avoid accidental recognition of deep press inputs. As another example, for some “deep press” inputs, there is a reduced-sensitivity time period that occurs after the time at which the first intensity threshold is met. During the reduced-sensitivity time period, the second intensity threshold is increased. This temporary increase in the second intensity threshold also helps to avoid accidental deep press inputs. For other deep press inputs, the response to detection of a deep press input does not depend on time-based criteria.
In some embodiments, one or more of the input intensity thresholds and/or the corresponding outputs vary based on one or more factors, such as user settings, contact motion, input timing, application running, rate at which the intensity is applied, number of concurrent inputs, user history, environmental factors (e.g., ambient noise), focus selector position, and the like. Example factors are described in U.S. patent application Ser. Nos. 14/399,606 and 14/624,296, which are incorporated by reference herein in their entireties.
For example,
Attention is now directed towards embodiments of user interfaces (“UI”) and associated processes that may be implemented on an electronic device, such as portable multifunction device 100 or device 300, with a display, a touch-sensitive surface, (optionally) one or more tactile output generators for generating tactile outputs, and (optionally) one or more sensors to detect intensities of contacts with the touch-sensitive surface.
Tap gesture recognizer 500 also includes pause-for-predecessor component 508, which is optionally used to require that any gesture recognizer having priority over tap gesture recognizer 500 (e.g., any predecessor gesture recognizer) fail in order for a tap gesture to be recognized. Stated another way, pause-for-predecessor 508 prevents tap gesture recognizer 500 from succeeding while any predecessor gesture recognizer of tap gesture recognizer 500 is active, in certain situations described herein.
In addition, tap gesture recognizer 500 includes two gating combiners. Gating combiner 510 is controlled by pause-for-predecessor component 508 and maximum duration component 504. When maximum duration component 504 is in a failed state (e.g., an input has exceeded a predefined threshold amount of time, sometimes called the maximum threshold duration), gating combiner 510 is in a failed state. When maximum duration component 504 is in a state other than a failed state (e.g., an active state), gating combiner 510 passes through the input processing results (e.g., state and parameter values) received from pause-for-predecessor component 508. Similarly, gating combiner 512 is controlled by gating combiner 510 and distance component 506. When distance component 506 is in a failed state, gating combiner 512 is in a failed state. When distance component 506 is in a state other than a failed state (e.g., an active state), gating combiner 512 passes through the input processing results (e.g., state and parameter values) received from gating combiner 510. More generally, when the right-hand-side child component gesture recognizer of a gating combiner is in the failed state, the gating combiner is in the failed state, and when the right-hand-side child component gesture recognizer of the gating combiner is in a state other than the failed state, the gating combiner passes through the input processing results received from its left-hand-side child component gesture recognizer.
While
In the example shown in
Pause-for-predecessor component 508, in the example shown in
Maximum duration component 504 has identified the current timestamp ti of the input event. In addition, maximum duration component 504 has identified the input event as an event having a phase value of “touch begin.” Accordingly, maximum duration component 504 has stored the identified current timestamp ti as the initial timestamp associated with the touch input. Maximum duration component 504 uses the initial timestamp to determine whether the touch input has remained on the touch-sensitive surface for more than the predefined threshold amount of time Tth. At initial detection of the touch input, when the timestamp is the initial timestamp ti, the touch input has not yet remained on the touch-sensitive surface for more than the predefined threshold amount of time Tth, so maximum duration component 504 is in the “active” state. Maximum duration component 504 conveys its current “active” state to its parent node, gating combiner 510.
Gating combiner 510, as described above, is controlled by pause-for-predecessor component 508 and maximum duration component 504. Because maximum duration component 504 is in the “active” state and thus not in the “failed” state, gating combiner 510 passes through the input processing results received from pause-for-predecessor component 508. Accordingly, gating combiner 510 conveys the “active” state and the spatial event to its parent node, gating combiner 512.
Distance component 506 has identified the current location pi of the touch input from the input event. In addition, distance component 506 has identified the input event as an event having a phase value of “touch begin.” Accordingly, distance component 506 has stored the identified current location pi as the initial location of the touch input. In general, distance components use the initial location to determine whether movement (if any) of a touch input satisfies a minimum amount of movement and/or a maximum amount of movement. In some embodiments, a distance component is used in gesture recognizers that require movement of a touch input to define a minimum threshold amount of movement. In some embodiments, a distance component is used in gesture recognizers that require a limit on the amount of movement of a touch input to define a maximum threshold amount of movement. In some embodiments, both a minimum threshold amount of movement and a maximum threshold amount of movement can be defined to require that movement of a touch input be within a predefined range.
In the example shown in
Gating combiner 512, as described above, is controlled by gating combiner 510 and distance component 506. Because distance component 506 is in the “active” state and thus not in the “failed” state, gating combiner 512 passes through the input processing results received from gating combiner 510. Accordingly, gating combiner 512 conveys the “active” state and the spatial event received from gating combiner 510. Because gating combiner 512 is the root node of tap gesture recognizer 500, the overall state of tap gesture recognizer 500 is the “active” state, and the overall output values of tap gesture recognizer 500 are those of the spatial event. In some embodiments, the overall state and output values of an assembled gesture recognizer (such as tap gesture recognizer 500) are conveyed by the gesture recognizer to a parent node of the gesture recognizer where the gesture recognizer is used as part of another gesture recognizer. For example, as described herein with reference to
Pause-for-predecessor component 508, in the example shown in
Maximum duration component 504 has identified the current timestamp tc of the input event. Maximum duration component has compared the current timestamp tc to the stored initial timestamp ti to determine that the amount of time that touch input has remained on the touch-sensitive surface (tc-ti) is less than the predefined threshold amount of time Tth. Accordingly, maximum duration component 504 has not transitioned to the “failed” state. Instead, maximum duration component 504 has identified the input event as an event having a phase value of “touch end,” and, having not transitioned to the “failed” state for any reason, has thus transitioned to the “ended” state. Maximum duration component 504 conveys its current “ended” state to its parent node, gating combiner 510.
Gating combiner 510, as described above, is controlled by pause-for-predecessor component 508 and maximum duration component 504. Because maximum duration component 504 is in the “ended” state and thus not in the “failed” state, gating combiner 510 passes through the input processing results received from pause-for-predecessor component 508. Accordingly, gating combiner 510 conveys the “ended” state and the spatial event to its parent node, gating combiner 512.
Distance component 506 has identified the current location pc of the touch input from the input event. Distance component 506 has compared the current location pc to the stored initial location pi to determine that the distance traveled by the touch input (the absolute value of pc-pi, |pc-pi|) is less than the predefined maximum threshold distance Dmax,th. Accordingly, distance component 506 has not transitioned to the “failed” state. Instead, distance component 506 has identified the input event as an event having a phase value of “touch end,” and, having not transitioned to the “failed” state for any reason, has thus transitioned to the “ended” state. Distance component 506 conveys its current “ended” state to its parent node, gating combiner 512.
Gating combiner 512, as described above, is controlled by gating combiner 510 and distance component 506. Because distance component 506 is in the “ended” state and thus not in the “failed” state, gating combiner 512 passes through the input processing results received from gating combiner 510. Accordingly, gating combiner 512 conveys the “ended” state and the spatial event received from gating combiner 510. Because gating combiner 512 is the root node of tap gesture recognizer 500, the overall state of tap gesture recognizer 500 is the “ended” state, and the overall output values of tap gesture recognizer 500 are those of the spatial event. With the transitioning of gating combiner 512 to the “ended” state, tap gesture recognizer 500 has successfully recognized the touch input as a tap gesture.
Pause-for-predecessor component 508, in the example shown in
Maximum duration component 504 has identified the current timestamp tc of the input event. Maximum duration component has compared the current timestamp tc to the stored initial timestamp ti to determine that the amount of time that touch input has remained on the touch-sensitive surface (tc-ti) is less than the predefined threshold amount of time Tth. Accordingly, maximum duration component 504 has not transitioned to the “failed” state and, because the input event has a phase value of “touch movement” rather than “touch end,” remains in the “active” state. Maximum duration component 504 conveys its current “active” state to gating combiner 510.
Because maximum duration component 504 is in the “active” state and thus not in the “failed” state, gating combiner 510 passes through the “active” state and the spatial event received from pause-for-predecessor component 508 to gating combiner 512.
Distance component 506 has identified the current location pc of the touch input and compared the current location pc to the stored initial location pi to determine that the distance traveled by the touch input (|pc-pi|) is greater than the predefined maximum threshold distance Dmax,th. Accordingly, distance component 506 has transitioned to the “failed” state. Distance component 506 conveys its current “failed” state to gating combiner 512.
Gating combiner 512 is controlled by the “failed” state of distance component 506 such that gating component 512 is also in the “failed” state. Because gating combiner 512 is the root node of tap gesture recognizer 500, the overall state of tap gesture recognizer 500 is the “failed” state, and no tap gesture is recognized by tap gesture recognizer 500.
Maximum duration component 504 has identified the current timestamp tc of the input event and compared the current timestamp tc to the stored initial timestamp ti to determine that the amount of time that touch input has remained on the touch-sensitive surface (tc-ti) has exceeded the predefined threshold amount of time Tth. Accordingly, maximum duration component 504 has transitioned to the “failed” state. Maximum duration component 504 conveys its current “failed” state to gating combiner 510, which controls gating combiner 510 to also be in the “failed” state (e.g., causes gating combiner 510 to transition to the “failed” state).
Distance component 506 has identified the current location pc of the touch input and compared the current location pc to the stored initial location pi to determine that the distance traveled by the touch input (|pc-pi|) is less than the predefined maximum threshold distance Dmax,th. Accordingly, distance component 506 has not transitioned to the “failed” state and, because the input event has a phase value of “touch stationary” rather than “touch end,” remains in the “active” state. Distance component 506 conveys its current “active” state to gating combiner 512.
Because distance component 506 is in the “active” state and thus not in the “failed” state, gating combiner 512 passes through the “failed” state and the spatial event received from gating combiner 510. Because gating combiner 512 is the root node of tap gesture recognizer 500, the overall state of tap gesture recognizer 500 is the “failed” state, and no tap gesture is recognized by tap gesture recognizer 500. In some embodiments, the passed-through spatial event output by tap gesture recognizer 500 is ignored because tap gesture recognizer 500 has failed.
In the example shown in
Repeater 522 includes an input count value (“countinput”) 526 that tracks the number of times that tap gesture recognizer 524 (or a respective instance of tap gesture recognizer 524) has succeeded. Because tap gesture recognizer (instance 1) 524a has not yet succeeded (e.g., tap gesture recognizer 524a has not yet transitioned to the “ended” state), input count value 526 has a value of zero. In addition, repeater 522 has transitioned to the “active” state in response to the first touch input being received (but not yet ended). Repeater 522 conveys, as its output, its current “active” state and the first spatial event (“spatial event1”) received from tap gesture recognizer 524a. Because repeater 522 is the root node of double-tap gesture recognizer 520, the overall state of double-tap gesture recognizer 520 is the “active” state, and the overall output values of double-tap gesture recognizer 520 are those of the first spatial event.
In some embodiments, after repeater 522 has transitioned to the “active” state in response to a touch input being received, repeater 522 remains in the “active” state either until tap gesture recognizer 524 (or a respective instance of tap gesture recognizer 524) transitions to the “failed” state, or until tap gesture recognizer 524 has succeeded the predefined number of times required by repeat count value (“countrepeat”). In
In addition, repeater 522 monitors an amount of time that has elapsed since a time corresponding to the most-recently recognized tap gesture. In some embodiments, repeater 522 monitors the amount of time that has elapsed from a beginning of the touch input that was identified as the most-recently recognized tap gesture (e.g., by identifying and storing the initial timestamp associated with the “touch begin” event for that touch input). In some embodiments, repeater 522 monitors the amount of time that has elapsed from an end of that touch input (e.g., by identifying and storing the ending timestamp associated with the “touch end” event for that touch input). For example, in
In addition, the amount of time that has elapsed from the end of the first tap gesture (“ttap1ended”) to the end of the second tap gesture (“ttap2ended”) is less than the predefined timeout period (“Ttimeout”). Because the timing requirement remains satisfied, and because tap gesture recognizer 524b has transitioned to the “ended” state, repeater 522 transitions to the “ended” state. Repeater conveys, as both its own output and as the overall output of double-tap gesture recognizer 520, its current “ended” state and the fourth spatial event (“spatial event4”) received from tap gesture recognizer 524b. The outputting of the “ended” state by repeater 522 indicates that double-tap gesture recognizer 520 has successfully recognized a double-tap gesture.
In some embodiments, if either instance of tap gesture recognizer 524 were to have transitioned to the “failed” state, repeater 522 would have transitioned to the “failed” state, and no double-tap gesture would have been recognized. Furthermore, if the end of a second tap gesture had not been received before the predefined timeout period (“Ttimeout”) had elapsed since the first recognized tap gesture, repeater 522 would have transitioned to the “failed” state, and no double-tap gesture would have been recognized.
Pinch gesture recognizer 530 also includes a parallel combiner 536. Parallel combiner 536 controls the conveyance of input events to first drag component 532 and second drag component 534. Specifically, parallel combiner assigns a different touch input to each drag component such that each drag component receives and processes input events only for its assigned touch input. The state of parallel combiner 536 is dependent on the respective states of the drag components, and the output values of parallel combiner 536 are the output values of the drag components, as described in more detail herein.
In addition, pinch gesture recognizer 530 includes a pinch component 538. Pinch component 536 determines a scale (e.g., which is used to control a scale of a displayed user interface or user interface element when a pinch gesture is detected), and optionally a scale velocity (e.g., which is used to continue to adjust the scale of the user interface or user interface element after a detected pinch gesture has ended).
First drag component 532 conveys, to parallel combiner 536, the current “possible” state of first drag component 532 and a plurality of values identified from (or determined based on information in) the first input event, including an initial timestamp of the first touch input (“t1i”), an instantaneous velocity of the first touch input (“v1i”), an initial location of the first touch input (“p1i”), and a current location of the first touch input (“p1i” at initial detection of the first touch input).
Similarly, the second input event is also a spatial event that describes an ongoing touch input. Second drag component has identified and stored the initial location 542 (“p2i”) of the second touch input. Because the amount of movement of the second touch input (“|p2c-p2i|”) is less than the minimum threshold amount (“Dmin,th”), second drag component 534 is in the “possible” state. Second drag component 534 conveys, to parallel combiner 536, the current “possible” state of second drag component 532 and a plurality of values identified from (or determined based on information in) the second input event, including an initial timestamp of the second touch input (“t2i”), an instantaneous velocity of the second touch input (“v2i”), an initial location of the second touch input (“p2i”), and a current location of the second touch input (“p2i” at initial detection of the second touch input).
Parallel combiner 536 receives the “possible” states and values from first drag component 532 and second drag component 534. Because both drag components are in the “possible” state, parallel combiner 536 is also in the “possible” state. Parallel combiner 536 conveys its current “possible” state and all of the values received from first drag component 532 and second drag component 534 to pinch component 538. In some embodiments, parallel combiner 536 receives from each drag component an array of the values from that drag component. In some embodiments, parallel combiner 536 combines the received arrays into a larger array that includes all of the values received from the drag components.
Pinch component 538 receives the “possible” state and values from parallel combiner 536. Because parallel combiner 536 is in the “possible” state, pinch component 538 is also in the “possible” state. Pinch component 538 determines and conveys a scale value, and optionally a scale velocity, based on the values received from parallel combiner 536 (e.g., based on the locations of each touch input relative to their initial positions). Because pinch component 538 is the root node of pinch gesture recognizer 530, the overall state of pinch gesture recognizer 530 is the “possible” state, and the overall output values of pinch gesture recognizer 530 are those of pinch component 538.
Similarly, second drag component 534 has identified the fourth input event as a spatial event for the ongoing second touch input (as indicated by the “touch movement” phase value) and has determined that the amount of movement of the second touch input (“p2c-p2i”) is greater than the minimum threshold amount (“Dmin,th”). Accordingly, second drag component 534 has transitioned to the “active” state. Second drag component 534 conveys, to parallel combiner 536, the current “active” state of second drag component 534 and values identified from (or determined based on information in) the fourth input event, including a current timestamp of the second touch input (“t2c”), a current instantaneous velocity of the second touch input (“v2c”), the initial location of the second touch input (“p2i”), and a current location of the second touch input (“p2c”).
Because both drag components have transitioned to the “active” state, parallel combiner 536 has also transitioned to the “active” state. In some embodiments, a pinch gesture can be performed by moving only one touch input while the other touch input remains stationary. Accordingly, in some embodiments, parallel combiner 536 transitions to the “active” state in response to at least one of its child drag components transitioning to the “active” state (e.g., even while the other child drag component remains in the “possible” state). In
Because parallel combiner 536 is in the “active” state, pinch component 538 is also in the “active” state. Pinch component 538 determines and conveys a (current) scale value, and optionally a (current) scale velocity, based on the values received from parallel combiner 536 (e.g., based on the current locations of each touch input relative to their initial positions). Accordingly, the overall state of pinch gesture recognizer 530 is the “active” state, and the overall output values of pinch gesture recognizer 530 are those of pinch component 538.
Second drag component 534 has identified the spatial event as being associated with a completed touch input (as indicated by the “touch end” phase value”) and accordingly has transitioned to the “ended” state. Second drag component 534 conveys its current “ended” state and the associated values identified from (or determined based on information in) the “touch ended” input event, including an ending timestamp of the second touch input (“t2e”), an instantaneous velocity of the second touch input at the time of liftoff (“v2e”), the initial location of the second touch input (“p2i”), and the ending location of the second touch input at the time of liftoff (“p2e”).
In some embodiments, the pinch gesture recognizer remains in the “active” state as long as one touch input remains “active” even if the other touch input has “ended.” That is, a pinch gesture recognizer that is “active” while a user performs a pinch gesture using two fingers in contact with a touch-sensitive surface remains “active” even after the user lifts one finger from the touch-sensitive surface as long as the other finger is maintained on the touch-sensitive surface. The user may place the lifted finger back down on the touch-sensitive surface to resume the pinch gesture. Accordingly, although second drag component 534 has transitioned to the “ended” state in
Because parallel combiner 536 remains in the “active” state, pinch component 538 also remains in the “active” state, and determines and conveys a (current) scale value, and optionally a (current) scale velocity, based on the values received from parallel combiner 536. Accordingly, the overall state of pinch gesture recognizer 530 remains in the “active” state, and the overall output values of pinch gesture recognizer 530 are those of pinch component 538.
Because both drag components have transitioned to the “ended” state, parallel combiner 536 has also transitioned to the “ended” state. Parallel combiner 536 conveys its current “ended” state and all of the values received from first drag component 532 and second drag component 534 to pinch component 538. Accordingly, the overall state of pinch gesture recognizer 530 is the “ended” state, indicating that a pinch gesture has been recognized and has ended, and the overall output values of pinch gesture recognizer 530 are those of pinch component 538. The scale velocity is optionally used to continue to adjust the scale of the user interface or user interface element to which the pinch gesture was directed even after the pinch gesture has ended.
In some embodiments, a respective view of a user interface includes a rotation gesture recognizer having the same component gesture recognizers as the pinch gesture recognizer 530 described above, except that the pinch component 538 is replaced with a rotation component (not shown). Furthermore, operation of the rotation gesture recognizer and its component recognizers are the same as that described above for pinch gesture recognizer 530, except that the rotation component determines an angle, or rotation amount, and optionally an angular or rotation velocity, in accordance with the position values and optionally the velocity values received from the parallel component 536, when at least one of the drag components 532 of the rotation gesture recognizer is in the active state.
In response to receiving touch input 620, device 100 generates gesture recognition hierarchy 640 based on view hierarchy 630. In some embodiments, as shown in
In addition, because view 612 has been determined to be the hit view, the gesture recognizer(s) of hit view 612 have the highest priority for processing touch input 620, over the gesture recognizers of other views in the view hierarchy. Accordingly, gesture recognition hierarchy 640 assigns the highest priority to first tap gesture recognizer 614 using exclusive combiner 642. An exclusive combiner defines a relationship between multiple child (component) gesture recognizers by requiring that the left-hand-side child fail in order for the right-hand-side child to succeed. For exclusive combiners with more than two children, a respective child is allowed to succeed only when every child to its left has failed. Thus, because all of the gesture recognizers in gesture recognition hierarchy 640 other than tap gesture recognizer 614 are on the right-hand-side of exclusive combiner 542, gesture recognition hierarchy requires that first tap gesture recognizer 614 fail in order for any other gesture recognizer in hierarchy 640 to succeed. It is noted that the terms “right” and “left” in this discussion are distinct but interchangeable, and similarly the terms “right-hand” and “left-hand” in the present discussion are distinct but interchangeable. More generally, in some embodiments, each distinct input position of the exclusive combiner 642 or 644 is assigned a respective priority, and the child connected to a particular input of the exclusive combiner 642 or 644 is allowed to succeed only when all the children connected to lower priority inputs of the exclusive combiner 642 or 644 have failed.
Because view 606 is the parent of the hit view (e.g., the second-lowest view in view hierarchy 630 that corresponds to touch input 620), the gesture recognizers of view 606 have the second-highest priority for processing touch input 620. Accordingly, the two gesture recognizers of view 606 (e.g., scroll gesture recognizer 608 and pinch gesture recognizer 610) both have priority, defined by exclusive combiner 644, over other gesture recognizers in gesture recognition hierarchy 640 (e.g., long press gesture recognizer 604). In some embodiments, when a single view includes multiple gesture recognizers, a combiner is used to define a priority or other relationship between the multiple gesture recognizers. In the example shown in
In some embodiments, the hit view for touch input 624 is determined to be view 612, because at least one contact of touch input 624 corresponds to view 612, and because view 612 is lower than view 606. In some such embodiments, gesture recognition hierarchy 660 also includes first tap gesture recognizer 614 (e.g., the gesture recognition hierarchy is the same as gesture recognition hierarchy 640,
As described below, method 700 provides an intuitive way for an electronic device to process a detected input using a modular approach that divides a larger set of input event handling requirements into smaller subsets of event handling requirements associated with and processed using component gesture recognizers that make up a gesture recognizer, such that the smaller subsets of event handling requirements can be more quickly processed than the larger set. This modular approach increases the number, extent, and complexity of gestures that can potentially be recognized. Reusing (instances of) modules across multiple gesture recognizers provides consistency in gesture recognition capabilities. In addition, in contrast to an approach that processes inputs using monolithic gesture recognizers (i.e., gesture recognizers that are not modular), this modular approach provides design flexibility in that modules can be added to or removed from a gesture recognizer, or individual modules in a gesture recognizer can be substituted with modified versions, without requiring an entirely new monolithic gesture recognizer to be designed. The modular approach also reduces the computational load imposed on an electronic device by touch and other inputs and gestures, which in turn improves device responsiveness and reduces latency. Reducing latency in responding to inputs also reduces user mistakes when operating/interacting with the device, such as duplicative or extraneous inputs made by the user while waiting for the device to respond to the user's earlier input(s). Reducing the number and/or extent of the inputs from a user enhances the operability of the device and makes the user-device interface more efficient, which, additionally, reduces power usage and improves battery life of the device by enabling the user to use the device more quickly and efficiently.
The device detects (702) an input via the input device (e.g., a touch input on the touch-sensitive surface, a mouse input using one or more buttons of a mouse, etc.).
In response to detecting the input, the device monitors (704) the input using a gesture recognizer. The gesture recognizer includes (706) a plurality of component gesture recognizers that define requirements for recognition of a gesture (e.g., the gesture recognizer is an assembled gesture recognizer, assembled using the plurality of component gesture recognizers from a set of available component gesture recognizers). A first component gesture recognizer from the plurality of component gesture recognizers defines a first requirement for recognition of the gesture (e.g., a requirement with respect to location, contact intensity, minimum duration, maximum duration, distance (optionally with a minimum and/or maximum distance requirement), etc.), and a second component gesture recognizer from the plurality of component gesture recognizers defines a second requirement for recognition of the gesture (e.g., a requirement with respect to location, contact intensity, minimum duration, maximum duration, distance (optionally with a minimum and/or maximum distance requirement), etc.). In some embodiments, the gesture recognizer is formed (e.g., created or instantiated) in response to the input being detected. In some embodiments, the gesture recognizer is associated with a view in a plurality of views of a software application executing on the electronic device, and the gesture recognizer is formed in accordance with a determination that the location of the detected input corresponds to the view with which the gesture recognizer is associated. In some embodiments, the gesture recognizer corresponds specifically to the aforementioned view, or comprises a component of the application that responds to touch inputs in the aforementioned view. Example gesture recognizers that have been assembled from a plurality of component gesture recognizers are shown in and described herein with respect to
In accordance with a determination that the input satisfies first gesture recognition criteria that include the first requirement of the first component gesture recognizer and the second requirement of the second component gesture recognizer, the device recognizes (708) a first gesture using the gesture recognizer. In some embodiments, the set of available component gesture recognizers include component gesture recognizers that identify input events (e.g., touch events, mouse events, etc.) having particular properties (e.g., input events that include location information and/or translation (movement) information). Examples of component gesture recognizers that identify input events include a spatial event listener (such as spatial event listener 502,
In some embodiments, the set of available component gesture recognizers include component gesture recognizers for determining whether particular properties of an input (e.g., current location, current timestamp, current intensity, etc., optionally in conjunction with one or more previously-determined properties such as starting location, starting timestamp, etc.) satisfy particular requirements for recognition of a gesture (e.g., a distance requirement (see discussion of distance component 506,
In some embodiments, the set of available component gesture recognizers include combiners, where a respective combiner combines results (sometimes called component gesture recognizer outputs or recognition results, or inputs to the combiner) generated by two or more component gesture recognizers and defines a requirement for recognition of a gesture based on relationship between the component gesture recognizers whose results are combined using the combiner (e.g., a gating component gesture recognizer (such as gating combiners 510 and 512,
In some embodiments, determining whether the input satisfies the first gesture recognition criteria includes: determining, using the first component gesture recognizer, whether the input satisfies the first requirement defined by the first component gesture recognizer; determining, using the second component gesture recognizer, whether the input satisfies the second requirement defined by the first component gesture recognizer; and determining whether the input satisfies the first gesture recognition criteria based on the respective determinations made using the first component gesture recognizer and the second component gesture recognizer.
In some embodiments, the first component gesture recognizer has (710) a current state of a plurality of available states (e.g., determined based on whether the input satisfies the first requirement of the first component gesture recognizer); and the second component gesture recognizer has a current state of the plurality of available states (e.g., determined based on whether the input satisfies the second requirement of the second component gesture recognizer). In some embodiments, available states for a respective component gesture recognizer include “possible,” “active,” “ended,” and “failed.” Examples of the transitions of a component gesture recognizer between the available states are shown in and described herein with respect to
In some embodiments, the device determines (712) a current state (e.g., of the plurality of available states (e.g., “possible,” “active,” “ended,” and “failed”)) of the gesture recognizer based on the current state of the first component gesture recognizer and the current state of the second component gesture recognizer. In some embodiments, the overall state of the gesture recognizer is determined based on combiner rules. In one example, a gesture recognizer includes a first component gesture recognizer and a second component gesture recognizer that are associated using a gating component gesture recognizer (also called a gating combiner). In this example, the gating combiner is in a Failed state when the second component gesture recognizer is in a Failed state; and, when the second component gesture recognizer is not in a Failed state, the gating combiner passes through the state of the first component gesture recognizer (e.g., the gating combiner operates similarly to a logical AND gate). As described herein with reference to
In some embodiments, monitoring the input using the gesture recognizer includes (714): receiving, at the gesture recognizer, first information that describes the input at a first point in time (e.g., a touch event corresponding to the first point in time); processing the first information using the first component gesture recognizer to determine a current state of the first component gesture recognizer, of the plurality of available states, for the first point in time; and processing the first information using the second component gesture recognizer to determine a current state of the second component gesture recognizer, of the plurality of available states, for the first point in time, as described herein with reference to the results of processing of the first input event as illustrated in
In some embodiments, one or more component gesture recognizers in the gesture recognizer include (716) one or more parameters (e.g., a point value that describes a location of the input, or a timestamp that describes a time associated with the input) that describe the input (e.g., initial location 516, or initial time 514,
In some embodiments, the gesture recognizer generates/sends events to a software application in accordance with changes in the one or more parameters. In some embodiments, the gesture recognizer generates/sends one or more events to the software application prior to determining whether the input satisfies the first gesture recognition criteria. In some embodiments, a respective event of the one or more events includes a phase value corresponding to a current state of the gesture recognizer (e.g., “possible,” “active,” “ended,” or “failed”). Using component gesture recognizers in a gesture recognizer to determine values of parameters that describe the input provides the gesture recognizer with information about the input that is needed for processing inputs, which simplifies event handling and reduces the computational load on the device when processing inputs. This improves device responsiveness and reduces latency, thereby enhancing the operability of the device and making the user-device interface more efficient (e.g., by helping the user to achieve an intended outcome and by reducing user mistakes when operating/interacting with the device).
In some embodiments, the gesture recognizer is (718) a gesture recognition tree (e.g., a tree data structure) having a plurality of nodes, and each node of the gesture recognition tree includes a respective component gesture recognizer (e.g., as described herein with reference to
Some combiners, such as sequential combiners and parallel combiners, convey information about an input to only a subset of their child component gesture recognizers. For example, a sequential combiner conveys respective information about an input (e.g., a respective input event) to (only) one respective child component gesture recognizer. While a respective input is detected, a sequential combiner first sends input events about the respective input to its first child. After the first child succeeds, the sequential combiner sends subsequent input events to its second child, and so on for each additional child. If any child fails, the sequential combiner fails. In another example, parallel combiners associate one or more of their child component gesture recognizers with one or more respective inputs and convey information about a respective input only to the associated child gesture recognizer. Where multiple touches are detected on a touch-sensitive surface, a first child gesture recognizer of a parallel combiner is associated with a first touch of the multiple touches, a second child gesture recognizer of the parallel combiner is associated with a second touch of the multiple touches, and so on for each touch of the multiple touches. In this example, input events describing the first touch are sent by the parallel combiner to the first child gesture recognizer (and not to the second or any other child gesture recognizers); similarly, input events describing the second touch are sent by the parallel combiner to the second child gesture recognizer (and not to the first or any other child gesture recognizers). An example of parallel combiner behavior is described herein with reference to parallel combiner 536,
In some embodiments, monitoring the input using the gesture recognizer also includes determining states of component gesture recognizers at respective nodes in the gesture recognition tree based on the information that describes the input at the respective point in time and, in accordance with a determination that a respective node has one or more child nodes, based on respective states of respective component gesture recognizers at the one or more child nodes determined based on the information that describes the input at the respective point in time. In some embodiments, the state of a respective component gesture recognizer is further based on respective values determined using the respective component gesture recognizers at the one or more child nodes. That is, the state of a respective component gesture recognizer is determined based on one or more of: the information about the input (e.g., an input event), determined states (based on the information about the input) of its child component gesture recognizers, if any, and/or determined values of its child component gesture recognizers, if any.
Arranging component gesture recognizers in a tree structure enables an organized and orderly flow for input events to be processed, by defining relationships between the component gesture recognizers including, for example, setting priorities between component gesture recognizers, which simplifies input event handling and reduces the computational load on the device when processing inputs. This improves device responsiveness and reduces latency, thereby enhancing the operability of the device and making the user-device interface more efficient (e.g., by helping the user to achieve an intended outcome and by reducing user mistakes when operating/interacting with the device).
In some embodiments, monitoring the input using the gesture recognizer further includes (720) conveying the determined states of the component gesture recognizers at child nodes in the gesture recognition tree to component gesture recognizers at parent nodes of the child nodes in the gesture recognition tree. In some embodiments, determining whether the input satisfies the first gesture recognition criteria for recognizing the first gesture includes determining a state of the gesture recognition tree based on the determined states of the component gesture recognizers in the gesture recognition tree (e.g., as described herein with reference to
In some embodiments, monitoring the input using the gesture recognizer includes (722) determining values of one or more component gesture recognizers at respective nodes in the gesture recognition tree based on the information that describes the input at the respective point in time. In some embodiments, the values are determined based on states and/or values of child component gesture recognizers. In some embodiments, determining a state of a respective component gesture recognizer at a respective node is further based on a determined value of a component gesture recognizer at a child node of the respective node, in accordance with a determination that the component gesture recognizer at the child node has a determined value.
For example, a component gesture recognizer that defines a threshold requirement for a parameter has a child component gesture recognizer that determines a value of the parameter, and the (parent) component gesture recognizer determines its state based on whether the determined value from the child component gesture recognizer satisfies the threshold requirement. In some embodiments, the (parent) component gesture recognizer also determines a value of a parameter, and in such cases the component gesture recognizer determines its value based on a determined value of its child component gesture recognizer (or based on respective values of two or more child component gesture recognizers). In another example, a component gesture recognizer (e.g., pinch component 538,
Determining states of parent component gesture recognizers based on information about the input (e.g., values of parameters that describe the input) determined by child component gesture recognizers enables more complex input processing without increasing the amount of processing required at the parent component gesture recognizer. Dividing a larger set of processing requirements into smaller subsets of processing requirements simplifies event handling and reduces the computational load on the device when processing inputs. This improves device responsiveness and reduces latency, thereby enhancing the operability of the device and making the user-device interface more efficient (e.g., by helping the user to achieve an intended outcome and by reducing user mistakes when operating/interacting with the device).
In some embodiments, the plurality of component gesture recognizers in the gesture recognizer are (724) selected from a plurality of available component gesture recognizers that include: combiners that combine information from two or more component gesture recognizers and define requirements for recognition of a gesture based on relationships between the component gesture recognizers combined using the combiners; and input parameter recognizers that determine values of parameters that describe the input (e.g., location, timestamp, intensity) and/or define threshold requirements (e.g., lower and/or upper limits) for parameters that describe the input (e.g., threshold distance traveled by the input, threshold duration of the input, threshold contact intensity of the input). Using combiners to define and monitor relationships between component gesture recognizers, and input parameter recognizers to monitor information about the input (e.g., values of parameters that describe the input) and define threshold requirements for the input, enables more complex input processing while dividing a larger set of processing requirements into smaller subsets of processing requirements that can be more quickly processed than the larger set. This improves device responsiveness and reduces latency, thereby enhancing the operability of the device and making the user-device interface more efficient (e.g., by helping the user to achieve an intended outcome and by reducing user mistakes when operating/interacting with the device).
In some embodiments, the gesture recognizer is (726) associated with an application (e.g., application 136-1,
In some embodiments, the gesture recognizer includes (728) a third component gesture recognizer (e.g., a combiner) that defines a third requirement for recognition of a gesture based on a relationship between the first component gesture recognizer and the second component gesture recognizer (e.g., exclusive, simultaneous, sequential, parallel, or gating combiners). In some embodiments, monitoring the input using the gesture recognizer includes monitoring the state of the first component gesture recognizer and the state of the second component gesture recognizer using the third component gesture recognizer to determine whether the first component gesture recognizer (e.g., the state of the first component gesture recognizer) and the second component gesture recognizer (e.g., the state of the second component gesture recognizer) satisfy the third requirement. In some embodiments, the first gesture recognition criteria include the third requirement that is based on the predefined relationship between the first component gesture recognizer and the second component gesture recognizer. Example combiners and their requirements/uses are described herein with reference to
In some embodiments, the third component gesture recognizer is (730) an exclusive combiner, and the third requirement specifies that the first component gesture recognizer must fail in order for the second component gesture recognizer to succeed. In some embodiments, while the first component gesture recognizer is not in a failed or canceled state, a state of the third component gesture recognizer is based on a state of the first component gesture recognizer (e.g., without regard to a state of the second component gesture recognizer). In some embodiments, while the first component gesture recognizer is in a failed or canceled state, a state of the third component gesture recognizer is based on a state of the second component gesture recognizer. For example, when the first component gesture recognizer is in a state other than a failed or canceled state, the state of the third component gesture recognizer is based on the state of the first component gesture recognizer, and the third component gesture recognizer also includes an indication that the state of the third component gesture recognizer corresponds to the first component gesture recognizer. In another example, when the first component gesture recognizer is in a failed or canceled state, the state of the third component gesture recognizer is based on the state of the second component gesture recognizer, and the third component gesture recognizer also includes an indication that the state of the third component gesture recognizer corresponds to the second component gesture recognizer. Example exclusive combiners are also described herein with reference to
In some embodiments, the third component gesture recognizer is (732) a simultaneous combiner, and the third requirement requires, at a respective point in time, success of at least one of the first component gesture and the second component gesture recognizer in order for the third component gesture recognizer to succeed. In some embodiments, the simultaneous combiner allows both the first component gesture recognizer and the second component gesture recognizer to succeed simultaneously. For example, a simultaneous gesture recognizer that combines a tap gesture recognizer and a double-tap gesture recognizer allows the tap gesture recognizer to succeed when a tap input (e.g., an input having a duration that is less than a predefined threshold duration and an amount of movement that is less than a predefined threshold amount of movement) is recognized, and also allows the double-tap gesture recognizer to succeed when a second tap input that completes the double-tap gesture is recognized. Providing a simultaneous combiner that requires success of at least one (child) gesture recognizer or component gesture recognizer yet allows for multiple (child) gesture recognizers or component gesture recognizers to succeed improves the ability of the device to simultaneously recognize and process multiple gestures, and thus provide the user with additional control options, without requiring additional inputs or cluttering the user interface with additional displayed controls. This reduces the additional computation load typically imposed by processing multiple gestures simultaneously using monolithic gesture recognizers, which improves device responsiveness and reduces latency, and also enhances the operability of the device and makes the user-device interface more efficient (e.g., by helping the user to achieve an intended outcome and by reducing user mistakes when operating/interacting with the device).
In some embodiments, the third component gesture recognizer is a gating combiner, and the third requirement requires, at a respective point in time, success of the first component gesture and success of the second component gesture recognizer in order for the third component gesture recognizer to succeed. In other words, the gating combiner requires success of both the first component gesture recognizer and the second component gesture recognizer at least at one point in time (e.g., one component gesture recognizer may succeed before the other, but there must be at least one moment of overlap where both have succeeded) (e.g., the gating combiner operates as a logical AND gate). Example gating combiners are also described herein with reference to
In some embodiments, a respective component gesture recognizer is deemed to succeed when its respective requirement for gesture recognition is satisfied. For example, as discussed above with respect to
In some embodiments, the third component gesture recognizer is a parallel combiner that requires, at a respective point in time, success of the first component gesture recognizer and success of the second component gesture. In one example, a parallel combiner is used in a pinch gesture recognizer to define a relationship between a first component gesture recognizer that is a first drag component gesture recognizer, and a second component gesture recognizer that is a second drag component gesture recognizer, each drag component gesture recognizer monitoring movement of a respective input. In the pinch gesture recognizer example, the parallel combiner requires success of the first pan gesture recognizer (e.g., based on a first touch input being detected) concurrent with success of the second pan gesture recognizer (e.g., based on a second touch input being detected concurrently with the first touch input). An example parallel combiner is described herein with reference to
In some embodiments, the third component gesture recognizer is (734) a sequential combiner, and the third requirement requires, in order for the third component gesture recognizer to succeed, success of the first component gesture recognizer and, after the first component gesture recognizer succeeds, success of the second component gesture recognizer. In other words, the sequential combiner requires that its child component gesture recognizers succeed one after another in order for the sequential component gesture recognizer to succeed. For example, a drag gesture recognizer for recognizing a drag gesture that requires a long press followed by movement of the input may be assembled using a sequential combiner that has a long press gesture recognizer as its first child and a pan gesture recognizer as its second child. In some embodiments, success of the sequential combiner requires the later component gesture recognizer to succeed after the earlier component gesture recognizer has succeeded and ended. In some embodiments, success of the sequential combiner still occurs where the later component gesture recognizer succeeds after the earlier component gesture recognizer succeeds but before the earlier component gesture recognizer has ended. In some embodiments, the third requirement further requires that the second component gesture recognizer succeed within a predefined amount of time (e.g., a timeout period) from the end of the first component gesture recognizer.
In some embodiments, a repeating component gesture recognizer is similar to a sequential component gesture recognizer in requiring sequential success of its child gesture recognizers, except that the repeating component gesture recognizer has a single child component gesture recognizer that is reused or re-instantiated. In some embodiments, the child component gesture recognizer(s) of a repeating combiner are created sequentially (e.g., because the two child component gesture recognizers are a same type of component gesture recognizer (e.g., distinct instances of a same component gesture recognizer)). In some embodiments, a first child component gesture recognizer of the repeating combiner is created and associated with the repeating combiner, and used to process inputs and, after the first child succeeds and ends, the first child component gesture recognizer is destroyed, or removed from the gesture recognizer, and a second child component gesture recognizer (e.g., a second instance of the same type of component gesture recognizer as the first child) is created and associated with the repeating combiner, and subsequently used to process inputs.) An example repeating component gesture recognizer is described above with reference to repeater 522 in double-tap gesture recognizer 520,
Providing a sequential or repeating combiner that requires success, in turn, of multiple (child) gesture recognizers or component gesture recognizers allows for the formation of composite gestures through reuse of (or using instances of) such gesture recognizers or component gesture recognizers. This improves the variety of gestures that can be recognized while reducing the additional computation load typically imposed by monolithic gesture recognizers for increasingly diverse and complex gestures. This, in turn, improves device responsiveness and reduces latency, thereby enhancing the operability of the device and making the user-device interface more efficient (e.g., by helping the user to achieve an intended outcome and by reducing user mistakes when operating/interacting with the device).
In some embodiments, the first requirement of the first component gesture recognizer requires (736) that values of a parameter that describes the input (e.g., any of location, distance moved, timestamp, duration, intensity) satisfy a specified threshold (e.g., the first requirement requires that the parameter value not exceed a maximum threshold, and/or the first requirement requires that the parameter value meet a minimum threshold, as described herein with reference to
In some embodiments, the gesture recognizer is (738) a tap gesture recognizer (e.g., tap gesture recognizer 500,
In some embodiments, the second component gesture recognizer is a (maximum) duration component gesture recognizer that stores an initial timestamp corresponding to the point in time when the input was first detected and receives a current timestamp corresponding to the respective (e.g., current) point in time. In some embodiments, the duration component gesture recognizer receives the current timestamp of the input from a component gesture recognizer that identifies information about the input (e.g., an input event) that includes timestamp information. In some embodiments, the duration component gesture recognizer extracts the current timestamp of the input from information about the input (e.g., an input event) conveyed to the duration component gesture recognizer. In some embodiments, the second requirement defined by the second component gesture recognizer requires that an amount of time between the initial timestamp and the current timestamp be within a threshold (e.g., a predefined threshold) amount of time. In some embodiments, the second component gesture recognizer determines whether the input satisfies the second requirement.
In some embodiments, the tap gesture recognizer further includes a location component gesture recognizer that determines that the input has a current location at the respective point in time (e.g., a spatial event listener). In some embodiments, the tap gesture recognizer further includes a first gating combiner that requires success of the second component gesture recognizer and success of the location component gesture recognizer in order to succeed. In some embodiments, the tap gesture recognizer further includes a second gating combiner that requires success of the first gating combiner and success of the first component gesture recognizer in order to succeed. In some embodiments, the tap gesture recognizer further includes a pausing component gesture recognizer that prevents success of the tap gesture recognizer while any other gesture recognizer or component gesture recognizer having a higher priority than the tap gesture recognizer is actively processing the input (and has not yet failed).
In some embodiments, the gesture recognizer is a double-tap gesture recognizer. In some embodiments, the double-tap gesture recognizer includes a repeating component gesture recognizer that includes a tap gesture recognizer (e.g., all of the component gesture recognizers of the tap gesture recognizer, as described herein). In some embodiments, the repeating component gesture recognizer conveys information to and receives processing results from the root node component gesture recognizer of the tap gesture recognizer. In some embodiments, a repeating component gesture recognizer requires repeated success of the included gesture recognizer or component gesture recognizer. In some embodiments, the repeating component gesture recognizer defines a number of times that the included gesture recognizer or component gesture recognizer must succeed in order for the repeating component gesture recognizer to succeed (e.g., two times, three times, four times, etc.). In some embodiments, the repeating component gesture recognizer defines a timing requirement, such as a maximum permitted delay between successes of the included gesture recognizer. In one example, the repeating component gesture recognizer in the double-tap gesture recognizer requires the included tap gesture recognizer to succeed two times; in such an example, the repeating component gesture recognizer may optionally require that the tap gesture recognizer succeed a second time within a predefined time since the tap gesture recognizer succeeded the first time.
In some embodiments, the gesture recognizer is a pan gesture recognizer, where the pan gesture recognizer includes a pan event listener (e.g., a component gesture recognizer that identifies information about the input that indicates that the input has moved (e.g., without requiring that the information about the input indicate a current location of the input)).
In some embodiments, the gesture recognizer is a long-press gesture recognizer. In some embodiments, the long-press gesture recognizer is similar to a tap gesture recognizer, except that the long-press gesture recognizer includes a minimum duration component gesture recognizer instead of a maximum duration component gesture recognizer. Specifically, in some embodiments the long-press gesture recognizer includes a location component gesture recognizer (e.g., a spatial event listener) as described herein. In some embodiments, the long-press gesture recognizer further includes a distance component gesture recognizer that stores an initial location of the input corresponding to a point in time when the input was first detected and receives a current location of the input at a respective point in time. The distance component gesture recognizer defines a requirement for recognition of a long-press gesture that a distance between the initial location of the input and the current location of the input be within a threshold distance.
In some embodiments, the long-press gesture recognizer further includes a minimum duration component gesture recognizer that stores an initial timestamp corresponding to the point in time when the input was first detected and receives a current timestamp corresponding to the respective point in time. In some embodiments, the minimum duration component gesture recognizer receives the current timestamp of the input from a component gesture recognizer that identifies information about the input that includes timestamp information. In some embodiments, the minimum duration component gesture recognizer extracts the current timestamp of the input from information about the input conveyed to the minimum duration component gesture recognizer. The minimum duration component gesture recognizer defines a requirement for recognition of a long-press gesture that an amount of time between the initial timestamp and the current timestamp be at least a threshold (e.g., a predefined threshold) amount of time.
In some embodiments, the long-press gesture recognizer includes a first gating combiner that requires success of the location gesture recognizer and success of the minimum duration component gesture recognizer in order to succeed. In some embodiments, the long-press gesture recognizer includes a second gating combiner that requires success of the first gating combiner and success of the distance component gesture recognizer in order to succeed.
In some embodiments, the gesture recognizer is a pinch gesture recognizer, where the pinch gesture recognizer includes a first drag component gesture recognizer that listens for events with location information and determines movement information based on the location information, and a second drag component gesture recognizer that listens for events with location information and determines movement information based on the location information. In some embodiments, the pinch gesture recognizer includes a parallel combiner that associates the first drag component gesture recognizer with a first input (e.g., a first contact on a touch-sensitive surface) and that associates the second drag component gesture recognizer with a second input (e.g., a second contact on the touch-sensitive surface). In some embodiments, the parallel combiner conveys information about the first input to the first drag component gesture recognizer but not the second drag component gesture recognizer, and receives state information and values of parameters that describe the first input from the first drag component gesture recognizer. In some embodiments, the parallel combiner conveys information about the second input to the second drag component gesture recognizer but not the first drag component gesture recognizer, and receives state information and values of the parameters that describe the second input from the second drag component gesture recognizer. In some embodiments, the pinch gesture recognizer includes a pinch component gesture recognizer that receives the state information and parameter values for both the first input and the second input and determines, based on the state information and parameter values, a scale value (e.g., for zooming a displayed user interface element). An example pinch gesture recognizer is illustrated in and described herein with reference to
In some embodiments, the gesture recognizer is a rotate gesture recognizer. In some embodiments, a rotate gesture recognizer is similar to a pinch gesture recognizer, except that the rotate gesture recognizer includes a rotate component gesture recognizer instead of the pinch component gesture recognizer. In some embodiments, the rotate component gesture recognizer receives the state information and parameter values (e.g., location and movement information) for both the first input and the second input and determines, based on the state information and parameter values, an angle (e.g., for rotating a displayed user interface element) instead of a scale. Like the pinch gesture recognizer, the rotate gesture recognizer further includes a first drag component gesture recognizer that listens for events with location information and determines movement information based on the location information, a second drag component gesture recognizer that listens for events with location information and determines movement information based on the location information, and a parallel combiner that associates the first drag component gesture recognizer with a first input (e.g., a first contact on a touch-sensitive surface) and that associates the second drag component gesture recognizer with a second input (e.g., a second contact on the touch-sensitive surface).
With respect to any gesture recognizer, including any of the aforementioned example gesture recognizers, a user (e.g., an application developer) may add or remove modules to or from a gesture recognizer, or develop a modified version of any respective component gesture recognizer in the gesture recognizer and replace the respective component gesture recognizer with the modified version, so as to customize the gesture recognizer and thereby customize the requirements for recognition of a gesture by the gesture recognizer.
It should be understood that the particular order in which the operations in
As described below, method 800 provides an intuitive way for an electronic device to prioritize gesture recognizers to use in processing an input directed to a user interface of an application based on a view hierarchy that defines relationships between views in the user interface with which the gesture recognizers are associated. Forming a gesture recognition hierarchy between gesture recognizers based on the relationships between their associated views as defined in the view hierarchy facilitates processing inputs in a manner consistent with the displayed user interface and improves the responsiveness of the device, which in turn reduces latency. Reducing latency in responding to inputs reduces user mistakes when operating/interacting with the device, such as duplicative or extraneous inputs made by the user while waiting for the device to respond to the user's earlier input(s). Reducing the number and/or extent of the inputs from a user enhances the operability of the device and makes the user-device interface more efficient, which, additionally, reduces power usage and improves battery life of the device by enabling the user to use the device more quickly and efficiently.
The device displays (802), on the display, a user interface of an application (e.g., user interface 600,
The device detects (806), via the input device, an input (e.g., a touch input on the touch-sensitive surface) at a first location that corresponds to the displayed user interface.
The device processes (808) the input using a gesture recognition hierarchy (e.g., gesture recognition hierarchy 640) that includes the first gesture recognizer and the second gesture recognizer. A second relationship (e.g., a gesture-dependency relationship) between the first gesture recognizer and the second gesture recognizer (in the gesture recognition hierarchy) is determined based on the first relationship between the first view and the second view in the view hierarchy. In some embodiments, the gesture recognition hierarchy is formed in response to detecting an input (e.g., touch input 620), and based on a determination as to which view in the view hierarchy is the hit view (e.g., based on a determination that view 612 is the hit view). In some embodiments, the relationships between gesture recognizers in the gesture recognition hierarchy are defined based on the relationships between the views (corresponding to each gesture recognizer) in the view hierarchy with respect to the hit view, as described herein with reference to
In some embodiments, one or more views in the view hierarchy, other than the first view and the second view, include (810) respective gesture recognizers, and the gesture recognition hierarchy includes the respective gesture recognizers of the one or more other views. Specifically, in some embodiments, the view hierarchy includes a third view that includes a third gesture recognizer (e.g., view 602 that includes long press gesture recognizer 604,
In some embodiments, the device identifies (812) a subset of views in the view hierarchy that correspond to the first location, where the identified subset includes the first view and the second view, and where the gesture recognition hierarchy includes the respective gesture recognizers of the identified subset of views (e.g., as described herein with reference to gesture recognition hierarchy 640,
In some embodiments, the view hierarchy includes (814) one or more views that do not correspond to the first location, where the one or more views include one or more gesture recognizers, and the gesture recognition hierarchy does not include the one or more gesture recognizers of the one or more views that do not correspond to the first location (e.g., as described herein with reference to second tap gesture recognizer 618 of view 616,
In some embodiments, the gesture recognition hierarchy (sometimes called a gesture recognition tree) includes (816) a component gesture recognizer (e.g., an exclusive combiner, such as exclusive combiner 642,
In some embodiments, the gesture recognition hierarchy includes (818) a component gesture recognizer that defines the second relationship between the first gesture recognizer and the second gesture recognizer in the gesture recognition hierarchy. In some embodiments, processing the input using the gesture recognition hierarchy includes: receiving, at the gesture recognition hierarchy, information that describes the input; conveying the information that describes the input to the component gesture recognizer; and conveying the information that describes the input from the component gesture recognizer to at least one of the first gesture recognizer and the second gesture recognizer based on the second relationship between the first gesture recognizer and the second gesture recognizer. In some embodiments, processing the input using the gesture recognition hierarchy also includes, in accordance with a determination that the information that describes the input is conveyed to the first gesture recognizer, processing the information that describes the input using the first gesture recognizer. In some embodiments, processing the input using the gesture recognition hierarchy further includes, in accordance with a determination that the information that describes the input is conveyed to the second gesture recognizer, processing the information that describes the input using the second gesture recognizer.
Alternatively, in some embodiments, the device conveys, at a first time, the information that describes the input from the component gesture recognizer to the first gesture recognizer but not the second gesture recognizer, and at a second time after the first time, in accordance with a determination that the first gesture recognizer has failed to recognize the input, the device conveys the information that describes the input from the component gesture recognizer to the second gesture recognizer. For example, as explained above with respect to operation 718 of method 700, some combiners convey the information that describes the input (e.g., one or more input events) to all of their child component gesture recognizers based on information conveyance rules for that combiner or combiner type. Other combiners convey the information to only some of their child component gesture recognizers, based on information conveyance rules for that combiner or combiner type, either by conveying information about a first input of multiple inputs only to a first child and information about a second input of the multiple inputs only to a second child, or by conveying information about one or more inputs to a second child only after the first child succeeds or otherwise has completed processing the information.
Conveying information from a combiner in a gesture recognition hierarchy to at least one of first and second gesture recognizers based on the relationship between the first and second gesture recognizers defined by the combiner reduces unnecessary processing of an input by gesture recognizers that are not currently relevant to the input. This reduces the computational load on the device, which improves device responsiveness and reduces latency, thereby enhancing the operability of the device and making the user-device interface more efficient (e.g., by helping the user to achieve an intended outcome and by reducing user mistakes when operating/interacting with the device).
In some embodiments, processing the information that describes the input using the first gesture recognizer determines (820) a current state of the first gesture recognizer, and processing the information that describes the input using the second gesture recognizer determines a current state of the second gesture recognizer. In some embodiments, the device conveys the current state of the first gesture recognizer from the first gesture recognizer to the component gesture recognizer; conveys the current state of the second gesture recognizer from the second gesture recognizer to the component gesture recognizer; and processes, using the component gesture recognizer, the information that describes the input, the current state of the first gesture recognizer, and the current state of the second gesture recognizer, to determine a current state of the component gesture recognizer. In some embodiments, different component gesture recognizers have different information processing rules, and thus how the states are processed to determine the current state is determined by the processing rules for the component gesture recognizer type of the component gesture recognizer. Examples of determining states of gesture recognizers based on states of component gesture recognizers are described herein with reference to
In some embodiments, the first view includes (822) a third gesture recognizer, and the gesture recognition hierarchy includes the third gesture recognizer and a component gesture recognizer that defines a third relationship between the first gesture recognizer and the third gesture recognizer in the gesture recognition hierarchy. In some embodiments, the device determines a gesture recognition state of the first view by performing a plurality of operations. In some embodiments, the operations include conveying information that describes the input to the component gesture recognizer, the first gesture recognizer, and the third gesture recognizer. In some embodiments, the operations include processing the information that describes the input using the first gesture recognizer to determine a current state of the first gesture recognizer, and conveying the current state of the first gesture recognizer from the first gesture recognizer to the component gesture recognizer. In some embodiments, the operations also include processing the information that describes the input using the third gesture recognizer to determine a current state of the third gesture recognizer, and conveying the current state of the third gesture recognizer from the third gesture recognizer to the component gesture recognizer. In some embodiments, the operations further include processing, using the component gesture recognizer, the information that describes the input, the current state of the first gesture recognizer, and the current state of the third gesture recognizer, to determine the gesture recognition state of the first view. For example, the gesture recognition state of hit view 612 in
In some embodiments, if a view has only one gesture recognizer, then the (current) gesture recognition state of the view is the (current) gesture recognition state of the one gesture recognizer. In some embodiments, if a view has two or more gesture recognizers, then the two or more gesture recognizers are arranged in a gesture recognition hierarchy (e.g., a branch of a larger gesture recognition hierarchy that also includes gesture recognizers for other views) using one or more combiners that defines priority, or simultaneity, between the two or more gesture recognizers. In some embodiments, the gesture recognition state of the view is determined by the one or more combiners (e.g., by a combiner at a highest (root) node of the gesture recognition hierarchy for the view) based on the (current) states of the two or more gesture recognizers (e.g., a respective node determines its current state based on respective states of its child nodes in the gesture recognition hierarchy). For example, the gesture recognition state of view 606 in
Determining the gesture recognition state of a view based on the state of a component gesture recognizer that defines a relationship between two gesture recognizers in the view, where the state of the component gesture recognizer is in turn based on the states of the gesture recognizers, enables more complex input processing and improves the ability of the device to distinguish between different gestures without increasing the amount of processing required at the gesture recognizers. This simplifies event handling and reduces the computational load on the device when processing inputs, which in turn improves device responsiveness and reduces latency, thereby enhancing the operability of the device and making the user-device interface more efficient (e.g., by helping the user to achieve an intended outcome and by reducing user mistakes when operating/interacting with the device).
It should be understood that the particular order in which the operations in
As described below, method 900 provides an intuitive way for an electronic device to monitor an input using a gesture recognition tree (sometimes called a gesture recognition hierarchy) in which multiple gesture recognizers are arranged. Transferring values of parameters that describe the input between gesture recognizers in the tree provides the gesture recognizers with information about the input that is needed for processing inputs without requiring each gesture recognizer to separately determine the information, which reduces the computational load on the device when processing inputs, thereby improving device responsiveness and reducing latency. Reducing latency in responding to inputs reduces user mistakes when operating/interacting with the device, such as duplicative or extraneous inputs made by the user while waiting for the device to respond to the user's earlier input(s). Reducing the number and/or extent of the inputs from a user enhances the operability of the device and makes the user-device interface more efficient, which, additionally, reduces power usage and improves battery life of the device by enabling the user to use the device more quickly and efficiently.
The device detects (902) an input via the input device (e.g., a touch input on the touch-sensitive surface).
In response to detecting the input, the device monitors (904) the input using a gesture recognition tree having a plurality of nodes (e.g., a gesture recognizer assembled from a plurality of component gesture recognizers) (e.g., any gesture recognizer or gesture recognition hierarchy described herein with reference to
Monitoring the input using the gesture recognition tree includes (908): processing the input using a first node of the plurality of nodes, including determining a value of a first parameter of the one or more parameters; conveying the first parameter from the first node to a second node of the plurality of nodes; and processing the input using the second node, including determining, based on the first parameter, whether the input satisfies a gesture recognition requirement defined by the second node. In some embodiments, the gesture recognition requirement defined by the second node is one of a set of gesture recognition criteria defined by the gesture recognition tree (e.g., a gesture recognizer). An example of processing inputs to determine values of parameters that describe the inputs and conveying the values to other nodes for further processing of the inputs is described herein with reference to
In some embodiments, the one or more parameters that describe the input include (910) one or more of: a location at which the input was initially detected, a current location of the input, a distance traveled by the input (e.g., by a contact across a touch-sensitive surface), a velocity of the input (e.g., an instantaneous velocity, whether detected outright or derived from location and time information), a contact intensity (e.g., of a touch input), an initial timestamp corresponding to a time at which the input was first detected, and a current timestamp. For example,
In some embodiments, the first parameter is (912) a location of the input, and the gesture recognition requirement defined by the second node requires that a distance between an initial location of the input and a current location of the input satisfy a threshold distance. In some embodiments, the threshold distance is satisfied when the distance between the initial location and the current location exceeds a threshold distance (e.g., the input must move at least a minimum distance in order for the gesture recognition requirement defined by the second node to be satisfied, and for a gesture associated with the second node to be recognized). In some embodiments, the threshold distance is satisfied when the distance between the initial location and the current location is within a threshold distance (e.g., the input must not move more than a maximum distance in order for the gesture recognition requirement defined by the second node to be satisfied, and for a gesture associated with the second node to be recognized). In some embodiments, processing the input using the first node includes determining, using the first node, the current location of the input. In some embodiments, processing the input using the second node includes determining, using the second node, whether the distance between the initial location of the input (e.g., stored by the second node) and the current location of the input conveyed from the first node satisfies the threshold distance.
In some embodiments, the first parameter is (914) a timestamp corresponding to a respective point in time at which the input is detected, and the gesture recognition requirement defined by the second node requires that an amount of time between an initial timestamp corresponding to a first point in time at which the input was first detected and a current timestamp corresponding to a second point in time at which the input is detected satisfy a threshold amount of time. In some embodiments, the threshold amount of time is satisfied when the amount of time between the initial timestamp and the current timestamp exceeds a threshold amount of time (e.g., the input must continue to be detected (e.g., remain on the touch-sensitive surface, for a touch input) for at least a minimum amount of time in order for the gesture recognition requirement defined by the second node to be satisfied, and for a gesture associated with the second node to be recognized). In some embodiments, the threshold amount of time is satisfied when the amount of time between the initial timestamp and the current timestamp is within a threshold amount of time (e.g., the input must not continue to be detected (e.g., remain on the touch-sensitive surface) for more than a maximum amount of time in order for the gesture recognition requirement defined by the second node to be satisfied, and for a gesture associated with the second node to be recognized). In some embodiments, processing the input using the first node includes determining, using the first node, the current timestamp corresponding to the second point in time at which the input is detected. In some embodiments, processing the input using the second node includes determining, using the second node, whether the amount of time between the initial timestamp of the input (e.g., stored by the second node) and the current timestamp of the input conveyed from the first node satisfies the threshold amount of time.
In some embodiments, the device processes (916) the input using one or more of the plurality of nodes in the gesture recognition tree to determine values of the one or more parameters without regard to whether a gesture has been recognized by the gesture recognition tree (e.g., as described herein with reference to
In some embodiments, in response to detecting the input, the device receives (918), at the gesture recognition tree, first information that describes the input, where the value of the first parameter is determined from the first information, and where determining whether the input satisfies the gesture recognition requirement defined by the second node includes comparing the value of the first parameter to a prior value determined from second information received at the gesture recognition tree prior to receiving the first information (e.g., as described herein with reference to
It should be understood that the particular order in which the operations in
The operations described above with reference to
The foregoing description, for purpose of explanation, has been described with reference to specific embodiments. However, the illustrative discussions above are not intended to be exhaustive or to limit the invention to the precise forms disclosed. Many modifications and variations are possible in view of the above teachings. The embodiments were chosen and described in order to best explain the principles of the invention and its practical applications, to thereby enable others skilled in the art to best use the invention and various described embodiments with various modifications as are suited to the particular use contemplated.
This application claims priority to U.S. Provisional Patent Application No. 62/679,970, filed Jun. 3, 2018, which is hereby incorporated by reference in its entirety.
Number | Name | Date | Kind |
---|---|---|---|
20110179387 | Shaffer | Jul 2011 | A1 |
20120056818 | Shafi et al. | Mar 2012 | A1 |
20120133579 | Prieur | May 2012 | A1 |
20120280918 | Stewart et al. | Nov 2012 | A1 |
20130212541 | Dolenc | Aug 2013 | A1 |
20140361982 | Shaffer et al. | Dec 2014 | A1 |
20170046038 | Hajas et al. | Feb 2017 | A1 |
Number | Date | Country |
---|---|---|
WO-2011151501 | Dec 2011 | WO |
Entry |
---|
International Search Report and Written Opinion, dated Sep. 16, 2019, received in International Publication No. PCT/US2019/034839, which corresponds with U.S. Appl. No. 16/427,203, 17 pages. |
Number | Date | Country | |
---|---|---|---|
20190369864 A1 | Dec 2019 | US |
Number | Date | Country | |
---|---|---|---|
62679970 | Jun 2018 | US |