Interfacing.

Slides:



Advertisements
Similar presentations
FatMax Licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 2.5 LicenseCreative Commons Attribution-NonCommercial-ShareAlike 2.5.
Advertisements

Operating Systems High Level View Chapter 1,2. Who is the User? End Users Application Programmers System Programmers Administrators.
Figure 2.8 Compiler phases Compiling. Figure 2.9 Object module Linking.
Week 3 C For Win Lecture :.  Mouse Message  Keyboard Message.
CHARACTERS Data Representation. Using binary to represent characters Computers can only process binary numbers (1’s and 0’s) so a system was developed.
 At the end of this class, students are able to  Describe definition of input devices clearly  List out the examples of input devices  Describe.
04/05/031 Computer Input and Output Dairne Jesperson Charles Darwin University.
Keyboard In computing, a keyboard is an input device, partially modeled after the typewriter keyboard, which uses an arrangement of buttons or keys, to.
Prepared by Fareeha Lecturer DCS IIUI 1 Windows API.
Overview of Previous Lesson(s) Over View  Visual C++ provides us with 3 basic ways of creating an interactive Windows application  Using the Windows.
CSE3AGT Paul Taylor Stupid Conventions! l = Long p = Pointer h = handle g = global wnd = Windows WM = Windows Message d3d = Direct3D hr = HRESULT.
Direct3D Workshop November 17, 2005 Workshop by Geoff Cagle Presented by Players 2 Professionals.
CHAPTER 5 Input Control © 2008 Cengage Learning EMEA.
CS350 – Windows Programming Formerly and more properly named: Event Driven Programming Dr. Randy Ribler.
Chapter 3 The mouse and the Keyboard. Getting input from the Mouse.
1 Contents  Audio  Sprite  Input devices  Game production milestones  Course summary.
11 General Game Programming Approach. The program is event-driven The program is event-driven –Messages = events –So as all windows system (for example.
Programming Input Devices. Getting the device state Schemes for processing input – Polling – Callbacks Ways to intercept messages from input devices –
The WM_NCHITTEST Message  This is an internal message used by Windows for generating all the other mouse messages.  Though it almost never needs to be.
Section 2B. Objectives List two reasons why some people prefer alternative methods of input over a standard keyboard or mouse. List three categories of.
Keyboard Introduction Keyboard is an input device. It is used to give text, numbers and controls as input to computer. The.
INPUT AND OUTPUT DEVICES. INPUT ALL THE ELEMENTS THAT HELP TO PUT INFORMATION INSIDE THE COMPUTER.
Chapter 3 Keyboard Input Department of Digital Contents Sang Il Park.
BIT 115: Introduction To Programming Professor: Dr. Baba Kofi Weusijana Pronounced Bah-bah Co-fee Way-ou-see-jah-nah Call him “Baba” or “Dr. Weusijana”
WORKING OF SCHEDULER IN OS
Input Devices.
6. Application Server Issues for the Project
Binary Representation in Text
Binary Representation in Text
Computer Science.
BASIC PROGRAMMING C SCP1103 (02)
The Caps Lock Key When you press this key, a small light on the keyboard comes on. Whenever this light is on, any letter key you press will result in.
CS345 – Event-driven Programming
Standard Methods of Input.
8279 Keyboard / Display Interface
Windows Programming Lecture 11
Resource Management IB Computer Science.
Clocks, I/O devices, Thin Clients, and Power Management
Methods of Computer Input and Output
CHAPTER 5 Input Control © 2008 Cengage Learning EMEA.
Event Loops and GUI Intro2CS – weeks
CCNA 2 v3 JEOPARDY Module 2 CCNA2 v3 Module 2 K. Martin.
Lesson Objectives Aims Key Words Interrupt, Buffer, Priority, Stack
Programming Input Devices
BASIC PROGRAMMING C SCP1103 (02)
Windows Programming Lecture 09.
Introduction to Computers
DIGITAL CALCULATOR USING 8051
Summer 2001 James Amyot Robert Gowans
A keyboard generates two scan codes when the user types a key
Chapter 8 I/O.
Introduction to Computer Graphics with WebGL
e-business and Information Systems
NBKeyboard: An Arm-based Word-gesture keyboard
Course Outline Input Unit Keyboard, Mouse, Scanner, OMR, OCR, MICR
Windows Development Dynadata Copyright, 2014 © DynaData S.A. 1/10.
Queued and Nonqueued Messages
3 10 A B 0.25 C 1 2 D 25% 7 20 E 20% F 0.35 G H 0.2 To edit presentation: change text in shapes, select all shapes by clicking on shape and pressing CTRL.
CS703 - Advanced Operating Systems
Topics Introduction Hardware and Software How Computers Store Data
Keyboard and mouse in Windows API
Chapter 8 I/O.
Lecture Topics: 11/1 General Operating System Concepts Processes
COMPUTER PERIPHERALS AND INTERFACES
Dep. of Information Technology By: Raz Dara Mohammad Amin
There are different types of translator.
Chapter 8 I/O.
KEYBOARD and IMPORTANT KEYS
User Input Keyboard input.
Windows Development Dynadata Copyright, 2014 © DynaData S.A. 1/19.
Presentation transcript:

Interfacing

Signal translated to ASCII Message sent to window and to Caret Key pressed Kernel get it Signal translated to ASCII Message sent to window and to Caret

Cursor vs Caret Cursor – graphical image to indicate position Caret – flashing object for text input

Keys messages WM_KEYDOWN WM_KEYUP LPARAM bits Meaning 0-15 Times a key was pressed 16-23 Key code 29 Context code 30 Previous key state 31 Transition state

Caret System provides one caret per message queue (read more about message queue) Window creates a caret only when it has the keyboard focus or is active Only one active caret at the moment! WM_SETFOCUS WM_KILLFOCUS

Cursor (mouse) Mouse can send a lot of messages. In addition LPARAM and WPARAM variables stores additional information.

Mouse messages (standart) WM_LBUTTONDBLCLK WM_LBUTTONDPWN WM_LBUTTONUP WM_MBUTTONDOWN WM_MBUTTONUP WM_MOUSEMOVE WM_MOUSEWHEEL WM_RBUTTONDOWN WM_BUTTONUP

LPARAM stores information about X-Y coordinates, and WPARAM – SHIFT and CTRL state. System provides support for mouse tracking, but program can interfere into mouse movement or messages sent.

Timer Used to interrupt program’s workflow Message queue Though timer isn’t input device, but it can send input messages to window, thus it can be considered as one. Native timer’s time function isn’t accurate enough to use with games or time response (DirectX API)

How to use? SetTimer – create a timer KillTimer – destroys a timer WM_TIMER – message sent to window after the set time is run out

Two ways... It is possible to process WM_TIMER message inside window procedure It is possible to define feedback function TimerProc to process message

TimerProc

Timer message(s) Timer sends only one message – WM_TIMER Variable WPARAM keeps timers ID