Capturing keystrokes; using modifier keys

I want to create a shortcut using "Command-R" on the mac and
"Control-R" on windows. I know how to capture a single keystroke
(my code is attached), but how do I capture using the modifier
keys?

Hi Asu
I don't think it's possible using vanilla AppleScript, but if you download and install the Jon's Commands scripting addition (free for non-commercial use) you'll be able to do this:
on run
if "Command" is in (keys pressed) then
display dialog "Command key is down" buttons {"OK"} default button 1
else
display dialog "Command key is not pressed" buttons {"OK"} default button 1
end if
end run
The script will also display the confirmation dialog if you run it in a script editor window using Command-R, but not if you run it by selecting "Run" from your script editor's menu menu.
HTH
H
Save this as an application:

Similar Messages

  • Is There A Comprehensive List Of Actions Using Modifier Keys?

    I have been using Macs for nearly five years and thought I was reasonably proficient.
    A few minutes ago I was told that it is possible to MOVE a file from one HD to another (rather than COPY it) by holding down the Command key.
    I wonder how many more there are that I don't know!
    So are they listed somewhere? I have looked in all my books and the Help menus but can't find anything.
    Ian.

    Thanks Duane.
    I have just downloaded it and given it a test run.
    It's an interesting application but it seems rather limited. When used with Final Cut Express it only listed half a dozen keyboard shortcuts when there are actually scores if not hundreds.
    Ian.

  • Custom Key Command w/o using a Modifier Key?

    There are several key commands that I wish to assign (actually just want to change) in LP8. But the ones I want to change are all using modifier keys, so this requires two keys. And the secondary modifier key area, the ones you check with a check-mark box (i.e. shift, control option, command)is grayed out, so it cannot be changed. Is there any way around this?
    For example: I want to re-assign one of the factory key-commands for "Go to selection start", to just be the return key. The factory key-command for this function, is hold shift & return.

    You should be able to select the key command, enable learn by key label, hit delete key to clear. Then type key choice.
    Doug

  • Using scroll wheel with modifier key to zoom out is not working

    I can't zoom out with the magnifying tool selected in all programs of the CS3 suite using the option key on a Mac. I can zoom in with no problem. I've been trying to figure this out for "8 hours" now!!!
    I do have this checked in the system preferences and Photoshop preferences. I don't think this is considered a keyboard shortcut but I do have universal access checked and zoom out checked in the system preferences.
    I searched this site and all of the internet looking for answers but can't seem to find much. I appreciate any help you can give. I'm way behind on my work today.
    Thank you!

    The default key for scrolling zoom is not Command but Control. To change this, go to System Preferences —> Universal Access and click on the Seeing tab. In the Zoom pane, click on the Options button, and in the sheet that drops down, select the text box at the bottom, highlight the character there, then press the modifier key you prefer.
    HTH
    Archie

  • Zoom:Use Scroll wheel with Modifier Keys to Zoom

    Help! Since the 10.6 update from 10.4.11, I can no longer zoom in and out by holding Command while moving scroll ring on my Kensington Expert Mouse. I have tried other modifier keys to no avail.
    I suspect a conflict, but do not know where to fix it. When in Firefox 3.5.2., Command plus scroll ring zooms the active window nicely. Any ideas or should I provide feedback to Apple or both? Thanks! DJ

    The default key for scrolling zoom is not Command but Control. To change this, go to System Preferences —> Universal Access and click on the Seeing tab. In the Zoom pane, click on the Options button, and in the sheet that drops down, select the text box at the bottom, highlight the character there, then press the modifier key you prefer.
    HTH
    Archie

  • Keyboard modifier key remap suddenly not working

    I am using a MacBook Pro running OS X 10.6.8 (Snow Leopard). I use a third-party USB keyboard that is laid out (naturally) Windows-style, with the Alt keys inside (closer to the space bar than) the “Windows logo” keys. I use the Modifier Keys button in the Keyboard preference panel to remap these to the standard Mac configuration, with the Command keys on the inside and the Option keys on the outside.
    Today those modifier keys are suddenly reversed back to the default Windows layout. The Keyboard panel still shows my preferred (remapped) configuration, but it is not being honored. I have tried reverting to the default layout and then back again, I have rebooted the system, nothing works—the modifier keys are still stuck in the Windows configuration. I rely heavily on keyboard macros in my work, most of which use the modifier keys, and those keystrokes are built into my fingers as second nature. The reversed modifier keys are driving me crazy. Please help: what can I do to make the keyboard honor my settings in the Keyboard preference panel?

    Same problem here. Been working fine for a couple years and now suddenly the modifier key mapping is being ignored.

  • Seamingly stuck modifier keys

    ..recently I experienced this issue several times: the command or the option key gets somehow stuck, but not physically only in osx... a log in log out usually solves the issue, or sometimes it gets unstuck by itself after a few minutes of waiting...it's pretty annoying during work so if any of you experienced a similar issue or know how solve it then please tell me...thank you
    ...the thingy usually kicks in when I use capture nx or illustrator cs...but I can't directly link it to none of them...I'm using 10.4.2 with hungarian, and an older hungarain-h keyboard layout...if any specific info is needed just tell me here....thanks in advance

    ...yes I did, but nothing happened...a member of local mac forum also told me to use this
    tell application "System Events"
    key up {command, option, shift, control}
    end tell
    script and the os will let go of the "stuck" modifier keys but it didn't work...

  • Want to log my keystrokes INCLUDING hot-keys/shortcuts...possible?

    I am working on a personal project, and want to log my keystokes (essentially a Keylogger.)  But the KICKER being that I want to not only see my keystrokes and character, but the MANY keyboard shortcuts I use daily on my Mac.  It's just for a personal research project, and the keyloggers, I've seen and tried doesnt log modifer keys.  Any help to find out if this is possible first, and secondly any recommendations would be greatly appreciated!
    I want to "capture" and make alist of ALL the keyboard shortcuts I use that native to the MacOs.  Besides stoping and jotting down, or audio recording these as I go, there has to be another way
    Thanks Community!

    Hi,
    no, but you can set combnations of alt+char. This can be set directly in the component properties. If you want to use hot keys then you would need to write JavaScript on the client to intercept the key and do whatever you want it to do. Note that dependent of the browser you use some keys are reserved by the browser and not available for the application.
    Frank

  • Detect key or modifier key when in MouseUp event of a button?

    Is there any chance to accomplish this? When I app.alert the "keystroke" or "modifiers" property, it always returns false. Any chance to detect if and probably even which (modifier) key was pressed when clicking the button?

    To detect shift, use event.shift. See the documentation for more information: http://livedocs.adobe.com/acrobat_sdk/9.1/Acrobat9_1_HTMLHelp/JS_API_AcroJS.88.604.html
    There's no way to know what other keys are pressed when a button is clicked.

  • Capture keystroke from the SAP Business One Desktop

    Does anyone know how I can capture a keystroke from the SAP Business One “Desktop” with the UI API?
    Basically, open the B1 Client, then click the mouse in the back ground beside the main menu so that the cursor is “nowhere” (not in the search field). Now set some code In the KeyDown event to catch any keystrokes. Nothing happens. The event is not called. I even tried using SetWindowsHookEx API function but never got it to work with an SDK project since there is no form hHandle. Woudlnd even work once I gave the hhandle of the B1 Client

    Hi Marc,
    what is your exact requirement ?
    I don't think you can specificly catch a key down in the background - but only because it is not possible to "lose" main menu as active form ( only if you close it -> then search field is active ).
    So basically you have to find a logic where you can catch *your* keydown on any form.
    Be aware of the fact, that keydown won't let you catch all keys / key combinations.
    I had an equal requirement some time ago and after a lot of experimenting ( windows global hook wouldn't work reliable ) I ended up using SBO key shortcuts ( F2-F12 ) and their menu events.
    regards,
    Maik

  • Tryint to use modify

    I am trying to use modify but my zzxmnga does not get updated but when i debug it has the correct value in it but doens't modify the record.  Here is the code
    LOOP AT T_ZOXED10166 INTO W_ZOXED10166.
          wa_TABIX = SY-TABIX.
         READ TABLE T3_ZOXED10166 INTO W3_ZOXED10166 WITH KEY
                             RUECK = W_ZOXED10166-RUECK
                             GRUND = W_ZOXED10166-GRUND.
         IF SY-SUBRC = 0
         AND  W_ZOXED10166-GRUND+1(1) CP 'S'.
           W3_ZOXED10166-ZZXMNGA = W_ZOXED10166-XMNGA + W3_ZOXED10166-XMNGA.
           MODIFY T3_ZOXED10166  FROM W3_ZOXED10166 INDEX WA_TABIX.

    Try:
      IF sy-subrc = 0 AND
         w_zoxed10166-grund+1(1) EQ 'S'.         "<=== CP changed to EQ
        w3_zoxed10166-zzxmnga = w_zoxed10166-xmnga + w3_zoxed10166-xmnga.
        MODIFY t3_zoxed10166 FROM w3_zoxed10166 INDEX wa_tabix.

  • Cross browser testing : Modifier Keys playback actions not working in chrome and Firefox

    Hi,
    In my work flow I have to select multiple items in list.So I have recorded 'Ctrl+Click' action to select list items.In Chrome and Firefox it is not selecting multiple Items.
    Even Ctrl+A,Ctrl+C,Ctrl+V also not working in chrome and Firefox.Complete modifier keys support is not observed in chrome and Firefox.Let me Know how to automate modifier keys actions in cross browser?
    Regards,
    Nagasree.

    Hi Nagasree,
    Welcome to MSDN forums.
    First,please make sure the Chrome and Firefox is supported by cross browser testing.
    Latest version of Chrome and Firefox supported by cross browser testing are Chrome version 38.0.2125.111 and
    Firefox 33.
    I doubt whether Chrome and Firefox in cross browser testing don’t support automating modifier keys or there is anything wrong on it if you are using supported browser. Since this issue is related to the Extensions tool
    Selenium components for Coded UI Cross Browser Testing, if possible, I suggest you post this
    issue here, click “Q AND A”, and then you could post this issue there, you would get dedicated
    support there.
    Thanks for your understanding.
    Best regards,
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • [SOLVED] xmodmap qt4 modifier keys no longer work

    Hi, I'm nearing the "hair-pulling stage because Googling this issue did not yield helpful results" stage.
    I am having trouble getting modifier keys (CTRL, ALT) to work in qt apps after loading my custom keymap (as provided by ~/.Xmodmap). If my custom keymap is not loaded, then ctrl, alt keys work fine in qt apps. That is, it is only when this custom keymap is loaded that qt apps no longer respond to what I have mapped as the CTRL and ALT keys.
    I have awesome wm setup to load the command xmodmap ~/.Xmodmap automatically on startup using this lua code:
    awful.util.spawn("xmodmap " .. os.getenv("HOME") .. "/.Xmodmap")
    My ~/.Xmodmap has comments on what I've switched around.
    I am not sure what is causing this to occur? How can I fix this?
    FYI on Xfce4 loading the custom key mappings don't lead to this issue with qt apps not responding to what I've set as modifier keys.
    Update 10/08/2014 5:55PM CST It turns out I had a different .Xmodmap from when I was using Xfce4. There's something funky with the version I was using with awesome wm.  I've updated Xmodmap here, in case somebody runs into a similar issue.
    Last edited by hckr (2014-10-08 22:59:59)

    To get my inspiron 8500 working I had to use the xkbmodel set to inspiron and remap a little like this
    /etc/X11/xorg.conf
    Section "InputDevice"
    Identifier "Keyboard0"
    Driver "kbd"
    Option "CoreKeyboard"
    Option "XkbRules" "xorg"
    Option "XkbOptions" "altwin:super_win"
    # Option "XkbModel" "pc105"
    Option "XkbModel" "inspiron"
    Option "XkbLayout" "gb"
    Manually configured other keys in ~/.Xmodmap. To see current mappings use "xmodmap -pk"
    keycode 162 = XF86AudioPlay
    keycode 153 = XF86AudioNext
    keycode 144 = XF86AudioPrev
    keycode 164 = XF86AudioStop
    keycode 129 =
    keycode 130 =
    keycode 131 =
    keycode 132 =
    The 129-132 were wrongly mapped so I unmapped them
    I then still had to configure Amarok global shortcuts to use the keys, but it worked, Maybe as I am using XFCE.
    Last edited by alleyoopster (2008-11-22 23:35:17)

  • Unable to change modifier keys on exernal keyboard.

    Running a unibody MBP with 10.8.5.  Trying to change the modifier keys (swap Option and Command) on an external USB keyboard (daskeyboard ultimate stealth).  Using Preferences -> Keyboard/Mouse -> Modifier Keys, I select my external keyboard (listed as daskeyboard) and make the switch.  This has no effect.  I am able to change the modifiers on the built in keyboard, but that doesn't help me. 
    I am not running the KB through a hub, direct connect to USB port.
    I have tried all possible combinations of adjust settings, reboot, retry, unplug, re-plug, move plug - no joy.
    From other posts here and elsewhere it seems this bug/glitch has been in Apple's side for a lot of years.  Does anyone have a FIX for this that does not involve some hacky workaround where a chicken needs to die?
    I run a linux VM on this Mac and it would be really nice if CTRL and ALT were where CTRL and ALT have been for decades.

    Hello
    I have a new Toshiba Satellite A75-S209 laptop. Now the keyboard was working perfectly, until i plugged in a external logitech usb keyboard. Now when i try to use the laptop keyboard alone all the characters are messed up.
    i have tried to reinstall the keyboard by removing it, but i was not successful .
    is there any way of re mapping all the keys?
    or even like keyboard software?!
    thanks
    nelby

  • Modifier Key Mapping Not Working

    When I'm at home, I connect my MacBook Pro to a 24" LCD, along with an external keyboard and mouse. One of the small features I was looking forward to in Leopard was not having to go into System Preferences and switch the modifier keys to correctly work with my external keyboard, but I've discovered that the feature isn't working. I choose "USB Receiver" from the keyboard drop-down, re-map the Option and Command keys, click OK, and close SysPrefs. Nothing has changed; the Command key on my keyboard is still performing as Option and Option is still Command. When I go into the Keyboard & Mouse section of SysPrefs, the Modifier Keys pane is back to it's default values. I'm wondering if this is a bug in 10.5 that will be fixed with 10.5.1, or if it's just my keyboard. Any tips would be greatly appreciated!
    Message was edited by: bradbergeron
    Message was edited by: bradbergeron

    Any updates on this bug?
    On my Powerbook, I have to swap the modifier keys under the "All" setting to make the change take effect on the external USB keyboard I'm using. Changing modifier keys on just the "DELL USB KEYBOARD" (in my particular case) has no effect.
    It's just a minor annoyance (having to reset my modifier keys back to defaults when I need to use the built-in keyboard), but all the same the feature doesn't appear to work as it should.
    Or is it just me?

Maybe you are looking for

  • Before dropping a table

    Hi, I have to do an impact analysis before dropping a table from production database, which Is the best/economic way to do an impact analysis in application developers view if the table is not using in the application itself ? Thanks Bcj

  • Why can't i install itunes and quicktime on my windows 7 64 bit pc

    I have always failed trying to install iTunes to my Windows 7 64 bit PC. When installing it'll pause for a long time in this stage: After a while it'll then show this message: I tried it a couple of times and it always ends up like this. And moreover

  • Unable to Update CC Application

    Regular PC, running Windows 7 Professional.  Creative Cloud member since last October so I've done MANY updates...... Yesterday afternoon my laptop wanted me to update some of the Adobe CC applications, so I opened the CC app and IT wanted to install

  • Converting movies to mov. format

    Is there anyone who can tell me how to convert movies to mov. format. I have tried other solutions but non seem to work except for when I download an mov. file/movie. Does anyone now of any programs that do that. Thanks

  • Trying to add 1 to db cell, but instead it adds 14million!

    HI, I am trying to add "1" to a cell in a db, but instead, it adds like a million.... I'm confused, here is the code which does it, it would be awesome if anyone can help! Thanks String sql2 = "SELECT * FROM users WHERE ID = "+jnum+""; upd = stmt.exe