Lecture 6: Window Manager Input Models

Slides:



Advertisements
Similar presentations
Human Centric Computing Assignment 2 Proposal 15.
Advertisements

1 Lecture 10: Toolkits: Intrinsics, Callbacks, Resources, Widget hierarchies, Geometry management Brad Myers Advanced User Interface Software.
Event Handling. In this class we will cover: Keyboard Events Mouse Events Focus Events Action Interface Multicasting.
1 Lecture 5: Window Manager Input Models Brad Myers Advanced User Interface Software.
I/O Tanenbaum, ch. 5 p. 329 – 427 Silberschatz, ch. 13 p
1 Lecture 5: Conventional Input Models for Window Managers and Toolkits Brad Myers Advanced User Interface Software © Brad Myers.
Java Software Solutions Lewis and Loftus Chapter 10 1 Copyright 1997 by John Lewis and William Loftus. All rights reserved. Graphical User Interfaces --
Lecture 5: Interaction 1  Principles of Interactive Graphics  CMSCD2012  Dr David England, Room 711,  ex 2271 
Chapter 34 Java Technology for Active Web Documents methods used to provide continuous Web updates to browser – Server push – Active documents.
Gary MarsdenSlide 1University of Cape Town Human-Computer Interaction - 3 Programmer Support Gary Marsden ( ) July 2002.
Java Programming: Guided Learning with Early Objects
Building X Window GUIs with Motif The X Window System: Architecture Applications Sample code Review function (as time permits) … Introduce what it’s like.
Lecture 10: Toolkits: Intrinsics, Callbacks, Resources, Widget hierarchies, Geometry management Brad Myers Advanced User Interface Software 1© 2013.
SWING 101. IF YOU GET LOST - IMPORTANT LINKS  Swing articles:
1 Creating Windows GUIs with Visual Studio. 2 Creating the Project New Project Visual C++ Projects Windows Forms Application Give the Project a Name and.
1 Lecture 2: Overview of UI Software and Tools Brad Myers Advanced User Interface Software.
X-WindowsP.K.K.Thambi The X Window System Module 5.
Stanford hci group / cs376 u Jeffrey Heer · 26 May 2009 User Interface Toolkits.
Processes, Threads, and Process States. Programs and Processes  Program: an executable file (before/after compilation)  Process: an instance of a program.
1 Lecture 5: Interactive Tools: Prototypers (HyperCard, Director, Visual Basic), Interface Builders Brad Myers Advanced User Interface Software.
Thread basics. A computer process Every time a program is executed a process is created It is managed via a data structure that keeps all things memory.
CSE 425: Control Abstraction II Exception Handling Previous discussion focuses on normal control flow –Sometimes program reaches a point where it cannot.
12-Jun-16 Event loops. 2 Programming in prehistoric times Earliest programs were all “batch” processing There was no interaction with the user Input Output.
Drawing!. Why Drawing? Drawing is crucial to any graphical application Understanding.
Chapter 5: Enhancing Classes Presentation slides for Java Software Solutions Foundations of Program Design Second Edition by John Lewis and William Loftus.
User Interface Programming X Window Jozef Mlích Department of Computer Graphics and Multimedia Faculty of Information Technology, Brno University.
Lecture 5: Conventional Input Models for Window Managers and Toolkits
The structure of Interactive Software
Forms Concepts Triggers Fired when Internal/External events occur
Module 12: I/O Systems I/O hardware Application I/O Interface
Chapter 13: I/O Systems Modified by Dr. Neerja Mhaskar for CS 3SH3.
Processes and threads.
EE 200 Design Tools Laboratory 14
Working in the Forms Developer Environment
Event Loops and GUI Intro2CS – weeks
Microprocessor Systems Design I
Introduction to Computer CC111
Event loops 16-Jun-18.
Goals Give student some idea what this class is about
Event Driven Programming Dick Steflik
Prototyping.
Chapter Eleven Handling Events.
Chapter 3 Software Interfaces.
Windows Desktop Applications
Chap 7. Building Java Graphical User Interfaces
Graphical User Interfaces -- Introduction
Event Driven Programming
User Interface Software Look under the hood
Andrew J. Ko & Brad A. Myers Carnegie Mellon University
Topic 8: (Last two papers)
Concepts From Alice Switching to Java Copyright © Curt Hill.
Event loops.
Operating System Concepts
CS703 - Advanced Operating Systems
Event loops 17-Jan-19.
Event loops 17-Jan-19.
Ainsley Smith Tel: Ex
Chapter 13: I/O Systems I/O Hardware Application I/O Interface
Event loops 8-Apr-19.
Tonga Institute of Higher Education IT 141: Information Systems
JavaScript and Events CS Programming Languages for Web Applications
Tonga Institute of Higher Education IT 141: Information Systems
Input & Output CS 422: UI Design and Programming
Event loops.
Event loops.
Event loops 19-Aug-19.
JavaScript and Events CS Programming Languages for Web Applications
Module 12: I/O Systems I/O hardwared Application I/O Interface
Chapter 13: I/O Systems “The two main jobs of a computer are I/O and [CPU] processing. In many cases, the main job is I/O, and the [CPU] processing is.
Presentation transcript:

Lecture 6: Window Manager Input Models Brad Myers 05-830 Advanced User Interface Software

Quotes “One of the most complex aspects of Xlib programming is designing the event loop, which must take into account all of the possible events that can occur in a window.” -- Nye & O'Reilly X Toolkit Intrinsics Programming Manual, vol. 4, 1990, p. 241. “The dispatching and handling of events is rather complicated.” -- Galaxy Reference Manual, v1.2, p. 20-5.

How Keyboard and Mouse Events are Handled Most window manager and toolkits use the same model Quite old and has problems

Event Records Structures (records) composed of all information about events Created by window manager, sent to a queue for each window X defines 33 different types of events Except for selectionRequest, the X/11 “*request” events are only for window managers

X Event Types visibilityNotify (become covered) resizeRequest circulateNotify (stacking order) configureNotify (resize or move) destroyNotify (was destroyed) gravityNotify (moved due to gravity) mapNotify (became visible) createNotify reparentNotify (in diff. window) unmapNotify (invisible) circulateRequest configureRequest mapRequest mappingNotify (keyboard mapping) clientMessage selectionClear (for cut and paste) selectionNotify selectionRequest buttonPress keyPress keyRelease buttonRelease motionNotify enterNotify leaveNotify focusIn focusOut keymapNotify (change keymap) Expose graphicsExpose (source of copy not available) noExpose (source of copy is available) colormapNotify propertyNotify (some property changed)

Other events Java has events for: Visual Basic has events for: MouseMove vs. MouseDrag Java event hierarchy Java event tutorial Visual Basic has events for: Drag Drop Timer Windows specifically declare which events they want to receive using event masks Reduces network traffic and unnecessary processing Event masks also used for other things in X “pointerGrab”

Event Handling Toolkits (e.g., Visual Basic) automatically handle expose and some other events for the widgets. Structured graphics systems (e.g., Amulet) automatically handle many of the events. Events (in X) are C-language union type of many event structures that are all the same size but with different field names. Key and mouse events contain (at least): x position of the mouse y position of the mouse window of the mouse event type event code event modifiers timestamp

Waiting for Events Low-level routine that waits for event wants to be blocking rather than polling for efficiency Calls specified routines when events arrive Macintosh (used to?) use polling for mouse location Toolkits provide this internally, e.g.: XtAppMainLoop(...) Am_Main_Event_Loop() in Amulet Can specify timeouts so notified after certain time if no events Can ask X to flush multiple motion events If not handled fast enough, get weird lag Garnet tries to do extra flushing to avoid this Not an issue if polling for motion events Problem for polylines, gestures, etc.

Propagation Events sent to the lowest level window containing the pointer. If event not selected with event-mask, then sent to the container window, etc. Can't specify individual keys (get all keys and may have to explicitly resend events)

Translation Tables So particular mouse key or keyboard key not hard-wired into application. Allows user customization and easier changes Supported in Motif by the resources mechanism e.g. Shift<Btn1Down>: doit() can be put in .Xdefaults, and then application deals with doit, and user can change bindings. Keyboard translation is 2 step process in X: Hardware "keycodes" numbers mapped to "keysyms" "Keysyms" translated to events For double-clicking, Motif does translation, but not Xlib For non-widgets, have to do it yourself Always also get the single click events

X-11 Scrolling Issue Race condition when copy from an area that might be covered Need to use graphicsExpose and noExpose events