Are you sure? I did it before and I don't remember that's how it works. I tried to input "command w" but it doesn't allowed me to input "command".
Don't type out "command w", instead press the keys for SHFT CMD W, as if invoking the shortcut.
Yes it works...
Also, you may want to assign the shortcut to "Three Finger Tap" gesture rather than "Three Finger Click" since you are using a trackpad.