Mac Keyboard Shortcuts

OSX 2010. 6. 6. 19:50

Mac Central: Your place for good, concise, Mac related hints.

Keyboard ShortcutsMulti-Touch GesturesTips & TricksRecommended Programs

Mac Keyboard Shortcuts

I like to figure out the fastest way to do things. I hope these shortcuts will help you become the power user that lies within. These keystrokes should work on Mac OS 10.6 Snow Leopard and 10.5 Leopard (many also work on 10.4 Tiger). I add new shortcuts as I find them, so check back!

Please note that Cmd is short for the Command key (otherwise called the Apple key).

Guide to the Mac’s Menu Symbols

Symbol
Key on Keyboard
Symbol
Key on Keyboard
Command/Apple key (like Control on a PC)
Delete
Option (like Alt on a PC)
Escape
Shift
Page Up
Control (Control-click = Right-click)
Page Down
Tab
Home
Return
End
Enter (on Number Pad)
Arrow Keys

Finder Shortcuts

Action Keystroke
Open Sidebar item in a new window Cmd-Click it
Switch Finder views (Icon, List, Column, Cover Flow) Cmd-1, Cmd-2, Cmd-3, Cmd-4
In List view, expand a folder Right Arrow
In List view, collapse a folder Left Arrow
Rename the selected file/folder Press Return (or Enter)
Go into selected folder or open the selected file Cmd-Down Arrow
Go to parent folder Cmd-Up Arrow
Go Back Cmd-[ (that’s left square bracket)
Go Forward Cmd-] (that’s right square bracket)
Select the next icon in Icon and List views Tab (Shift-Tab reverses direction)
Alternate columns in Column View Tab (Shift-Tab reverses direction)
Instantly show long file name (for names condensed with a “...”) Hold Option while mousing over long filenames
Resize current column to fit the longest file name Double-Click column resize widget
Resize all columns to fit their longest file names Option Double-Click resize widget
Copy and Paste files Cmd-C, then Cmd-V
Move a file instead of copying. (Copies the file to the destination and removes it from the original disk.) Cmd-Drag file to disk
Move selected files to the Trash Cmd-Delete
Empty the Trash (with warning) Cmd-Shift-Delete
Empty the Trash (without warning) Cmd-Opt-Shift-Delete
Cancel a drag-n-drop action while in the midst of dragging Esc
Show Inspector (a single, live refreshing Info window) Cmd-Opt-I
Undo the last action (such as rename file, copy file, etc.) Cmd-Z
Hide/Show Sidebar (on the left) Cmd-Opt-T
Move or Remove item in toolbar (at the top of the window).
This works in most programs.
Cmd-drag
Open Quick Look (Mac OS 10.5) With file selected, tap Spacebar (or Cmd-Y)
Zoom In/Out on a Quick Look Preview Cmd-Plus(+) or Cmd-Minus(-)
Find by File Name (Mac OS 10.5) Cmd-Shift-F

Application Switcher

Action Keystroke
Quickly switch between 2 programs
(such as: InDesign & Photoshop)
Press Cmd-Tab to switch to the last used program.
Press Cmd-Tab again to switch back.
NOTE: Press keys quickly and do NOT hold them down.
Switch between programs (but you choose which program to switch to) Press Cmd-Tab and continue holding Cmd.
While holding Cmd, to choose which program you want to switch to you can:
• press Tab (several times if needed) to scroll right
• press Shift-Tab or tilde(~) to scroll left
• use the left/right arrow keys
• aim with the mouse
• use end/home keys to just to first/last item
Quit a program using the application switcher When in the app switcher you’re already holding Cmd.
Once the program is selected hit Q to quit.
Hide a program using the application switcher When in the app switcher you’re already holding Cmd.
Once the program is selected hit H to hide.
Cancel out of the application switcher once it’s open When in the app switcher you're already holding Cmd.
Hit Esc or period(.)

Dock Shortcuts

Action Keystroke
Hide all other applications (except the one you're clicking on) Command-Option click an App’s icon in Dock
Reveal a Dock item’s location in the Finder Command Click on the icon in the Dock
Move and a Dock item to somewhere else on the hard drive Command Drag the icon from the Dock to new destination
Force a file to open in a specific program While dragging the file onto an app’s icon in the Dock, hold Command-Option
When in an app’s Dock menu, change the Quit to Force Quit Hold Option while in Dock menu
Force the Dock to only resize to non-interpolated icon sizes Hold Option while dragging Dock separator
Move Dock to left, bottom, right side of screen Hold Shift and drag Dock divider
Temporarily turn magnification on (or off) It’s a toggle. Hold Control-Shift (Mac OS 10.5 and later)

Working with Windows

Action Keystroke
Switch windows (works in most programs) Next window: Cmd-tilde(~)
Previous Window: Cmd-Shift-tilde(~)
See where the File/Folder is located (a menu will pop-up displaying the folder hierarchy). This works in “most” programs as well as the Finder. Cmd-Click on name of the window in its titlebar
Move a window in the background without switching to it.
(Example: You’re in a dialog and can’t move a window in the background, so Cmd-Drag its titlebar.)
Cmd-Drag on a window’s titlebar

Taking Screenshots

Action Keystroke
Take picture of the entire screen Cmd-Shift-3
Take picture of a selected area Cmd-Shift-4 and Drag over desired area
New in Mac OS 10.5: While dragging:
- Hold Spacebar to move selected area.
- Hold Shift to change size in one direction only (horizontal or vertical)
- Hold Option for center-based resizing.
Take picture of a specific window/object Cmd-Shift-4, then press Spacebar, then Click on the window/object
Copy the screenshot to the clipboard instead of making a file Hold Control with the above keystrokes
Screenshots are saved to the Desktop as PNG file in OS 10.4 and later (or a PDF file in OS 10.3 and prior).

Startup Commands

Action Keystroke
Eject CD on boot Hold Mouse button down immediately after powering on
OS X Safe boot Hold Shift during startup
Start up in FireWire Target Disk mode Hold T during startup
Startup from a CD Hold C during startup
Bypass primary startup volume and seek a different startup volume (CD, etc.) Hold Cmd-Opt-Shift-Delete during startup
Choose Startup disk before booting Hold Option during startup
Start up in Verbose mode Hold Cmd-V during startup
Start up in Single-User mode (command line) Hold Cmd-S during startup
Force OS X startup Hold X during startup

Shutdown/Sleep Commands

Action Keystroke
Shutdown immediately (no confirmation) Cmd-Opt-Ctrl-Eject
Sleep immediately (no confirmation) Cmd-Opt-Eject
Restart, Sleep, Shutdown dialog (like hitting the Power button on old Mac keyboards) Ctrl-Eject
Put display to sleep Ctrl-Shift-Eject

Dashboard

Action Keystroke
Open/Close Widget Dock Cmd-Plus(+)
Cycle to next/previous “page” of widgets in widget dock Cmd-Right/Left Arrow
Close a widget without having to open the widget dock Hold Option and hover over widget (close box will appear)
Reload/Refresh a widget Cmd-R

Spaces Mac OS 10.5 and 10.6

Action Keystroke
Activate Spaces (birds-eye view of all spaces) F8
Consolidate all windows into a Single Workspace After pressing F8, press C to consolidate (press C again to restore)
Move to a neighboring space Ctrl-arrow key (left, right, up or down)
Move to a specific space Ctrl-number of the space (1, 2, 3, etc.)
Move all windows of an app to another space Cmd-Drag in Space’s birds-eye view (Control and Shift also work)

Spotlight

Action Keystroke
Open Spotlight Menu Cmd-Space
Open Spotlight Window Cmd-Option-Space
In Spotlight menu: Launch Top Hit Return (In Mac OS 10.4 it’s Cmd-Return)
Reveal the selected item in the Finder

In Spotlight Menu: Cmd-click item or press Cmd-Return

In Spotlight Window: Press Cmd-R

Skip to first result in each category Cmd up/down arrow
Clear Spotlight’s search field Esc clears to do another search.
Esc a second time closes the spotlight menu.

Working with Text (some only work in Cocoa apps like Safari, Mail, TextEdit, etc.)

Action Keystroke
Go to end of line Cmd-right arrow
Go to beginning of line Cmd-left arrow
Go to end of all the text Cmd-down arrow
Go to beginning of all the text Cmd-up arrow
Go to end of current or next word Option-right arrow
Go to beginning of current or previous word Option-left arrow
NOTE: Add Shift to any of the above keystrokes to make a selection to that point.
On Laptops: Delete Text to the right of the cursor (like the Del key on a full keyboard) Function(fn)-Delete
Non-touching (Discontinuous) text selections Command-drag
Select non-linear areas Option-drag
Delete entire word to the left Opt-Delete
Look up word in dictionary Position mouse over a word and hold Cmd-Ctrl-D

Auto completion word

Start typing the word. Press Esc (or F5) to open suggested word list

Emacs Key Bindings (only work in Cocoa apps like Safari, Mail, TextEdit, iChat, etc.)

Action Keystroke Remember As
go to start of line (puts cursor at beginning of current line) Ctrl-A A = Start of alphabet
go to end of line (puts cursor at end of current line) Ctrl-E E = End
go up one line Ctrl-P P = Previous
go down one line Ctrl-N N = Next
go back one character (moves cursor left 1 place) Ctrl-B B = Back
go forward one character (moves cursor right 1 place) Ctrl-F F = Forward
delete the character to the right of the cursor Ctrl-D D = Delete
delete the character to the left of the cursor Ctrl-H
delete to end of the line (or delete the selection) Ctrl-K K = Kill rest of line
scroll down Ctrl-V
center the current line in the window Ctrl-L
insert line break after the cursor without moving the cursor Ctrl-O
transpose letters (swaps letter on the left and right of cursor) Ctrl-T T = Transpose

Miscellaneous

Action Keystroke
Force Quit (opens list so you can choose application) Cmd-Opt-Esc
Force Quit Frontmost Application (without confirmation) Hold Cmd-Opt-Shift-Escape for about 4 seconds
On Laptops: Scroll (like a mouse’s scroll wheel)
(Works on newer laptops if enabled in System Preferences)
Slide 2 fingers on the trackpad
On Laptops: Right-click (like on a 2 button mouse)
(Works on newer laptops if enabled in System Preferences)
Place 2 fingers on the trackpad and Click
Quickly find any menu item and launch it. (Mac OS 10.5) 1. Press Cmd-? FYI: That’s Cmd-Shift-/
2. In the Help menu Search that opens, start typing a few letters of your desired menu command.
3. Arrow key down to the item you want and press Return to choose it.
Change system volume without the confirmation beeps Hold Shift while changing volume
Completely smooth scrolling—one pixel at a time.
(Only works in Cocoa apps.)
Hold Option while dragging scrollbar
Open System Preferences:
NOTE: These launch directly into a preference pane.
Two examples are given.
To open “Sound” Preferences:
Hold Option and press any Sound key
(Mute, Volume Up or Down )

To open “Displays” Preferences:
Hold Option and press any Brightness key
Open Front Row Cmd-Esc
Quickly Exit Front Row Press any F key, like F5. In 10.5 and later, non F keys also work.
Customize the toolbar at the top of a window.
Works for toolbars like in Safari, Apple Mail, Preview, Finder, etc. But it doesn't work in all programs, like Firefox.

- Rearrange icons:
   Hold Cmd and drag the icons around.

- Remove icons:
   Hold Cmd and drag icon off toolbar.
- View toolbar options:
   Ctrl-click on the toolbar to get a menu.

Safari

Action Keystroke
Switch Tabs Next Tab: Ctrl-Tab (or Cmd-Shift-Right Arrow)
Previous Tab: Ctrl-Shift-Tab (or Cmd-Shift-Left Arrow)
Go to one of the first 9 bookmarks (not folders) in the Bookmarks Toolbar Cmd-1 through Cmd-9
Move between found items (in Safari 3 and later) Cmd-F, enter your search text and Press:
Return to Move Forward
Shift-Return to Move Backward
Cancel current Find Press Escape or Cmd-Period(.)
Scroll a webpage by a screenful Scroll Down: Spacebar or Option-Down Arrow
Scroll Up: Shift-Spacebar or Option-Up Arrow

Apple’s Mail.app

Action Keystroke
Reply to Message Cmd–R or
Option-Double Click Message
Go to the next/previous email in a thread even if you haven’t organized by threads Option-Up/Down Arrow
Scroll the listing of emails at the top (not the actual contents of an email) Ctrl-Page Up/Down

Apple’s Preview.app

Action Keystroke
Choose the Scroll/Move tool Cmd-1
Choose the Text tool Cmd-2
Choose the Select tool Cmd-3
Zoom in or out Cmd-Plus(+) or Cmd-Minus(-)
Scroll Large Images Hold Spacebar and drag on the image (like you do in Photoshop)


back to top

“Thanks Dan!” If you like this site, making a donation will:
Encourage Dan to keep adding useful information.
Make you (and Dan) feel warm and fuzzy inside.

Secure transactions by PayPal. No PayPal account required.

:

OpenCV on OSX

Image Processing 2010. 6. 3. 15:13

1. OpenCV Source 다운 받기


svn 을 통해서 다운 받을 수 있겠지만, 그냥 기본적으로 opencv-2.0.0으로 아래 사이트에서 다운 받습니다.
(여기서는 /Users/bkim/opencv에 소스파일을 다운받았습니다.)
2. pkgconfig, jpeg, libpng, tiff 설치
터미널에서
$ sudo port install pkgconfig $ sudo port install install jpeg libpng tiff

설 치를 마쳤다면, path 설정을 합니다.
$ export PKG_CONFIG_PATH = /usr/local/lib/pkgconfig

path 가 잘 나가는지, 확인하고 싶다면,
$ pkg-config --cflags opencv -> I/usr/local/include/opencv

$ pkg-config --libs opencv -> L/usr/local/lib -lcxcore -lcv -lhighgui -lcvaux -lml

3. cmake 설치
아 래 사이트에서 다운을 받습니다. 현재(09년 1월), cmake-2.8.0-Darwin-universal.dmg이 최신 버전이군요. http://www.cmake.org/cmake/resources/software.html
설 치 후, 실행을 하면,

Specify the generator for this project는 Xcode, 그리고 Use default native compilers 선택합니다.
Where is the source code에서 다운 받은 opencv 경로를 작성, Where to build the binaries에 원하는 경로를 작성합니다. (여 기선, source code 경로로 '/Users/bkim/opencv', binaries 경로로 '/Users/bkim/opencv/_make'로 설정하였습니다.) 경 로 설정 후, 'Configure' 버튼을 누르면, 아래와 같은 화면이 나타납니다.

붉 게 표시된 목록에서,
BUILD_NEW_PYTHON_SUPPORT = OFF ENABLE_OPENMP = ON

두 가지 옵션을 선택 후, 다시 한번 'Configure'버튼을 클릭합니다. 클릭 후 조금 기다리면 'Generate'을 누를 수있게 됩니다. 'Generate' 클릭 후 또한 조금 기다리면 성공을 알리는 메시지가 나타납니다.
최 종적으로 잘 마무리 되었는지는 설정한 binaries 경로에 OpenCV.xcodeproj이 존재하는지 확인합니다. (여 기서는, /Users/bkim/opencv/_make/)

4. Xcode 컴파일
생성된 OpenCV.xcodeproj 파일을 열면 XCode가 시작됩니다. 아래와 같이 설정 후, 컴파일(⌘B)을 합니다.
Active Configuration = Release Active Architecture = i386


5. OpenCV.framework 만들기
쉘스크립트를 통해서 framework를 만들 수 있습니다. opencv를 다운 받은 경로에서 (여기서는 /Users/bkim/opencv),
$ sh make_frameworks.sh

다소 시간이 흐른 뒤, opencv 경로에 'OpenCV.framework'가 생성되며, 그것을 '/Library/Framework'로 복사합니다.
framework이 잘 만들어졌는지 확인을 위해 'opecv/samples/MacOSX/FaceTracker.xcodeproj'를 실행 및 컴파일해봅니다.

향후, 본인만의 OpenCV 프로그래밍시에 Xcode 실행, 아래 그림처럼 'Add'->'Existing Frameworks' 선택, 그리고 'Opencv.Framework'이 존재하는지 확인합니다. 없다면, 'Add Other...'를 통해 '/Library/Framework'안에 존재하는 'opencv.framework'를 추가하시면 됩니다.


6. 예제 코드 컴파일하기
OpenCV에서 제공하는 예제 코드(opencv/samples/c)들을 가지고 놀기 위해서 컴파일을 해줍니다.
$ sh build_all.sh

혹시 컴파일에 문제가 있다면, build_all.sh 파일을 아래와 같이 수정해줍니다.
# 10번째 줄 # gcc -ggdb `pkg-config --cflags opencv` -o `basename $i .c` $i `pkg-config --libs opencv`; 를 다음처럼 수정 gcc-4.0 -ggdb `pkg-config --cflags opencv` -o `basename $i .c` $i `pkg-config --libs opencv`;
# 14번째 줄 # g++ -ggdb `pkg-config --cflags opencv` -o `basename $i .cpp` $i `pkg-config --libs opencv`; 를 다음처럼 수정 g++-4.0 -ggdb `pkg-config --cflags opencv` -o `basename $i .cpp` $i `pkg-config --libs opencv`;

컴파일이 마무리 되셨으면, 예제 코드를 가지고 놉니다. :)
$ ./edge



이상~ 끝. :)

http://wowjerry.tistory.com/archive/201001#recentTrackback






Build OpenCV on Snow Leopard

OpenCV (Open Source Computer Vision) is “a library of programming functions for real-time computer vision”.

It took me whole day yesterday to build OpenCV for my Snow Leopard. I still need to add the FFMPEG support but for now, it is turned off. I’ve followed the Mac OS X OpenCV Port doc.

svn co https://code.ros.org/svn/opencv/trunk opencv

cd opencv mkdir opencv/build cmake ..

ccmake .

Hit ‘t’ to toggle advanced mode. Set CMAKE_CXX_COMPILER=”/usr/bin/g++-4.0″ and CMAKE_C_COMPILER=”/usr/bin/gcc-4.0″. I also need to turn off FFMPEG and LIBDB1394, because I could not get them to install properly yet on Snow Leopard. Turn on the BUILD_EXAMPLE. Hit ‘c’ to configure and then ‘g’ to generate the config files and exit ccmake. make -j8 su make install To build the example, I need to change the opencv/sample/c/build_all.sh to the following: (change gcc to gcc-4.0 and g++ to g++-4.0, and also add “-arch i386″)

gcc-4.0 -arch i386 -ggdb `pkg-config opencv –cflags –libs` $base.c -o $base
g++-4.0 -arch i386 -ggdb `pkg-config –cflags opencv` -o `basename $i .cpp` $i `pkg-config –libs opencv`;

To build the c sample, just type:

./build_all.sh

Next step for me would be to build the universal library for OpenCV from Snow Leopard.

If you would like to use OpenCV with Java on Linux, check out this Walk into the Future article.

http://www.flex.shallwelearn.com/blog/archives/1902

:

Emacs xcode-compile

OSX 2010. 6. 1. 17:31

이번에는 Emacs에서 Xcode project를 build하는 것이다.

다음의 emacs lisp 코드를 .emacs 파일안에 넣어놓으면 M-x xcode-compile이 나 F10키로 바로 컴파일이 가능하다.

  1. (defvar xcode-compile-sdks nil)  
  2. (defvar xcode-compile-sdk-history nil)  
  3.   
  4. (dolist (line  
  5.          (split-string  
  6.           (with-temp-buffer  
  7.             (call-process "xcodebuild" nil t nil "-showsdks")  
  8.             (buffer-string))  
  9.           "\n" t)  
  10.          )  
  11.   (let ((comps (split-string line "-sdk " t)))  
  12.     (if (> (length comps) 1)  
  13.         (add-to-list 'xcode-compile-sdks (car (last comps)))  
  14.       )  
  15.     )  
  16.   )  
  17.   
  18. (defun xcode-compile ()  
  19.   (interactive)  
  20.   (let ((command "xcodebuild -activeconfiguration -activetarget"))  
  21.     (setq command  
  22.           (concat  
  23.            command  
  24.            (if xcode-compile-sdks  
  25.                (let ((default-sdk (or (car xcode-compile-sdk-history) (car xcode-compile-sdks))))  
  26.                  (concat  
  27.                   " -sdk "  
  28.                   (completing-read  
  29.                    (format "Compile with sdk (default %s): " default-sdk)  
  30.                    xcode-compile-sdks  
  31.                    nil  
  32.                    t  
  33.                    nil  
  34.                    'xcode-compile-sdk-history  
  35.                    default-sdk  
  36.                    )  
  37.                   )  
  38.                  )  
  39.              )  
  40.            (let ((dir ".") (files nil))  
  41.              (while  
  42.                  (progn  
  43.                    (setq files (directory-files dir nil "\\.xcodeproj\\'"))  
  44.                    (and (not (string-equal "/" (expand-file-name dir))) (null files))  
  45.                    )  
  46.                (setq dir (concat (file-name-as-directory dir) ".."))  
  47.                )  
  48.              (unless (null files) (concat " -project " (file-name-as-directory dir) (car files)))  
  49.              )  
  50.            )  
  51.           )  
  52.     (compile (read-string "Compile command: " (concat command " ")))  
  53.     )  
  54.   )  
  55.   
  56. (define-key global-map [f10] 'xcode-compile)

http://han9kin.doesntexist.com/29#recentTrackback

: