#✅ | Use of ticker to detect specific or whatever input

1 messages · Page 1 of 1 (latest)

keen solar
#

I would like to do some stuff like disable layouts after pressing some keys

rocky pineBOT
#

Hi! 👋 Please first click the button below to start this support ticket.

⚠️ It is not possible for anybody to send messages in this ticket before it has been started, so you need to click the button for others to be able to help/answer you.

rocky pineBOT
# keen solar I would like to do some stuff like disable layouts after pressing some keys

Antes de seguir: ¿prefieres que te responda en español 🇪🇸? 🙂

That issue could be related to this bug: FancyMenu may not respect remapped modifier keys on macOS, if you’re using remapped Ctrl/Command keys, key detection can behave oddly.

For what you want, don’t use a Ticker if you can avoid it.
The better option is a Listener:

  • Use On Keyboard Key Pressed
  • Check the listener variables like $$key_name or $$key_keycode
  • Then run actions like Disable Layout, Enable Layout, or Toggle Layout

Example idea:

  • Listener: On Keyboard Key Pressed
  • IF $$key_name equals your key
  • Action: disable_layout with the layout name

If you want to toggle a layout with a key, that is usually the cleanest way.

If you want, I can give you a tiny step-by-step setup for:

  1. one key disables a layout
  2. one key toggles a layout
  3. multiple keys with different actions
keen solar
#

i dont get how to modify the listener condition xD

rocky pineBOT
# keen solar i dont get how to modify the listener condition xD

No worries 😄

In FancyMenu, the listener does not have a separate “condition” switch.
The condition goes inside the listener’s action script.

Do this:

  1. Open Customization -> Manage Listeners
  2. Edit your On Keyboard Key Pressed listener
  3. Open its Action Script
  4. Add an IF Statement
  5. Add a requirement inside it:
    • use Is Text if you want to check $$key_name
    • use Is Number if you want to check $$key_keycode
  6. Put the action you want inside the IF block, for example:
    • disable_layoutmy_layout

Simple example:

  • IF $$key_name equals F7
  • then run disable_layout for my_layout

Important ⚠️
On Keyboard Key Pressed repeats while the key is held down, so if you want a single trigger per press, On Keyboard Key Released is often safer.

If you want, tell me:

  • the key you want to detect
  • the layout name you want to disable

and I’ll write the exact listener setup for you 👌

keen solar
#

Tecla enter, los layouts funcionan

rocky pineBOT
# keen solar Tecla enter, los layouts funcionan

Sí, claro 😄

Para la tecla Enter, hazlo así:

  1. Ve a Customization -> Manage Listeners
  2. Abre tu listener de On Keyboard Key Pressed
    • mejor aún: On Keyboard Key Released para que no se repita mientras mantienes la tecla
  3. En su Action Script, añade un IF Statement
  4. Dentro del IF, pon esta condición:
    • Requirement: Is Text
    • Text: $$key_name
    • Compare with: Enter
  5. Dentro del IF, añade la acción:
    • disable_layout
    • valor: el nombre exacto de tu layout

Si quieres activar/desactivar con Enter en vez de solo desactivar, usa:

  • toggle_layout en lugar de disable_layout

Si Enter no te lo detecta por nombre, usa $$key_keycode en vez de $$key_name y selecciona la tecla Enter desde el selector del requisito ⚠️

Si quieres, te lo escribo en formato “árbol” exacto de cómo debe quedar en el editor 👌