Created
March 1, 2011 13:52
-
-
Save victusfate/849150 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # controller.rb | |
| # KeyBinder | |
| # | |
| # Created by messel on 2/14/11. | |
| # Copyright 2011 Victus Media. All rights reserved. | |
| class Controller < NSWindowController | |
| attr_writer :button | |
| attr_accessor :keyBindings | |
| # def initWithFrame(frame) | |
| # super(frame) | |
| def init | |
| @keyBindings = '{ | |
| /* home default */ | |
| "$\UF729" = "moveToBeginningOfLineAndModifySelection:"; | |
| /* end */ | |
| "\UF72B" = "moveToEndOfLine:"; | |
| "$\UF72B" = "moveToEndOfLineAndModifySelection:"; | |
| /* page up/down */ | |
| "\UF72C" = "pageUp:"; | |
| "\UF72D" = "pageDown:"; | |
| }' | |
| return self | |
| end | |
| def setKeyBinding(sender) | |
| puts "Bacon!" | |
| # dest = '~/Library/KeyBindings' | |
| dest = '/Users/messel/Desktop/KeyBindings' | |
| file = '/DefaultKeyBinding.dict' | |
| Dir.mkdir(dest) unless File.directory? dest | |
| fdest = "#{dest}#{file}" | |
| puts fdest | |
| puts "" | |
| puts "keyBindings contents #{@keyBindings}" | |
| # out = File.new(fdest,'w+') | |
| # out << @keyBindings | |
| # out.close | |
| end | |
| def takeStringFrom(sender) | |
| @keyBindings = sender.stringValue | |
| puts "takeStringFrom textfield keyBindings: #{@keyBindings}" | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment