Creating ONE shortcut key to smooth and unsmooth

This is for Maya users.

(Adapted this trick from one of AREA's tutorials)

Tip: Creating ONE shortcut key to smooth and unsmooth

1. Open the Hotkey Editor ( Window -> Settings/Preferences -> Hotkeys. )
2. Under "Categories" scroll down to "User" and on the far right press "New".
3. Give it a name ( e.g. pSmoothUnsmoothPress )
- Write this into the command-field:

SmoothPolygon;
select -cl;

- Then click "Accept" and the recently created command is listed under "Commands"
- Assign a hotkey for this operation and make sure "Press" is selected

4. Create another command called pSmoothUnsmoothRelease or something similar.
Type this into the command field:

undo;

- Assign it to the same button, but make sure "Release" is checked.