473,378 Members | 1,456 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

How do I recognize space characters in keyboard input?


I would like to recognize whitespace or nonascii characters in keyboard input. Is there an easy way to do this test? I
could do

e.KeyChar < '!' || e.KeyChar > '~'

but this seems to make the assumption that the user is inputting ascii characters - but maybe they are using some other
character set.

Can I use \s or is this for regular expression use only.
sorry it is such a basic question.

Thanks,

Steve

Nov 17 '05 #1
4 2062
Hi,

Have you tried the static Char.IsXXX set of functions (Char.IsWhitespace ,
Char.IsLetter, etc.) They take a char as input and handle Unicode as well.

They may provide the functionality you are looking for.

\s only works as part of regular expressions.

Best regards,

Rodger

Time Management Guide - Make better use of your time
<http://www.TimeThoughts.com/timemanagement.htm>
steve bull wrote:
I would like to recognize whitespace or nonascii characters in keyboard input. Is there an easy way to do this test? I
could do

e.KeyChar < '!' || e.KeyChar > '~'

but this seems to make the assumption that the user is inputting ascii characters - but maybe they are using some other
character set.

Can I use \s or is this for regular expression use only.
sorry it is such a basic question.

Thanks,

Steve

Nov 17 '05 #2
Hi,

Have you tried the static Char.IsXXX set of functions (Char.IsWhitespace ,
Char.IsLetter, etc.) They take a char as input and handle Unicode as well.

They may provide the functionality you are looking for.

\s only works as part of regular expressions.

Best regards,

Rodger

Time Management Guide - Make better use of your time
<http://www.TimeThoughts.com/timemanagement.htm>
steve bull wrote:
I would like to recognize whitespace or nonascii characters in keyboard input. Is there an easy way to do this test? I
could do

e.KeyChar < '!' || e.KeyChar > '~'

but this seems to make the assumption that the user is inputting ascii characters - but maybe they are using some other
character set.

Can I use \s or is this for regular expression use only.
sorry it is such a basic question.

Thanks,

Steve

Nov 17 '05 #3

thanks, I knew it had to be something simple.

Steve
On Tue, 21 Jun 2005 05:09:09 GMT, Rodger Constandse <ro*************@effexis.com> wrote:
Hi,

Have you tried the static Char.IsXXX set of functions (Char.IsWhitespace ,
Char.IsLetter, etc.) They take a char as input and handle Unicode as well.

They may provide the functionality you are looking for.

\s only works as part of regular expressions.

Best regards,

Rodger

Time Management Guide - Make better use of your time
<http://www.TimeThoughts.com/timemanagement.htm>
steve bull wrote:
I would like to recognize whitespace or nonascii characters in keyboard input. Is there an easy way to do this test? I
could do

e.KeyChar < '!' || e.KeyChar > '~'

but this seems to make the assumption that the user is inputting ascii characters - but maybe they are using some other
character set.

Can I use \s or is this for regular expression use only.
sorry it is such a basic question.

Thanks,

Steve


Nov 17 '05 #4

thanks, I knew it had to be something simple.

Steve
On Tue, 21 Jun 2005 05:09:09 GMT, Rodger Constandse <ro*************@effexis.com> wrote:
Hi,

Have you tried the static Char.IsXXX set of functions (Char.IsWhitespace ,
Char.IsLetter, etc.) They take a char as input and handle Unicode as well.

They may provide the functionality you are looking for.

\s only works as part of regular expressions.

Best regards,

Rodger

Time Management Guide - Make better use of your time
<http://www.TimeThoughts.com/timemanagement.htm>
steve bull wrote:
I would like to recognize whitespace or nonascii characters in keyboard input. Is there an easy way to do this test? I
could do

e.KeyChar < '!' || e.KeyChar > '~'

but this seems to make the assumption that the user is inputting ascii characters - but maybe they are using some other
character set.

Can I use \s or is this for regular expression use only.
sorry it is such a basic question.

Thanks,

Steve


Nov 17 '05 #5

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

Similar topics

13
by: Xah Lee | last post by:
the Journey of Foreign Characters thru Internet Xah Lee, 20051101 There's a bunch of confusions about the display of non-ascii characters such as the bullet "•". These confusions are...
11
by: santosh | last post by:
Hi, A book that I'm currently using notes that the fgets() function does not return until Return is pressed or an EOF or other error is encountered. It then at most (in the absence of...
4
by: Broeisi | last post by:
Hello, I'm trying to write a console based program in C in Linux. I want to use the function keys in my program, but I don;t know how to let the C program know when for exmaple the F1 key is...
11
by: Ron L | last post by:
I have a barcode scanner which uses a "keyboard wedge" program so that the data it scans comes through as if it was typed on a keyboard. I am trying to have the data in the barcode be displayed in...
19
by: many_years_after | last post by:
Hi,everyone: Have you any ideas? Say whatever you know about this. thanks.
7
by: TC | last post by:
Hi, I have developed a font, which has ~30 new characters in the Unicode Private Area (starting from U+E000). Now, since these characters are not present in the standard keyboard, can you...
8
by: BD | last post by:
How can I duplicate the behavior of the operating system shortcut keys in my application? For example, my windows form has 5 controls (textboxes), the operating system will pickup which control...
11
by: Mike Harrison | last post by:
Hi, I have some simple HTML like this: <div id="container" style="width:100%;"> <input type="text" <input type="button" style="float:right;" value="Click here..."> </div> I want the button...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

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.