No. I am in Pmode.Pype.Clicker wrote: Are you in protected mode ? We do not even know ...
YO! THIS IS REALLY ANNOYING!!! (MESSED UP KBD ROUTINE)
Re:YO! THIS IS REALLY ANNOYING!!! (MESSED UP KBD ROUTINE)
Re:YO! THIS IS REALLY ANNOYING!!! (MESSED UP KBD ROUTINE)
Therx: I am going to try your code (and restart my computer), so I'll be gone for some time. Thanks for help.
- Pype.Clicker
- Member
- Posts: 5964
- Joined: Wed Oct 18, 2006 2:31 am
- Location: In a galaxy, far, far away
- Contact:
Re:YO! THIS IS REALLY ANNOYING!!! (MESSED UP KBD ROUTINE)
Just adding &keypress will not sufficient! you cannot guarantee the single-character 'keypress' will be followed by some 0 character to terminate the string, so you're likely to see random garbage on screen.Therx wrote: SurelyCode: Select all
output(STDTXT,1,0,&keypress);
-
- Member
- Posts: 1600
- Joined: Wed Oct 18, 2006 11:59 am
- Location: Vienna/Austria
- Contact:
Re:YO! THIS IS REALLY ANNOYING!!! (MESSED UP KBD ROUTINE)
I agree with Pype.
It is better to stuff the scancodes in a kind of circular buffer, whch keeps them for some routine that interprets and hands them over as characters (modified with shift, alt, etc - kbd-led-switching too ...) to the console/task that requested the input.
an other routine shall be responsible for stuffing the chars to screen/input buffer (some empty string f. ex - via stream-like functions)
stay safe gosh
It is better to stuff the scancodes in a kind of circular buffer, whch keeps them for some routine that interprets and hands them over as characters (modified with shift, alt, etc - kbd-led-switching too ...) to the console/task that requested the input.
an other routine shall be responsible for stuffing the chars to screen/input buffer (some empty string f. ex - via stream-like functions)
this char *string thing is fuzzy. Why don't you just pass the character in question by value (it is just located on the stack)? It would ease your life to use pointers only where they are really necessary.int output(int color, int row, int col, char *string) ;
stay safe gosh
... the osdever formerly known as beyond infinity ...
BlueillusionOS iso image
BlueillusionOS iso image
- Pype.Clicker
- Member
- Posts: 5964
- Joined: Wed Oct 18, 2006 2:31 am
- Location: In a galaxy, far, far away
- Contact:
Re:YO! THIS IS REALLY ANNOYING!!! (MESSED UP KBD ROUTINE)
You #define'd NULL 0, but in most implementations, NULL is defined as (void*)0. If for some obscure reason a generic header file is declaring NULL before you (and i suspect this is the case, otherwise why would you have #ifndef NULL ?), then there is a conflict when you have unshifted[]={NULL, ... }Mastermind wrote: When I compile the code, the asciiShift[] and the asciiNonSh[] in the keydefs.h always gives me problems (initialization makes integer from pointer without a cast).
I suggest you give a look to the output of gcc -E your-main-file.c, (after the pre-processing stage) so that you'll be aware of what is actually read by the compiler when it processes your file.
Re:YO! THIS IS REALLY ANNOYING!!! (MESSED UP KBD ROUTINE)
No. I was refering to your code(Pype.Clicker).
char keypress[2]; is not a pointer(is it?) so you will need the &keypress
char keypress[2]; is not a pointer(is it?) so you will need the &keypress
Re:YO! THIS IS REALLY ANNOYING!!! (MESSED UP KBD ROUTINE)
char keypress[2]; is an array. Arrays decay to pointers when passed to functions; this effectively means that arrays and pointers are the same thing.