flat assembler
Message board for the users of flat assembler.

Index > Windows > CONIO in FASM

Author
Thread Post new topic Reply to topic
NanoBytes



Joined: 02 Jun 2011
Posts: 57
Location: Iowa, United States
NanoBytes 15 Dec 2011, 05:38
Hey, in the C++ standard library there is a file called CONIO.h, this file has a function that I am trying to implement in FASM. getch(), this function will read in the character the user presses it the second they press it, so they dont need to push enter to get that character. Is this possible in FASM?

_________________
He is no fool who gives what he cannot
keep to gain what he cannot loose.
Post 15 Dec 2011, 05:38
View user's profile Send private message Send e-mail Visit poster's website Reply with quote
DOS386



Joined: 08 Dec 2006
Posts: 1903
DOS386 15 Dec 2011, 05:42
> read in the character the user presses
> Is this possible in FASM?

NO : http://board.flatassembler.net/topic.php?t=11172 Shocked
Post 15 Dec 2011, 05:42
View user's profile Send private message Reply with quote
NanoBytes



Joined: 02 Jun 2011
Posts: 57
Location: Iowa, United States
NanoBytes 15 Dec 2011, 12:51
In the chapter? what chapter?
And, adr you saying that it is not possible?
Post 15 Dec 2011, 12:51
View user's profile Send private message Send e-mail Visit poster's website Reply with quote
JohnFound



Joined: 16 Jun 2003
Posts: 3499
Location: Bulgaria
JohnFound 15 Dec 2011, 13:32
Of course it is possible.
Read the help for: SetConsoleMode and ReadConsole API functions.
Also, you can read console input with ReadFile if you provide handle of the console, but there are some oddities that you have to check in the API reference.
Post 15 Dec 2011, 13:32
View user's profile Send private message Visit poster's website ICQ Number Reply with quote
Picnic



Joined: 05 May 2007
Posts: 1398
Location: Piraeus, Greece
Picnic 03 Mar 2013, 19:59
I made a simple BASIC like INKEY$ routine for the Windows console.
It can process normal ASCII keys, enhanced keys, function keys, and control state keys.

Link


Last edited by Picnic on 08 Apr 2015, 15:02; edited 4 times in total
Post 03 Mar 2013, 19:59
View user's profile Send private message Visit poster's website Reply with quote
bitRAKE



Joined: 21 Jul 2003
Posts: 4060
Location: vpcmpistri
bitRAKE 04 Mar 2013, 07:42
Nice example Picnic.
Code:
struct __uCharUnion
  UnicodeChar db ?
  AsciiChar dw ?
ends    
Seems to be a small bug?

http://msdn.microsoft.com/en-us/library/windows/desktop/ms684166%28v=vs.85%29.aspx

_________________
¯\(°_o)/¯ “languages are not safe - uses can be” Bjarne Stroustrup
Post 04 Mar 2013, 07:42
View user's profile Send private message Visit poster's website Reply with quote
Picnic



Joined: 05 May 2007
Posts: 1398
Location: Piraeus, Greece
Picnic 04 Mar 2013, 22:22
Ιndeed there was a mistake, i fixed it.
Good to see you bitRAKE.
Post 04 Mar 2013, 22:22
View user's profile Send private message Visit poster's website Reply with quote
CandyMan



Joined: 04 Sep 2009
Posts: 414
Location: film "CandyMan" directed through Bernard Rose OR Candy Shop
CandyMan 05 Mar 2013, 20:24
When i pressed only right alt, message was displayed than left ctrl is pressed.
Post 05 Mar 2013, 20:24
View user's profile Send private message Reply with quote
Picnic



Joined: 05 May 2007
Posts: 1398
Location: Piraeus, Greece
Picnic 06 Mar 2013, 07:31
Thanks for the response CandyMan, i have no clue right now, it seems to work ok in all my pc but i will test it more.
Post 06 Mar 2013, 07:31
View user's profile Send private message Visit poster's website Reply with quote
Picnic



Joined: 05 May 2007
Posts: 1398
Location: Piraeus, Greece
Picnic 25 Mar 2013, 14:21
I saw the bug you mention CandyMan, i think it's related to the AltGr key which behaves differently depending on the keyboard, and needs more special handling.
Post 25 Mar 2013, 14:21
View user's profile Send private message Visit poster's website Reply with quote
DOS386



Joined: 08 Dec 2006
Posts: 1903
DOS386 27 Mar 2013, 12:49
Picnic wrote:
I made a simple BASIC like INKEY$ routine for the Windows console.


Yeah seems to work too. http://board.flatassembler.net/download.php?id=5538
Post 27 Mar 2013, 12:49
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.