?
Solved

ASCII dec number for CTRL key

Posted on 2007-04-11
7
Medium Priority
?
1,342 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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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 51

Accepted Solution

by:
Steve Bink earned 2000 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

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.

Question has a verified solution.

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

Popularity Can Be Measured Sometimes we deal with questions of popularity, and we need a way to collect opinions from our clients.  This article shows a simple teaching example of how we might elect a favorite color by letting our clients vote for …
Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to dynamically set the form action using jQuery.
Suggested Courses

762 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