473,699 Members | 2,147 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Console Programs

Hi,

I was just wondering what classes/methods are used to clear the screen
of the console. Also, how can you take input from the keyboard so that the
enter key need not be used. ( e.g. the arrows for a snake-race game )

Thanks,

Patrick Brown
Jul 17 '05 #1
2 4186
There is no general Java way to do fancy screen control, because Java was
not intended for this kind of purpose. You may be able to send ANSI escape
sequences, but not all operating systems understand them.

You should be able to read one character at a time from System.in. The one
thing to watch out for is that System.in may be buffered.

Of course, if your operating system already processes data on a
line-by-line basis rather than character-by-character (both Windows and
Unix do by default), then you might have to turn that off first.

On Fri, 01 Aug 2003 17:26:02 +0000, Patrick Brown wrote:
I was just wondering what classes/methods are used to clear the
screen
of the console. Also, how can you take input from the keyboard so that
the enter key need not be used. ( e.g. the arrows for a snake-race game
)


--
Keep American Families united! Support H.R. 539 and H.R. 832
For more information, see http://www.kkeane.com/lobbyspousal-faq.shtml

Jul 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
2998
by: Will Stuyvesant | last post by:
I never used the popen or popen2 libraries but it is my understanding that they can capture the output of console based programs. Is it also possible to send keystrokes to console base programs? I would like to program a Python program that can play for instance the tty version of nethack 3.4.3 on Windows, simulating a human player: for nethack it would not be possible to know if a human or a computer program is playing it. It is a...
0
2067
by: Edward | last post by:
Hello, I just finished taking a basic C++ class in High School eariler this year. For the most part we worked with DOS programs in the Win32 console application in Visual C++ 6.0. I've done a great deal of programming with it and I now want to move into more advanced features such as a graphics and perhaps a little midi music to spice up some programs. I'm curius if its possible to add such things to a console application or if there is...
2
2115
by: glean | last post by:
My console in WinXP is using Lucida Console for the font. My problem is, I can go to character map and select a string of special characters such as the following: ®¾Öþ¬«§¯ I can paste them into my console by right-clicking the title, then edit, paste, and everything is fine. When I try to display them on the console programmatically by using Console.WriteLine("®¾Öþ¬«§¯"); , the console actually displays it as r_Ö_¬«§_
5
11239
by: Barry Mossman | last post by:
Hi, can I detect whether my class is running within the context of a Console application, vs say a WinForm's application ? also does anyone know whether the compiler or runtime is smart enough to avoid the overhead of writing to the console if it is not visible, eg I am running inside a WinForm application. thanks
2
1629
by: _R | last post by:
I've got a few apps that were designed to be used via MSDOS window. They make use of the old-style VC++6 Console class for doing writes, cursor repositioning, scrolling, etc. (Unfortunate name clash with the new .NET console class, so it's tough to search for info). Has anyone written a C# or C++ wrapper for the old Console class or something that can be used under .net?
8
5847
by: Terry Olsen | last post by:
Can console programs do events? Or are they strictly linear programs?
4
4703
by: eglaser | last post by:
Hello, I have a script that launches a sequence of other programs, some GUI, some console. I'd like the console programs to launch in their own console window, instead of all of them sharing the script's console. How do I do that? I'm on Windows, and currently I'm using os.spawnl(...) to launch the programs.
5
10769
by: =?Utf-8?B?SmFtZXMgV29uZw==?= | last post by:
Dear all, I'd like to know if there is any method to minimize command mode window when a console program is running. In my case, there are several console programs which run periodically in server. Now, every console program instance will open a command mode window and they occupy the whole screen. I want to minimize all of them and maximize it if neccessary by manual. Is it possible and how to do it? I'm using VB.NET 2005. ...
27
2960
by: CarlosMB | last post by:
Hello, I am writing code that uses a DLL which is supposed to print to console some useful information but for some reason it is not doing so. The environment is a bit complex to explain but here it goes: - I am using a C library called SYMPHONY, which I compiled myself. When using that
5
3020
by: jacob navia | last post by:
One of the many questions asked by people is that even if they write into standard output, the output doesn't show in the screen. This happens in windows systems since quite a long time. To avoid this, you should open a console before outputting anything into standard output. You do this with void AllocConsole(void); When you do not want to use the console any more (and you do not
0
8705
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9199
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9054
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8943
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7785
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4391
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4637
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3075
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2016
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.