Solved

ASCII dec number for CTRL key

Posted on 2007-04-11
7
1,330 Views
Last Modified: 2008-02-01
Can anyone tell me what is the ASCII decimal number for the control key? Or how to simulate it when sending a command to a process created with proc_open? Thanks.
0
Comment
Question by:submissiontechnology
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
7 Comments
 
LVL 24

Expert Comment

by:glcummins
ID: 18890843
Control is a modifier key, so I don't believe it has it's own number. Only when combined with another key does it gain an identifier.
0
 

Author Comment

by:submissiontechnology
ID: 18890878
I see. How can I send it to the process then?
0
 
LVL 48

Expert Comment

by:hernst42
ID: 18890898
If you want to send signals to the open process use proc_terminate http://www.php.net/manual/en/function.proc-terminate.php
CRTL-C is typical converted to SIG-TERM when used from the shell so sendig it's ascii code will not be enough.
0
Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

 

Author Comment

by:submissiontechnology
ID: 18890926
I actually need to send CTRL-A followed by D (to detach screen)
0
 
LVL 48

Expert Comment

by:hernst42
ID: 18891251
why not start screen directly in detached mode via
screen -m -d cmd to execute
0
 
LVL 50

Accepted Solution

by:
Steve Bink earned 500 total points
ID: 18892193
Historically speaking, control code characters are the first 26 ascii characters.  In other words, Ctrl-A is 1, Ctrl-B is 2, Ctrl-M is 13, Ctrl-Z is 26, and so on.  This has been standardized for some time, so you may just be able to add the ascii code directly into the command string.

I also know that *ix allows for control codes to be entered directly on the command line by pressing ctrl-v first.  So to enter a Ctrl-C, you would actually type Ctrl-V,Ctrl-C.
0
 

Author Comment

by:submissiontechnology
ID: 18896456
Thanks routinet chr(1) did the trick.
0

Featured Post

Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

These days socially coordinated efforts have turned into a critical requirement for enterprises.
Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

696 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question