Keyboard and Mouse Programming

Julio Sanchez, Maria P. Canton · 2018

Most applications require user input and control operations. The most common input devices are the keyboard and the mouse. This chapter discusses keyboard and mouse programming in Windows. Since the first days of computing, typing on a typewriter-like keyboard has been an effective way of interacting with the system. Although typical Windows programs rely heavily on the mouse device, the keyboard is the most common way to enter text characters into an application. The application that holds the input focus is the one that gets notified of the user’s keystrokes. A user can visually tell which window has the input focus since it is the one whose title bar is highlighted. This applies to the parent window as well as to child windows, such as an input or dialog box. The application can tell if a window has the input focus by calling the GetFocus() function, which returns the handle to the window with the input focus.

Read the paper · More papers on PaperTik