Lecture Set 13 Drawing Mouse and Keyboard Events Part B – Mouse and Keyboard Events.

Slides:



Advertisements
Similar presentations
Event handling and listeners What is an event? user actions and context event sources and listeners Why should my programs be event- driven? User interaction.
Advertisements

Instruction: Use mouses left button. Use mouses left button. If mouse buttons dont work, use arrow keys of keyboard for slide show. If mouse buttons dont.
Instruction: Use mouses left button. Use mouses left button. If mouse buttons dont work, use arrow keys of keyboard for slide show. If mouse buttons dont.
The jQuery library. What is jQuery ? A javascript lightweight library Is very easy to use Is powerful Is cross-browser compatible Downloadable from jQuery.com,
CS7026 jQuery Events. What are Events?  jQuery is tailor-made to respond to events in an HTML page.  Events are actions that can be detected by your.
Pemrograman VisualMinggu …8… Page 1 MINGGU Ke Delapan Pemrograman Visual Pokok Bahasan: Graphical User Interface Tujuan Instruksional Khusus: Mahasiswa.
1 Fac.Scienze – Università di Trento Programmazione 2 - Marco Ronchetti Events Gestione degli eventi.
Event Handling. Overview How to listen (and not listen) for events Creating a utility library (and why you should) Typology of events Pairing event listeners.
DESCRIBING INPUT DEVICES
Microsoft® Small Basic
© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. 1 Tutorial 21 - “Cat and Mouse” Painter Application.
Mouse event handling Mouse events( delegates EventHandler, event arguments EventArgs) MouseEnter: raised if the mouse cursor enters the area of the control.
Event Handling Events and Listeners Timers and Animation.
Tutorial 15 Working with the Event Model. XP Objectives Compare the IE and W3C event models Study how events propagate under both event models Write a.
Events. Events Single Event Handlers Click Event Mouse Events Key Board Events Create and handle controls in runtime Outline.
Introduction to Computing Dr. Nadeem A Khan. Lecture 13.
Mouse event handling Mouse events( delegates EventHandler, event arguments EventArgs) MouseEnter: raised if the mouse cursor enters the area of the control.
XP Tutorial 8 New Perspectives on JavaScript, Comprehensive1 Working with the Event Model Creating a Drag-and-Drop Shopping Cart.
Scripts  Director’s scripting language is called Lingo  Lingo can be used to offer your users navigational control of the order of the scenes of your.
Software Engineering1 The.NET Framework and the CLI 2D Graphics with GDI+ Visual Studio.NET 2008.
CS0004: Introduction to Programming Events. Review  Event Procedure  A set of instructions to be executed when a certain event happens.  Many event-driven.
CSCI 3327 Visual Basic Chapter 10: Windows Forms GUI: A Deeper Look UTPA – Fall 2011.
1 Lecture 5: Conventional Input Models for Window Managers and Toolkits Brad Myers Advanced User Interface Software © Brad Myers.
CSC 298 Windows Forms.
T U T O R I A L  2009 Pearson Education, Inc. All rights reserved Typing Application Introducing Keyboard Events, Menus, Dialogs and the Dictionary.
Keyboard and Events. What about the keyboard? Keyboard inputs can be used in many ways---not just for text The boolean variable keyPressed is true if.
Processing Lecture.2 Mouse and Keyboard
© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. Chapter 12 - Graphical User Interface Concepts: Part.
Timer, Animation Responding to Mouse & Keyboard Lab 7 7 McGraw-Hill© 2006 The McGraw-Hill Companies, Inc. All rights reserved.
COM148X1 Interactive Programming Lecture 7. Topics Today HCI Event Handling.
BIM211 – Visual Programming Interacting with Users Graphics 1.
© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. 1 Tutorial 21 - “Cat and Mouse” Painter Application.
Selecting cells on the worksheet To make a cell or range of cells the target of a command in Excel, the cells must be selected. We can select a single.
Internet & World Wide Web How to Program, 5/e. © by Pearson Education, Inc. All Rights Reserved.
Agenda Introduction. Event Model. Creating GUI Application. Event Examples.
The Web Wizard’s Guide To DHTML and CSS Chapter 6 Understanding Events.
Introduction to Programming the WWW I CMSC Winter 2003 Lecture 12.
1 Actionscript for Flash by Dr SC Li. 2 Understanding more about instances Symbolsgraphics buttons Movie clips Instances (without names) No interaction.
MIS333k(Poynor) Chapter 2. Intro to VBA Events Where to plug in your programs?
Computer Vocabulary Computer
PPT2.01 CREATING AND MODIFYING TEXT AND GRAPHIC OBJECTS Dr. Ennis-Cole.
Host Objects: Browsers and the DOM
CPSC 481 – Week #7 Sowmya Somanath
 2002 Prentice Hall. All rights reserved. 1 Outline Mouse Event Handling Keyboard Event Handling Graphical User Interface Concepts:
Events Event Handling in JavaScript SoftUni Team Technical Trainers Software University
CISC 110 Day 6 Introduction to Events. Outline Event-Driven Programming Event Classes Hierarchy –Event Class –Mouse Events –Keyboard Events Registering.
JavaScript Events.
Modern JavaScript Develop And Design Instructor’s Notes Chapter 8 – Event Handling Modern JavaScript Design And Develop Copyright © 2012 by Larry Ullman.
Implement User Input Windows Development Fundamentals LESSON 2.4A.
Introduction to JavaScript Events Instructor: Sergey Goldman 1.
Internet & World Wide Web How to Program, 5/e.  JavaScript events  allow scripts to respond to user interactions and modify the page accordingly  Events.
CSE 154 LECTURE 10: MORE EVENTS. Problems with reading/changing styles Click Me HTML window.onload = function() { document.getElementById("clickme").onclick.
Jackson, Web Technologies: A Computer Science Perspective, © 2007 Prentice-Hall, Inc. All rights reserved Chapter 5 Host Objects: Browsers.
Dr. Abraham Professor UTPA Graphical User Interface.
CHAPTER 8 TAMING THE MOUSE
Validating User Input Lesson 5.
JavaScript and Events.
Visual Basic Properties, Methods and Events
CSE 154 Lecture 11: More Events.
Chapter 15 Event-Driven Programming and Animations
Working with the Event Model
Introduction to jQuery
Visual programming Chapter 4: GUI (Graphical User Interface) Part II
Lesson 2: Selecting Cells, Rows, and Columns
JavaScript and Events CS Programming Languages for Web Applications
CS7026 jQuery Events.
Lecture 11: Keyboard Events
CHAPTER 6 EVENTS. CHAPTER 6 EVENTS WHAT IS AN EVENT?
CHAPTER 8 TAMING THE MOUSE
JavaScript and Events CS Programming Languages for Web Applications
Presentation transcript:

Lecture Set 13 Drawing Mouse and Keyboard Events Part B – Mouse and Keyboard Events

Slide 2 Objectives Create event handlers for mouse events Determining the position of the mouse Determining which mouse button was clicked Learning when events, such as MouseClick, MouseDown, MouseEnter, MouseHover, and MouseMove fire Create event handlers for keyboard events Determining which keyboard button was clicked Learning when events, such as KeyUp, KeyDown, and KeyPress fire Learn about keyboard properties such as KeyChar, KeyData, and KeyCode and KeyValue

Slide 3 Add more material on mouse events THIS SLIDE SET NOT YET COMPLETE Get material from Ch 13 of Ekedahl original version of text Get material on keyboard events from Dietel, pp 513ff

Slide 4 Introduction to Mouse Events The MouseClick event fires when the end user clicks the mouse on a form The MouseDown and MouseUp events fire when the end user presses and releases the mouse, respectively The MouseEnter and MouseLeave events fire as the mouse enters and leaves a control instance The MouseMove event fires whenever the end user moves the mouse

Slide 5 Determining Mouse Information In graphical applications, it is necessary to get the position of the mouse to determine where to draw a shape It is often necessary to determine which mouse button was clicked The state of modifier keys (Ctrl, Alt, Shift) must also be determined It is often necessary to determine whether the mouse wheel was scrolled

Slide 6 The MouseEventArgs Class The MouseEventArgs class is used to get information about the mouse Use the Button property to determine which mouse button was clicked Use the X and Y properties to determine the position of the mouse Use the Delta property to determine the number of detents the mouse wheel was scrolled