RichEdit Emoticon Shortcuts
Seems many email messages and IMβs include emoji smiley faces like π. You just type π and you get π whether you want it or not! About a year ago, the Microsoft 365 RichEdit started offering such a facility. This post describes the built-in emoticon shortcut strings and the corresponding emoji characters and the APIs for enabling the conversions. For a substantially larger set of emoticons, see https://en.wikipedia.org/wiki/List_of_emoticons. That list includes both Western and Eastern emoticons. The RichEdit emoticon shortcuts currently include only Western emoticons.
The build-in emoticon shortcuts are defined in the table
Type | Get | Unicode |
%) |
π | U+1F615 |
0:) |
π | U+1F607 |
:'( |
π’ | U+1F622 |
:') |
π | U+1F602 |
:'-( |
π’ | U+1F622 |
:'-) |
π | U+1F602 |
:( |
βΉ | U+02639 |
:) |
βΊοΈ | U+0263A |
:+1: |
π | U+1F44D |
:-( |
βΉ | U+02639 |
:-) |
π | U+1F60A |
:-D |
π | U+1F603 |
:-o |
π² | U+1F632 |
:-p |
π | U+1F61D |
:-| |
π | U+1F610 |
:D |
π | U+1F603 |
:fire: |
π₯ | U+1F525 |
:grin: |
π | U+1F601 |
:o |
π² | U+1F632 |
:p |
π | U+1F61D |
:smile: |
π | U+1F604 |
:yum: |
π | U+1F60B |
:| |
π | U+1F610 |
;) |
π | U+1F609 |
;-) |
π | U+1F609 |
</3 |
π | U+1F494 |
<3 |
β€ | U+02764 |
>:) |
π | U+1F608 |
B-) |
π | U+1F60E |
How to enable emoticon shortcuts
The emoticon shortcut facility is incorporated into the RichEdit autocorrect facility. To enable the autocorrect facility, send the message EM_SETAUTOCORRECTPROC with wparam = an AutoCorrectProc callback pointer. If you donβt want to implement an autocorrect callback, set wparam = 1. This activates the built-in math autocorrect facility in math zones. It also activates emoticon shortcuts if theyβre enabled. To enable the emoticon shortcuts, get the current language-option flags by sending EM_GETLANGOPTIONS, OR in IMF_EMOTICONSHORTCUTS (0x8000), and send EM_SETLANGOPTIONS with lparam equal to the result. The emoticon-shortcut option is disabled by default. Have fun π
0 comments