Pricing Blog

How can I trigger an event using the return key?

  • gerson_ca-1276729449517154376

    Gerson CA

    1 year ago

    I have this logic being triggered when clicking on a button. However, I’d like to trigger it by only pressing the return key on my input field. I was trying with the key up event but I only get the the “a” key and I don’t see where I can change this.
    1276729450247098428-Screen_Shot_2024-08-23_at_21.10.39.png
    1276729450842816603-Screen_Shot_2024-08-23_at_21.13.18.png
  • lucasg-1276730435866460232

    Lucas G

    1 year ago

    Add an Equals node to the key event where it equals 'Enter'
  • Tod-1276730437187670156

    Tod

    1 year ago

    Great energy @Lucas G! Your continuous contribution to the toddle Community just made you advance to Community Level 29!
  • gerson_ca-1276741887599972373

    Gerson CA

    1 year ago

    Like this?
    1276741887394578452-Screen_Shot_2024-08-23_at_22.15.24.png
  • 773849973228961793-@Gerson CA
    Like this?
    lucasg-1276753606409981996

    Lucas G

    1 year ago

    Yes. Except it should be Enter
  • Not return
  • gerson_ca-1276754255721529395

    Gerson CA

    1 year ago

    But my key event always stays on “a” even after I press return
  • lucasg-1276754367998853191

    Lucas G

    1 year ago

    I normally put this on the keydown event but keyup should be fine 🤔
  • Something else that you need to do though is add a switch
  • On the switch, the condition is where your key event goes
  • So on keydown -> switch -> if key pressed equals Enter then flow
  • gerson_ca-1276757885006643322

    Gerson CA

    1 year ago

    Ok it does work but the event key never changes and stays always on “a. Even after pressing Enter so I don’t know if it’s like that or it’s maybe a bug?
    1276757884797194291-Screen_Shot_2024-08-23_at_23.16.54.png
  • lucasg-1276758037704605791

    Lucas G

    1 year ago

    That’s just a preview of the event
  • Value is only passed when the key is pressed
  • gerson_ca-1276761087169003641

    Gerson CA

    1 year ago

    Ohhh I see great thanks, btw it also works fine with the key up event. I appreciate the fast response 🙌
  • Tod-1276761088435687495

    Tod

    1 year ago

    Great energy @Gerson CA! Your continuous contribution to the toddle Community just made you advance to Community Level 2!