How Do Keyboard Scan Codes Work with Modified Keys like 'Alt' or 'Ctrl'?

  • Thread starter Thread starter aychamo
  • Start date Start date
  • Tags Tags
    Code Keyboard
Click For Summary
SUMMARY

This discussion focuses on the mechanics of keyboard scan codes in relation to modified keys such as 'Alt' and 'Ctrl'. The user reflects on experiences with Turbo Pascal 7.0, specifically regarding the detection of keyboard scan codes for modified keys. It is established that combinations like "Alt-F4" are interpreted as multiple keypresses rather than a single scan code. The conversation emphasizes the need to understand how the keyboard buffer handles these modifications.

PREREQUISITES
  • Understanding of keyboard scan codes
  • Familiarity with Turbo Pascal 7.0 programming
  • Knowledge of keyboard buffer mechanics
  • Basic concepts of key modifiers (e.g., Alt, Ctrl)
NEXT STEPS
  • Research how to capture keyboard input in Turbo Pascal
  • Learn about keyboard buffer management in programming
  • Explore the differences between scan codes and virtual key codes
  • Investigate handling of key combinations in modern programming languages
USEFUL FOR

Programmers, especially those with an interest in low-level keyboard input handling, and anyone looking to understand the interaction between key modifiers and scan codes in programming environments like Turbo Pascal.

aychamo
Messages
375
Reaction score
0
Hey guys;

I was driving the other night, and I was thinking about some programs I used to write many years ago in Pascal (like ~ 11-12 years ago in TurboPascal 7.0, or was it 6.0?) in which I used to catch the keyboard scan codes.

I realized that I neve caught a keyboard scan code for a key that was modified with "Alt" or "Ctrl". I remember for an arrow key you would check for (0 + 75) or something. How would you check the keyboard "buffer" for presence of a key which is modified with Alt or Ctrl?

Also, would, say, "Alt-F4" be a single keyboard scan code, or would the keyboard interpret it as mulitple keypresses?

I'm just curious :)
 
Computer science news on Phys.org

Similar threads

Replies
3
Views
3K