Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > Background process get keyboard input?

Background process get keyboard input?
Thread Tools
Junior Member
Join Date: Mar 2001
Status: Offline
Reply With Quote
Jul 19, 2001, 04:27 AM
 
I'm writing a front end application of telnet to deal with Chinese encoding.
It would be easy re-direct telnet output to a NSPipe and manipulate them to display correctly (though no color....).
However, I can't figure out how to let the NSTask I create receive the keyboard input.
I tried using another NSPipe with NSFileHandle fileHandleWithStandardInput. But it doesn't work.......
I tried a NSTextCell with action writing the NSTextCell stringValue to the NSPipe which serve as the standard input or the telnet NSTask.
But it always show text I type on the display area but never send it out~~~@.@

Could somebody shed me a light?! *_*

Thanks greatly for your help~
--
Jack Chang, R&D Supervisor
Specialized in: Embedded System, Storage System, RAID, VHDL, C/C++ Programming
     
Dedicated MacNNer
Join Date: Jan 2001
Location: Virginia, US
Status: Offline
Reply With Quote
Jul 22, 2001, 11:35 PM
 
I'm not positive I understand you, but you want to provide characters to a subprocess? In that case you don't want anything to do with your own process' standard input.

Create an NSPipe and set it as the standard input of the NSTask. After you've launched the task, you should be able use the NSPipe's fileHandleForWriting to send data to the task.
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 09:42 AM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2