# Modifier keys with UI buttons

**URL:** https://forum.highend3d.com/t/modifier-keys-with-ui-buttons/6060
**Category:** Maya
**Tags:** mel
**Created:** [July 1, 2002, 9:41pm UTC](https://forum.highend3d.com/t/modifier-keys-with-ui-buttons/6060 "2002-07-01T21:41:45Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![dav-1](https://forum.highend3d.com/letter_avatar_proxy/v4/letter/d/b9e5f3/32.png) [@dav-1](https://forum.highend3d.com/u/dav-1)
#### Post date: [July 1, 2002, 9:41pm UTC](https://forum.highend3d.com/t/modifier-keys-with-ui-buttons/6060/1 "2002-07-01T21:41:45Z")

</div>

i'd like to use modifier keys (such as shift, ctrl, alt, etc) to modify the script that gets executed when clicking on a custom UI button.

anyone know how to test for modifier keys on button click?

---

<div class="post-metadata">

### Author: ![macaronikazoo](https://forum.highend3d.com/letter_avatar_proxy/v4/letter/m/eada6e/32.png) [@macaronikazoo](https://forum.highend3d.com/u/macaronikazoo)
#### Post date: [July 3, 2002, 2:00am UTC](https://forum.highend3d.com/t/modifier-keys-with-ui-buttons/6060/2 "2002-07-03T02:00:17Z")

</div>

if you attach a popMenu to a UI element such as a button, then you can check for modifier keys then. just have the postmenu command flag callthe script u want.

---

<div class="post-metadata">

### Author: ![joojaa](https://forum.highend3d.com/letter_avatar_proxy/v4/letter/j/5daacb/32.png) [@joojaa](https://forum.highend3d.com/u/joojaa)
#### Post date: [July 3, 2002, 3:45pm UTC](https://forum.highend3d.com/t/modifier-keys-with-ui-buttons/6060/3 "2002-07-03T15:45:56Z")

</div>

is there a command that can querry the keys that are pressed down? if so then you could use that.

---

<div class="post-metadata">

### Author: ![dav-1](https://forum.highend3d.com/letter_avatar_proxy/v4/letter/d/b9e5f3/32.png) [@dav-1](https://forum.highend3d.com/u/dav-1)
#### Post date: [July 11, 2002, 4:24pm UTC](https://forum.highend3d.com/t/modifier-keys-with-ui-buttons/6060/4 "2002-07-11T16:24:33Z")

</div>

thanks a lot, it worked like a charm.
