This file contains 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
$ ./testkeys | |
Scancode #0, "" | |
Scancode #1, "" | |
Scancode #2, "" | |
Scancode #3, "" | |
Scancode #4, "A" | |
Scancode #5, "B" | |
Scancode #6, "C" | |
Scancode #7, "D" | |
Scancode #8, "E" |
This file contains 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
diff --git a/SDL/src/video/cocoa/SDL_cocoakeyboard.m b/SDL/src/video/cocoa/SDL_cocoakeyboard.m | |
index e077def..c768443 100644 | |
--- a/SDL/src/video/cocoa/SDL_cocoakeyboard.m | |
+++ b/SDL/src/video/cocoa/SDL_cocoakeyboard.m | |
@@ -28,6 +28,15 @@ | |
#include <Carbon/Carbon.h> | |
+#if MAC_OS_X_VERSION_MAX_ALLOWED <= MAC_OS_X_VERSION_10_4 | |
+#if __LP64__ |
This file contains 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
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>Label</key> | |
<string>org.jjgod.autossh</string> | |
<key>KeepAlive</key> | |
<dict> | |
<key>SuccessfulExit</key> | |
<true/> |
This file contains 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
#include <stdlib.h> | |
#include <string.h> | |
#include <errno.h> | |
#include <iconv.h> | |
char *gb18030_to_utf8(const char *src) | |
{ | |
iconv_t cd; | |
size_t in, out, len, err; | |
char *dest, *outp, *inp = (char *) src; |
This file contains 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
CTFontRef displayFont = CTFontCreateWithName(CFSTR("Andale Mono"), 18.0, NULL); | |
float charWidth = 18.0; | |
CFTypeRef keys[1]; | |
CFTypeRef values[1]; | |
keys[0] = kCTFontFixedAdvanceAttribute; | |
values[0] = CFNumberCreate(nil, kCFNumberFloatType, (void *)&charWidth); | |
CFDictionaryRef fontAttributes = CFDictionaryCreate(NULL, (const void **)keys, (const void **)values, 1, NULL, NULL); |
This file contains 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
#!/usr/bin/python | |
import AddressBook | |
ab = AddressBook.ABAddressBook.sharedAddressBook() | |
for person in ab.people(): | |
person.removeValueForProperty_(AddressBook.kABFirstNamePhoneticProperty) | |
person.removeValueForProperty_(AddressBook.kABLastNamePhoneticProperty) |
This file contains 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
// textorize.m: Objective-C version of textorize | |
#import <Cocoa/Cocoa.h> | |
int main(int argc, char *argv[]) | |
{ | |
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; | |
NSImage *image; | |
NSBitmapImageRep *rep; | |
NSFont *font; |
This file contains 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
#!/usr/bin/env bash | |
LATEST_CHROMIUM=`curl http://build.chromium.org/buildbot/snapshots/chromium-rel-mac/LATEST` | |
curl -O http://build.chromium.org/buildbot/snapshots/chromium-rel-mac/${LATEST_CHROMIUM}/chrome-mac.zip | |
unzip chrome-mac.zip -d /tmp | |
rm -rf /Applications/Chromium.app | |
mv /tmp/chrome-mac/Chromium.app /Applications/ | |
rm chrome-mac.zip | |
rm -rf /tmp/chrome-mac |
This file contains 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
// test.m: test calendar code | |
// Compile with: gcc -Wall -framework Foundation test.m -o test | |
#import <Foundation/Foundation.h> | |
NSString *ChineseYear(int year) | |
{ | |
const char *tiangan[] = { "甲", "乙", "丙", "丁", "戊", "己", "庚", "辛", "壬", "癸" }; | |
const char *dizhi[] = { "子", "丑", "寅", "卯", "辰", "巳", "午", "未", "申", "酉", "戌", "亥" }; | |
char buffer[10]; |
This file contains 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
From 80b1f3402a767aa9cc4f8a32a303b2e99c5f3b20 Mon Sep 17 00:00:00 2001 | |
From: Jjgod Jiang <gzjjgod@gmail.com> | |
Date: Mon, 18 Jan 2010 17:46:35 +0800 | |
Subject: [PATCH] Polish text input handling for Mac OS X | |
- Prevent crash caused by uninitialized video data | |
- Prevent beeping caused by unhandled Cocoa selectors (like moveUp: | |
moveDown:, etc.) | |
--- | |
src/video/SDL_video.c | 6 +++--- |