This is a read-only archive of the Framer Community on Facebook.

What is Framer? Join the Community
Return to index
Benny Chew
Posted Jun 30 - Read on Facebook

Is it possible to listen for a keyboard key press event? I would like to simulate typing in a search field, not really the actual typing though.

1 Comments

Алексей Кольченко

I used hidden (via opacity) HTML input element:
fBase.html = '<input id="_hidden" type="text" style="opacity: 0">';
fBase.on(Events.Click, function(e){document.getElementById('_hidden').focus();})
fBase._element.addEventListener('keydown', function(e){console.log(e.keyCode)}, false);

See the simple codepen: http://goo.gl/lPvd0y

Read the entire post on Facebook