Real Software Forums

The forum for Real Studio and other Real Software products.
[ REAL Software Website | Board Index ]
It is currently Sun Dec 09, 2018 9:26 pm
xojo

All times are UTC - 5 hours




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: Displaying modifier key symbols
PostPosted: Tue Sep 18, 2012 5:15 pm 
Offline

Joined: Fri Dec 09, 2011 6:27 am
Posts: 67
I want to have a popupmenu list the modifier keys (Command, Control, Shift) etc but I can't figure out how to get them to display. I've tried changing the font, including to Chicago, but they don't appear, just a blank space. For example, I thought Chr(17) was the Command key...

Any ideas? Thanks.

_________________
Xcode and Real Studio developer. Using Real Studio since RealBasic 1.0


Top
 Profile  
Reply with quote  
 Post subject: Re: Displaying modifier key symbols
PostPosted: Wed Sep 19, 2012 6:58 am 
Offline

Joined: Sun Feb 19, 2006 4:00 pm
Posts: 1282
Location: Heidelberg, Germany
You don't want the command etc key, you want the symbol for that key. So you need to find out which code point in Unicode represents the symbol you want to show.

For example to show the delete backwards symbol

dim s as string   //Real Studio uses the UTF8 encoding by default

s = Encodings.UTF8.Chr( &h232B ) //Converts the Unicode character 232B ERASE TO THE LEFT into its UTF8 counterpart

me.text = s

_________________
--

REALbasic - the best X-Platform development tool …
… if you don’t use styledText with Umlaute or accent characters.
… if you don’t need dates before 1601.
… if you only open a drawer window but never close it.


Last edited by Markus Winter on Wed Sep 19, 2012 7:37 am, edited 1 time in total.

Top
 Profile  
Reply with quote  
 Post subject: Re: Displaying modifier key symbols
PostPosted: Wed Sep 19, 2012 7:02 am 
Offline

Joined: Sun Feb 19, 2006 4:00 pm
Posts: 1282
Location: Heidelberg, Germany
Or this in the open event of a popup menu

dim s as string   //Real Studio uses the UTF8 encoding by default


s = Encodings.UTF8.Chr( &h232B ) //Converts the Unicode character 232B ERASE TO THE LEFT into its UTF8 counterpart

me.AddRow( s + " Backwards delete" )


s = Encodings.UTF8.Chr( &h23CE ) //Converts the Unicode character RETURN SYMBOL into its UTF8 counterpart

me.AddRow( s + " Return" )


s = Encodings.UTF8.Chr( &h2318) //Converts the Unicode character PLACE OF INTEREST SIGN into its UTF8 counterpart

me.AddRow( s + " COMMAND KEY SYMBOL" )



s = Encodings.UTF8.Chr( &h2325) //Converts the Unicode character OPTION KEY into its UTF8 counterpart

me.AddRow( s + " Option key" )


s = Encodings.UTF8.Chr( &h2387) //Converts the Unicode character ALTERNATIVE KEY SYMBOL into its UTF8 counterpart

me.AddRow( s + " ALTERNATIVE KEY SYMBOL" )



s = Encodings.UTF8.Chr( &h21E7) //Converts the Unicode character UPWARDS WHITE ARROW into its UTF8 counterpart

me.AddRow( s + " AS SHIFT KEY SYMBOL" )

_________________
--

REALbasic - the best X-Platform development tool …
… if you don’t use styledText with Umlaute or accent characters.
… if you don’t need dates before 1601.
… if you only open a drawer window but never close it.


Top
 Profile  
Reply with quote  
 Post subject: Re: Displaying modifier key symbols
PostPosted: Wed Sep 19, 2012 7:50 am 
Offline

Joined: Sun Feb 19, 2006 4:00 pm
Posts: 1282
Location: Heidelberg, Germany
P.S. Have a look at the TextEncoding.Chr entry in the language reference

_________________
--

REALbasic - the best X-Platform development tool …
… if you don’t use styledText with Umlaute or accent characters.
… if you don’t need dates before 1601.
… if you only open a drawer window but never close it.


Top
 Profile  
Reply with quote  
 Post subject: Re: Displaying modifier key symbols
PostPosted: Sat Sep 22, 2012 2:37 pm 
Offline

Joined: Fri Dec 09, 2011 6:27 am
Posts: 67
Thanks Markus, this really helped, great answer.

_________________
Xcode and Real Studio developer. Using Real Studio since RealBasic 1.0


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC - 5 hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group