I've seen this option in one Ubuntu machine and I want to replicate it in my mac:

Hold a Key for 2 second to activate it.

What I have seen is this:
Hold down a Key for 2 second (<kbd>Shift</kbd> for example).
Then write something and the written text was as if the <kbd>Shift</kbd> key is pressed (and it acts like the <kbd>Caps Lock</kbd> pressed).
Then the key is pressed one time to deactivate it.

Is it possible to achieve this on a mac too?