Hi,
I had to write a small console program in Linux and notified,
that ConsoleClear(), ConsoleLocate() and ConsoleColor() is only for Windo..
If you want to know how it is possible to use such features, look here:
http://www.purebasic.fr/english/viewtop ... 93#p312593
I hope this functions will be implemented in a later version of PB
Bernd
'graphical' console in Linux, maybe MAC too
Re: 'graphical' console in Linux, maybe MAC too
While we're on the subject, I also figured out how to capture arrow keys.
The Inkey() example, in the help, quits when an arrow key is pressed, it's because these keys return Esc codes too.
Esc[A = Up
Esc[B = Down
Esc[C = Right
Esc[D = Left
Here is my altered Inkey() help
The Inkey() example, in the help, quits when an arrow key is pressed, it's because these keys return Esc codes too.
Esc[A = Up
Esc[B = Down
Esc[C = Right
Esc[D = Left
Here is my altered Inkey() help
Code: Select all
If OpenConsole()
PrintN("Press Escape to exit")
Repeat
KeyPressed$ = Inkey()
If KeyPressed$ <> ""
PrintN("You pressed: " + KeyPressed$)
PrintN("It has a raw code of: "+Str(RawKey()))
If RawKey() = 27
k.s = Inkey()
If RawKey() <> 0 ; Special key
KeyPressed$ = Inkey()
Select KeyPressed$
Case "A"
PrintN("You Pressed UP")
Case "B"
PrintN("You Pressed DOWN")
Case "C"
PrintN("You Pressed RIGHT")
Case "D"
PrintN("You Pressed LEFT")
EndSelect
EndIf
EndIf
ElseIf RawKey()
PrintN("You pressed a non ASCII key.")
PrintN("It has a raw code of: "+Str(RawKey()))
Else
Delay(20) ; Don't eat all the CPU time, we're on a multitask OS
EndIf
Until KeyPressed$ = Chr(27) ; Wait until escape is pressed
EndIf
Re: 'graphical' console in Linux, maybe MAC too
@GBeebe: When I run your code sample and press the arrow keys it displays "You pressed a non ASCII key" and the raw codes 38 -> 40.GBeebe wrote:While we're on the subject, I also figured out how to capture arrow keys.
The Inkey() example, in the help, quits when an arrow key is pressed, it's because these keys return Esc codes too.
Esc[A = Up
Esc[B = Down
Esc[C = Right
Esc[D = Left
I'm running Win XP SP3 32-bit.
Re: 'graphical' console in Linux, maybe MAC too
The title says:Demivec wrote:@GBeebe: When I run your code sample and press the arrow keys it displays "You pressed a non ASCII key" and the raw codes 38 -> 40.GBeebe wrote:While we're on the subject, I also figured out how to capture arrow keys.
The Inkey() example, in the help, quits when an arrow key is pressed, it's because these keys return Esc codes too.
Esc[A = Up
Esc[B = Down
Esc[C = Right
Esc[D = Left
I'm running Win XP SP3 32-bit.
You are running:'graphical' console in Linux, maybe MAC too
Demivec wrote:I'm running Win XP SP3 32-bit.

Re: 'graphical' console in Linux, maybe MAC too
My appologies, I did check the forum (and it wasn't Linux but Tricks n' Tips) but neglected to check the thread title itself.fsw wrote:The title says:You are running:'graphical' console in Linux, maybe MAC tooDemivec wrote:I'm running Win XP SP3 32-bit.
I think one of my light bulbs burned out.

