Mat Posted September 12, 2014 Share Posted September 12, 2014 can someone tell me, how can I change Cin to input a password? Normally the way to do it is to change the console mode to not print characters sent to cin. I can't remember the exact settings required, but if you use my (still unreleased) console.au3 and _Console_SetMode, I seem to remember it being that you needed to unset $ENABLE_ECHO_INPUT. There is an example of removing flags from the mode if you look at the code for _Console_Pause. The main issue, that I haven't been able to work around yet, is that programs using the above console.au3 won't work when run from SciTE. That limitation is pretty much the reason I haven't released it properly yet. AutoIt Project Listing Link to comment Share on other sites More sharing options...
de1m Posted September 12, 2014 Share Posted September 12, 2014 thanks for info. I set this _Console_SetMode(-1, BitNOT($ENABLE_ECHO_INPUT)) and its work. Thank you! Link to comment Share on other sites More sharing options...
MrKris1224 Posted October 7, 2014 Share Posted October 7, 2014 Why my code don't work?? if I click any key program returns "False" Why?? #include <Console.au3> While 1 ConsoleWrite(Getch()) WEnd Link to comment Share on other sites More sharing options...
RepublicCommando Posted August 2, 2016 Share Posted August 2, 2016 (edited) Found this just yesterday, I've already implemented it into a project (Server of another app). I do have a problem though. Cin() blocks until something is sent to the console (Enter pressed). I am trying to use THIS AutoIt thread implementation to do the console stuff in a separate thread, and potentially separate client TCP stuff into threads as well, but it would be SO much easier just to allow Cin to return 0 if enter isn't pressed. I have Cin in a loop where I'm doing a lot of other networking stuff, but you can't do that if Cin is blocking everything until a command is entered.. Edited August 2, 2016 by RepublicCommando Forgot to link 'THIS' in text Link to comment Share on other sites More sharing options...
Biatu Posted August 14, 2016 Share Posted August 14, 2016 (edited) On 8/1/2016 at 10:04 PM, RepublicCommando said: Found this just yesterday, I've already implemented it into a project (Server of another app). I do have a problem though. Cin() blocks until something is sent to the console (Enter pressed). I am trying to use THIS AutoIt thread implementation to do the console stuff in a separate thread, and potentially separate client TCP stuff into threads as well, but it would be SO much easier just to allow Cin to return 0 if enter isn't pressed. I have Cin in a loop where I'm doing a lot of other networking stuff, but you can't do that if Cin is blocking everything until a command is entered.. Have you tried setting the Cin size parameter to 1? or getch()? I have used this for advanced CUI stuff before as well. Edited August 14, 2016 by Biatu What is what? What is what. Link to comment Share on other sites More sharing options...
Gabriel12345 Posted October 21, 2016 Share Posted October 21, 2016 Is there a way to get this working when compiled as CUI? It works great when compiled as GUI, but as CUI "cin" won't block, and instead seems to be seeing a constant stream of carriage returns. Thanks! Link to comment Share on other sites More sharing options...
MattHiggs Posted October 21, 2016 Share Posted October 21, 2016 3 hours ago, Gabriel12345 said: Is there a way to get this working when compiled as CUI? It works great when compiled as GUI, but as CUI "cin" won't block, and instead seems to be seeing a constant stream of carriage returns. Thanks! Yeah, I had this issue too when writing one of my scripts. My question is.....is there a particular reason the script has to be compiled as a CUI? The UDF seems to be an alternative to compiling the script as a CUI, so I just left my script to run as a GUI, and then called "Cout" at the very beginning, and it accomplishes pretty much the same thing. Link to comment Share on other sites More sharing options...
kristo Posted February 14, 2017 Share Posted February 14, 2017 I'm currently having problem with the codepage settings. I need german umlauts in the console, but this does not seem to work and all I get are other strange symbols. Could you help me here? Cheap, Fast, Good - Choose any two Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now