473,655 Members | 3,057 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

reading keyboard and interaction with os

Hello php gurus,

maybe it sounds crazy, but I'd would like to use php for some system
administration, backups, etc, but sometimes user interaction is needed.
Till now i have been using windows script host, but more and more I need
communication with intranet servers, which works fine with libcurl. Now
I'm executing curl.exe for every intranet request I need, and it's too slow.

My question is, if I can read keyboard using php. I know i can execute
external program like choice.com (to ask for answer no/yes etc), but
this is the thing i'd like to avoid... I know there's ton of other
languges which could do that better, jike java or c++, but php is the
only I know a bit.

Thank you for any ideas,
Y.
Nov 22 '05 #1
2 5305
NC
Yandos wrote:

My question is, if I can read keyboard using php.


If you are running a command-line interpreter, yes; you can read
keyboard input from standard input stream (STDIN):

$response = trim(fgets(STDI N));

Cheers,
NC

Nov 22 '05 #2
"NC" <nc@iname.com > wrote in news:1132335121 .905963.215850
@f14g2000cwb.go oglegroups.com:
Yandos wrote:

My question is, if I can read keyboard using php.


If you are running a command-line interpreter, yes; you can read
keyboard input from standard input stream (STDIN):

$response = trim(fgets(STDI N));

Cheers,
NC


That's great, thank you :)

Y.
Nov 22 '05 #3

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

Similar topics

3
31347
by: Simon | last post by:
Using qbasic, the following accepts input from com1, and prints its output : OPEN "com1:9600,n,8,1,CD0,CS0,DS0,RS" FOR INPUT AS #1 WHILE INKEY$ <> " " INPUT #1, a$ PRINT a$ WEND What would the same set of commands look like in VB. I am reading the
2
16396
by: Michael Bendzick | last post by:
Is there a simple way in python to read a keyboard scan code? I'm working on a shell script that interfaces with a proprietary keyboard device (extra buttons) and need to be able to distinguish between those keys. Thank you
50
4928
by: Michael Mair | last post by:
Cheerio, I would appreciate opinions on the following: Given the task to read a _complete_ text file into a string: What is the "best" way to do it? Handling the buffer is not the problem -- the character input is a different matter, at least if I want to remain within the bounds of the standard library.
0
6669
by: rs | last post by:
Hi guys, I am trying to read from a USB keyboard using vb.net and HID classes. the USB keyboard is not my primary keyboard. I have a ps2 keyboard connected and is detected in device manager as my keyboard. the USB keyboard is detected as HID keyboard device. the program finds the keyboard if it is attached. and I am getting valid handles. however, everytime I use the readfile function I am getting "object reference not set to an instant...
2
8755
by: rs | last post by:
Hi guys, I am trying to read from a USB keyboard using vb.net and HID classes. the USB keyboard is not my primary keyboard. I have a ps2 keyboard connected and is detected in device manager as my keyboard. the USB keyboard is detected as HID keyboard device. the program finds the keyboard if it is attached. and I am getting valid handles. however, everytime I use the readfile function I am getting "object reference not set to an instant...
0
4386
by: Chris Herring | last post by:
I am writing a WinForms app that will integrate a handheld voting device system into the app. The handhelds communicate to the PC via a USB connection. The USB device has no manufacturer driver, it simply uses the built in MS HID srv driver. It sends the results as keyboard commands. I have 2 ways to catch this data as I see it: 1) I can read the keyboard commands as they come in. In order to make sure that I get the commands even when my...
2
2137
by: Charlie Brown | last post by:
I can open an application such as Notepad and use SendKeys to send input to the Notepad. What I would like to do is reference an already running application and then send keyboard input to it. Any thoughts? Can this be done with sendkeys or is there another method.
1
1252
by: eBob.com | last post by:
Is there a .Net api or System api to determine when the user last used the mouse or keyboard? I mean system wide, not just the last keyboard or mouse interaction with my app. I'm aware of SetWindowsHookEx but have never used it, and given my VB.Net skills it would be a major (but interesting) undertaking to use it from within a VB.Net application. Thanks, Bob
4
3411
by: John Ladasky | last post by:
Hi there. The following minimal code in Python 2.3.4 works under Idle v. 1.0.3, but not under SciTE v. 1.66: from time import sleep try: while True: sleep(0.25) print ".",
0
8296
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
8497
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
7310
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
5627
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4150
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
4299
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2721
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
2
1928
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1598
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.