Hi John, 
I use the following method to get the unicode value from some 4D constants: 

+++++
  //UI_KeyboardGetChar (keyCode_l) -> code
  //$0 code representing the keyCode_l
  //keyCode_l: 4D constant
  //example: Char(UI_KeyboardCharCode (Tab key)) -> "⇥"
  //http://fr.wikipedia.org/wiki/Table_des_caractères_Unicode_(2000-2FFF)

C_LONGINT($0)
C_LONGINT($1)

C_LONGINT($in_l)
C_LONGINT($out_l)

If (False)
        C_LONGINT(UI_KeyboardGetChar ;$0)
        C_LONGINT(UI_KeyboardGetChar ;$1)
End if 
  //_
If (Count parameters<1)
        $out_l:=Character code("¿")
Else 
        $in_l:=$1
          //$char:=Caractère(UI_KeyboardGetChar (Tabulation))
        Case of 
                : ($in_l=Help key)
                        $out_l:=Character code("?")
                : ($in_l=Escape key)
                        $out_l:=0x238B
                          //$out_l:=0x241B  //esc in letters
                : ($in_l=127)  //erase to the right
                        $out_l:=0x2326
                : ($in_l=Backspace key)  //erase to the left
                        $out_l:=0x232B
                : ($in_l=Return key)
                        $out_l:=0x21A9
                          //$out_l:=0x23CE//alternate
                : ($in_l=Enter key)
                        $out_l:=0x2305
                : ($in_l=Tab key)
                        $out_l:=0x21E5
                : ($in_l=Left arrow key)
                        $out_l:=0x2190
                : ($in_l=Up arrow key)
                        $out_l:=0x2191
                : ($in_l=Right arrow key)
                        $out_l:=0x2192
                : ($in_l=Down arrow key)
                        $out_l:=0x2193
                : ($in_l=Home key)
                        $out_l:=0x2196
                : ($in_l=End key)
                        $out_l:=0x2198
                : ($in_l=Page up key)
                        $out_l:=0x21DE
                : ($in_l=Page down key)
                        $out_l:=0x21DF
                Else 
                        $out_l:=Character code("¿")  //unknown
                          //$out_l:=0x2328
        End case 
End if 

$0:=$out_l
  //_

+++++

I use it this way:
$buttonTitle:=:="Validate "+Char(UI_KeyboardGetChar (Enter key))
OBJECT SET TITLE(*;"buttonName";$buttonTitle)

-- 
Arnaud de Montard 



**********************************************************************
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**********************************************************************

Reply via email to