home *** CD-ROM | disk | FTP | other *** search
- ; Sample code to define your own "dead" keys. This example
- ; uses ctrl+' as the dead key, which is not a definable
- ; key, so I added it as an accelerator key.
- ; If you used a different key (defined in MYKEYS.E or MYSTUFF.E), you
- ; might not have to define it as an accelerator.
- ; Larry Margolis
-
- include 'stdconst.e'
-
- definit
- universal activeaccel
- buildacceltable activeaccel, 'accelkeys', AF_CHAR+AF_CONTROL, 39, 1102 -- c+'
- activateacceltable activeaccel
-
- defc accelkeys
- universal ACCEL_STARTING_KEYSET
- if .keyset = 'ACCEL_KEYS' then
- call end_accelkeys()
- return
- endif
- ACCEL_starting_keyset = upcase(.keyset)
- keys accel_keys
- sayerror 'Press key to be accented.'
-
- defproc end_accelkeys
- universal ACCEL_STARTING_KEYSET
- .keyset = ACCEL_STARTING_KEYSET
- sayerror 0
-
- defkeys accel_keys new clear
-
- def 'a' = keyin 'É'; call end_accelkeys()
-
- def 'A' = keyin '▌'; call end_accelkeys()
-
- def 'e' = keyin '⌐'; call end_accelkeys()
-
- def 'E' = keyin 'ê'; call end_accelkeys()
-
- def 'n' = keyin 'ï'; call end_accelkeys()
-
- def 'N' = keyin '¼'; call end_accelkeys()
-
- def otherkeys =
- k = lastkey()
- if k=\10\18 | k=\09\10 | k=\11\34 | k=\0 then -- Ctrl, Shift, Alt, or null:
- return -- ignore
- endif
- call end_accelkeys()
- compile if 1 -- Optionally execute the key that ended the accel_keys keyset.
- executekey k
- compile endif
-
-