![]() ![]() If running of application "System Preferences" then # to be predictable from a clean occurrence. # This is also done to allow default behaviors # as 'quit' fails when done so, if it is. # if it is running and a modal sheet is # This is done so the script will not fail # Check to see if System Preferences is # of the Keyboard pane in System Preferences. # Change the value of Key Repeat on the Keyboard tab # in comments and possibly in code as well. # such as symbols for modifier keys and others # It also doesn't like the use of some characters # Therefore code must be written in long form. # AppleScript line continuation character. ![]() # NOTE: Hammerspoon does not allow the use of the This should now toggle the Key Repeat slider on the Keyboard tab of the Keyboard pane in System Preferences as Preview is activated/deactivated. NOTE: With that done, you can now click the Reload Config command on the Hammerspoon menu, on the menu bar. Open ~/.hammerspoon/Scripts/ChangeKeyRepeatValue.applescriptĬlose: Terminal (Assumes no errors from previous commands.)Īdd the example AppleScript code, shown below, to the opened ChangeKeyRepeatValue.applescript document, then save it, and close the document. Touch ~/.hammerspoon/Scripts/ChangeKeyRepeatValue.applescript In Terminal: mkdir -p ~/.hammerspoon/Scripts If (eventType = hs.) thenĪppPreviewWatcher = hs.(applicationPreviewWatcher)Īdding the AppleScript script to Hammerspoon Local ok, status = hs.osascript.applescriptFromFile(os.getenv("HOME"). Local asFile = "/.hammerspoon/Scripts/ChangeKeyRepeatValue.applescript" Open the Hammerspoon configuration file by clicking the Open Config command from the Hammerspoon menu, on the menu bar.Īdd the example Lua code to the a configuration file and save the document, then close it.Įxample Lua code: function applicationPreviewWatcher(appName, eventType, appObject) Your all set!Įnable Accessibility (Should be grayed out.) Open Hammerspoon from Applications or Spotlight, then:įrom the Hammerspoon menu, on the menu bar, click it, then click Preferences…, and set them as follows:Īccessibility: Accessibility is enabled. Open the Downloads folder and drag and drop the Hammerspoon application bundle into Applications.īefore you open Hammerspoon, add it to: System Preferences > Security & Privacy > Privacy > Accessibility Note that the download and install instructions assume Safari and default preference Open “safe” files after downloading checked.1 Assumes necessary and appropriate setting in System Preferences > Security & Privacy > Privacy > Accessibility have been set/addressed as needed.The example Lua code and example AppleScript code, shown further below, was tested under macOS High Sierra and macOS Catalina with Language & Region settings in System Preferences set to English (US) - Primary and worked for me without issue 1. It uses the third-party application Hammerspoon along with a bit of Lua code to watch for Preview being activated/deactivated, and an AppleScript script using UI Scripting to adjust the Key Repeat slider on the Keyboard tab of the Keyboard pane in System Preferences. This is a workaround solution that sets the Key Repeat slider to the default position when Preview is activated, and to Fast when it's deactivated, (i.e. By default it's one position from the right. Example of a random PDF file where it happens: Here is a video recording showing the behavior: Īs discovered, this issue currently only exists with Preview when the Key Repeat slider on the Keyboard tab of the Keyboard pane in System Preferences is set to Fast, where the slider is all the way to the right. In Preview settings, "opening for the first time" is set to continuous scroll. This happens both with a Kinesis Pro keyboard and a bog-standard Dell USB keyboard both have dedicated page up/down keys. What could cause this, and how can I prevent this from happening (short of reducing the keyboard repeat rate), so that Preview stops when it reaches the top or bottom of a document? The behavior only happens if I set my key repeat rate (in system preferences) to the maximum possible. ![]() For example, if I press and hold Page down to page forward, then when it reaches the end of the document, it doesn't stop there it starts back at the top, going around in a kind of loop. If I open a PDF document in Preview and navigate through the pages normally using Page down and Page up, then if I hold down the keys to trigger auto-repeat, when I reach the bottom (or top) of the document, Preview wraps around and shows me the top (or bottom) again. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |