|
Re: Note for Roger and Skywise - October 29, 2013 |
Well, I'm not going to force you to use XB, but I will address your comments.
Because it's stable? As I've said, the linux side is still being unofficially developed to keep up with changes in linux. Yeah, it'd be nice to have certain updates.
Because it's stable? The only reason I'm considering a rewrite of the documentation is to provide a different format some may find easier to use. And to add more example code to help explain the concepts better.
So?
So?
Oh yes it can. Or I'm hallucinating my programs.
Sounds like you were looking at INLINE$, which is used in the console window. That's just ONE way of many ways of getting keyboard input. The method used depends on the application. As I said, there is in INKEY$. The reason for that is simple - XBasic is not a dumbed down simple BASIC for beginners. It's not even truly a BASIC language, despite appearances.
That's a different problem, which requires a different programming method to solve. I've taken a little time to browse through the Windows API functions for keyboard access, and there are functions for "synthesizing keystroke, mouse motions, and mouse clicks". ANY language that can access the Windows API can therefore do this. XBasic can access the API, therefore XBasic can do this.
Yet a different problem requiring yet a different programming method. I do not have a hard answer on this one. But, I do know that XB programs can take command line input from dos calls, so from that I'd be surprised if it can't be done.
As I mentioned, I took a little time to browse the Windows API for keyboard related functions. I found the function for reading the keyboard regardless of program focus. Took only a couple lines of code for me to effectively write a keyboard logger program. And as mentioned above, there is a SendInput() function as well for sending keystrokes. These things are NOT a function of the programming language. They are a function of the operating system. Some languages may have a convenient command already built in, but ANY language that can interface with the OS API can do anything the OS will allow.
Why would you need faster anyway? As it happens, I just checked the speed of my key logger. The main loop runs in less than a millisecond, so that's 1000 times a second. Actually, it was more like 250,000 times a second, but that's a technical detail. But, this just 'hogs the cpu' to do it. Not efficient, and nobody types that fast. So of course, you only poll the keyboard every now and then. (btw, when I added a 10 millisecond sleep command to the loop, CPU usage dropped to less than 1%, ie it showed in task manager as 0%) And how the program reacts is just a matter of programming. All I did was output the keystrokes to the 'console' window, but they could have just as easily been saved to a data file, or output to a server over the internet. Yes, XB has a network library.
Been there. Done that. There is a program I wrote many years ago that I released on my website. It's for browsing through laser emission lines on an interactive scrollable and zoomable spectrum display. If you want to download it and play with it to see an example of what XBasic can do.... http://www.skywise711.com/laserline/index.html
Although I do not know for certain, I don't know of a reason that XBasic can't work that way. But my question is, WHY would you want to do it that way? Seems a kludge. Why not make one program to do everything instead of fighting to force a bunch of different programs to talk to each other? Inefficient.
Sounds like you should just submit a specification and hire a programmer. The whole point of learning to program is so you can write code that does what you want, when you want, for free. But it requires taking the time to learn how to do what you need to do. In conclusion, it's up to you to decide if YOU want to make the EFFORT to learn it. I've been using XB for at least 15 years. I'm still learning new things. It's that powerful of a language. Every time I think I find something that it can't do, I dig a little deeper and discover, "oh yes it can!" And if it truly can't do it, the language is more than powerful enough for you to write a function that does what you need. But, that's the whole point of programming, to write a program that does what you need. THERE IS NO PROGRAMMING LANGUAGE WHICH DOES EVERYTHING AUTOMATICALLY FOR YOU. Brian Follow Ups: ● Re: Note for Roger and Skywise - October 29, 2013 - EQF 04:40:58 - 10/31/2013 (101233) (1) ● Re: Note for Roger and Skywise - October 29, 2013 - Skywise 06:25:39 - 10/31/2013 (101235) (2) ● Re: Note for Roger and Skywise - October 29, 2013 - Roger Hunter 09:14:46 - 10/31/2013 (101237) (1) ● Re: Note for Roger and Skywise - October 29, 2013 - Skywise 16:05:29 - 10/31/2013 (101239) (1) ● Re: Note for Roger and Skywise - October 29, 2013 - Roger Hunter 16:46:26 - 10/31/2013 (101241) (1) ● Re: Note for Roger and Skywise - October 29, 2013 - Skywise 17:37:50 - 10/31/2013 (101244) (1) ● Re: Brian.... - Roger Hunter 17:51:08 - 10/31/2013 (101247) (1) ● Re: Brian.... - Skywise 19:09:21 - 10/31/2013 (101249) (1) ● Re: Brian.... - Roger Hunter 23:49:08 - 10/31/2013 (101251) (0) ● Re: Note for Roger and Skywise - October 29, 2013 - EQF 07:00:44 - 10/31/2013 (101236) (1) ● Re: Note for Roger and Skywise - October 29, 2013 - Skywise 16:48:57 - 10/31/2013 (101242) (0) |
|