LibCon - AutoHotkey Library For Console Support
The main goal of this library is to maintain simplicity, so that the common AutoHotkey user may use it and integrate it easily.
I know that this is probably considered far from complete, but just to get things started, here it is!
See the Documentation here. See some Examples here.
LibCon is proudly under the MIT License.
Contact Me for Requests, Comments, Contributions, etc.
Get it from GitHub Here or Direct Download
LibCon - AutoHotkey Library For Console Support
I was just messing around with console apps... Here's a service i was messing around with you can improve my poor programming to get specific chars pressed:
http://gwarble.com/ahk/Console/Service
(clearly my logic needs to be put into a nice loop)
(the service only tested working on xp, but the command line stuff works on 7-64)
This seems amazing! ima have a play with it thanks! ill get back on what i think of it after some use
Edit: Just found my progress bar code in here! glad it's being put to good use
Hire me to write your code! (join IRC or PM me for details)
@gwarble I'm working a function that will help you greatly, almost done (i know the problem is ReadConsoleInput)
@Bugz000 I'm glad! I will be adding the credits soon, im working on the documentation, should be done soon!
EDIT: NEW UPDATE! - Library version is set to: 1.0.1.0
added function get​ch()
see example for usage...
Also i'm working on some minor bug fixes, cheers!
EDIT: @gwarble have you tried casting the type return?
key := NumGet(INPUT_RECORD, 8, "UShort")
-----------
@gwarble You sure its working fine? it crashes if i press I,R, anyone that is listed, otherwises it doesnt crash.... but equals to
exit of the program: "press any other key"... So you are sure that you dont want to use getch() ??? because i made this especially for this and main console use, since
it doesnt trigger on mouse move or mouse click or whatever, only if the Keyboard has gotten input. And the code is perfectly
safe and works exactly like how it should be, in a console. Also, i have your function for 'ReadConsoleInput' in LibCon.ahk but its got some weird bug like said.. i think i can fix it, i believe i know what the problem is... will do that soon
cheers
EDIT: try the example script, it has a getch example usage
I didnt mean the "pause function (that was the first step) but in the main loop (after the conditional cases at the beginning) where that ugly goto is, its using ReadConsoleInput in a loop to check for KeyDown and that there is a real key char received...
I thought you meant you had problems with getch(), not that you had added it in the last update
Edit: scrolled through the getch code, nice handling of non char keys and stuff
I'd add a CLS type function next, fill the buffer and put cursor at the top
I'll double check but i thought i left it in a working stateEDIT: @gwarble have you tried casting the type return?
key := NumGet(INPUT_RECORD, 8, "UShort")-----------
@gwarble You sure its working fine?
I feel dumb but i dont know what casting the type return means
Edit: i'd call that line "extracting the key byte from the input_record structure" in my layman terms... Is that what you mean? If so yeah its in there except i picked the vkey instead... again just me experimenting...
So did you run into problems with ReadConsoleInput in C also?
@gwarble Oh no problemo! just added a simple ClearScreen() ( cls() or Clear() )
i have checked some of your code, seems fine, but im Unable to compile it. I have found
that you are using 'ServiceTest.AHK.bin' to compile it? have not tried it yet, i cant test anything
if i cant compile it....
i see this 'chr(key)' it seems to work fine, but what is the problem? you want to check if it's a Char and not some special input like the mouse?
if so, i suggest checking if the values are between [48 to 57] + [97 to 122] like in this ASCII Table:
(since everything else requires a modifier key which triggers the function)
regards
Thanks for this lib, joedf . Very cool.
Will you consider wrapping a class over it, just to disable those global variables (sType, Black, Yellow) . You can distribute it as an alternative version via Github.
Now a CS Undergrad. | My Website | Autohotkey Scripts | Softwares
Telegram me : @aviaryan
Anyway, i updated the link above to the folder so you can grab the other files
@Avi maybe in the future, but it seems unnecessary at the moment
@gwarble i missed your message, but ive added the stuff already, so it's all good see my devlog below
News! Added new stuff, unreleased yet, still adding stuff, testing stability and Documenting...
Here is my DevLog:
cheers!
pause(show=1) { show ? puts("Press any key to continue . . .") : "" _getch() }hmmm... Maybe you have thought about this, and you choose to have local language.
Edited by tmplinshi, 05 September 2013 - 08:16 AM.