davidcallanan / os-series

818 stars 119 forks source link

Im trying to make input. #21

Open Toni-d-e-v opened 3 years ago

Toni-d-e-v commented 3 years ago

Is there any way I can include stdio.h or something just to get scanf func, or how to make it and include it like in print.h thanks in advance

fortmea commented 3 years ago

probably not, i tried

zevaryx commented 3 years ago

Adding input requires that you add:

and various other items before you can even begin to add keyboard support. I'm sure we'll get there eventually, but it'll take at least an episode or two more before we are there (if we keep up the current pace, that is).

Roseinabox28 commented 3 years ago

take a look at this

Roseinabox28 commented 3 years ago

I went and started implementing this

Toni-d-e-v commented 3 years ago

thx

Kjur0 commented 3 years ago

Issue #14 is also helpfull

rualark commented 3 years ago

I went and started implementing this

This seems a very good start, but it has several problems that should be fixed:

  1. There is an unneeded delay between pressing different keys and there is too short delay between autorepeating the same key that is pressed for a long time. Probably, as a start, "no autorepeating at all" seems a good strategy, because actually autorepeating is usually needed only for long cursor movement and long backspaces.
  2. Delay currently depends on CPU speed. Using timer will be better. Do you have ideas how to implement this?
  3. Depressing Left Shift still continues to input upper case letters.
  4. Caps lock is not processed correctly - instead it is processed as some unknown key.
  5. Pressing Right Shift hangs the whole program.
  6. Pressing Backspace results in strange behavior when near left edge of the screen.
rualark commented 3 years ago

I went and started implementing this

Thank you so much for your inspiration! It is interesting that input can be implemented without interrupts. I tried to improve input code:

I also implemented precise nanosleep and added beep.

https://github.com/rualark/SimpleOsDemo