• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1368
  • Last Modified:

ASCII dec number for CTRL key

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
submissiontechnology
Asked:
submissiontechnology
1 Solution
 
glcumminsCommented:
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
 
submissiontechnologyAuthor Commented:
I see. How can I send it to the process then?
0
 
hernst42Commented:
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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
submissiontechnologyAuthor Commented:
I actually need to send CTRL-A followed by D (to detach screen)
0
 
hernst42Commented:
why not start screen directly in detached mode via
screen -m -d cmd to execute
0
 
Steve BinkCommented:
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
 
submissiontechnologyAuthor Commented:
Thanks routinet chr(1) did the trick.
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now