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
AI Thread Summary
The discussion centers on capturing keyboard scan codes in Pascal, particularly when modifier keys like "Alt" or "Ctrl" are involved. The user recalls using TurboPascal 7.0 and is curious about how to detect scan codes for keys modified by these modifiers. They mention that for arrow keys, specific codes (like 0 + 75) were used, but they seek clarity on how to check the keyboard buffer for keys with modifiers. Additionally, there is a question about whether combinations like "Alt-F4" generate a single scan code or multiple keypresses. The user invites further questions for clarification.
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
In my discussions elsewhere, I've noticed a lot of disagreement regarding AI. A question that comes up is, "Is AI hype?" Unfortunately, when this question is asked, the one asking, as far as I can tell, may mean one of three things which can lead to lots of confusion. I'll list them out now for clarity. 1. Can AI do everything a human can do and how close are we to that? 2. Are corporations and governments using the promise of AI to gain more power for themselves? 3. Are AI and transhumans...
Thread 'ChatGPT Examples, Good and Bad'
I've been experimenting with ChatGPT. Some results are good, some very very bad. I think examples can help expose the properties of this AI. Maybe you can post some of your favorite examples and tell us what they reveal about the properties of this AI. (I had problems with copy/paste of text and formatting, so I'm posting my examples as screen shots. That is a promising start. :smile: But then I provided values V=1, R1=1, R2=2, R3=3 and asked for the value of I. At first, it said...

Similar threads

Back
Top