• Stars
    star
    104
  • Rank 330,604 (Top 7 %)
  • Language
    Objective-C
  • License
    BSD 2-Clause "Sim...
  • Created about 10 years ago
  • Updated about 10 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

ACKeyboard is a keyboard extension for iOS that mimics the system keyboard, except it has only one 'letter' key: "yo".

ACKeyboard

ACKeyboard is a keyboard extension for iOS that mimics the system keyboard, except it has only one 'letter' key: "yo".

Build Status

screenshots

Description

The project contains two targets:

  • the keyboard extension
  • an application to test the keyboard with different settings

The keyboard has the following features:

  • iPhone and iPad layout
  • portrait and landscape support
  • light and dark appearances
  • capitalization
  • repeat delete
  • end of line punctuation
  • auto-enable return key

The keys have the following features:

  • drawn with core graphics
  • light, dark, blue (for enter key) styles
  • regular and lock (shift) keys
  • different per-device color sets

See my post about ACKeyboard for more details.

Screenshots

iPhone portrait:

screenshots

iPhone landscape:

screenshots

iPad portrait:

screenshots

Demo

Run the demo application in the iOS simulator to try it out.

To enable the keyboard, open the Settings app and go to:

General > Keyboard > Keyboards > Add New Keyboard... > ACKeyboard

Extending and making your own keyboard

Keys

To make a key with a title:

ACKey *key = [ACKey keyWithStyle:ACKeyStyleLight
                      appearance:ACKeyAppearanceLight
                           title:@"A"];

or to make a key with a picture:

ACKey *key = [ACKey keyWithStyle:ACKeyStyleLight
                      appearance:ACKeyAppearanceLight
                           image:[UIImage imageNamed:@"global_portrait"]];

being a UIControl subclass, a target-action can be associated to the key for an event:

  [key addTarget:self
          action:@selector(keyTapped:)
forControlEvents:UIControlEventTouchUpInside];

and the key can be added as a subview:

key.frame = phoneKeyboardMetrics.frame;
[self.view addSubview:key];

The ACLockKey is a special key that can be locked, like the "shift" key. An image for the lock state can be specified:

lockKey.lockImage = [[UIImage imageNamed:@"shift_lock_portrait"] imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate];

and it can be locked with, for instance a double tap:

...
    [lockKey addTarget:self action:@selector(shiftButtonTapped:)
      forControlEvents:UIControlEventTouchDown];
    [lockKey addTarget:self action:@selector(shiftButtonDoubleTapped:)
      forControlEvents:UIControlEventTouchDownRepeat];
...

- (void)shiftButtonDoubleTapped:(ACLockKey*)lockKey {
    lockKey.locked = ! lockKey.isLocked;
}

Metrics

iPhone and iPad keys layout are defined in PhoneKeyboardMetrics.h and PadKeyboardMetrics.h. All the calculation is done manually, without autolayout, to prevent some occasional jerkiness.

The dimensions are calculated by doing linear interpolation:

    CGFloat letterKeyWidth = LINEAR_EQ(keyboardWidth,
                                   kPhoneKeyboardPortraitWidth, 26.0,
                                   kPhoneKeyboardLandscapeWidth, 52.0);

where, here, 26.0 and 52.0 are measured key width for portrait and landscape.

Appearance

The keyboard implements a light and dark appearance (ACLightAppearance and ACDarkAppearance).

The color sets can vary with the device type. The device can be checked with the UIDevice+Hardware category:

if ([[[UIDevice currentDevice] machine] hasPrefix:@"iPhone4,1"]) {
    blueKeyColor = [UIColor colorWithRed:9/255.0
                                   green:126/255.0
                                    blue:254/255.0
                                   alpha:1.0];
    
}

Documentation

If you have appledoc installed, you can generate the documentation by running the corresponding target.

More Repositories

1

SimulatorRemoteNotifications

Library to send mock remote notifications to the iOS simulator
Objective-C
1,373
star
2

Parallax

Parallax is an iOS library that reproduces the parallax effect of the iOS7 home screen.
Objective-C
407
star
3

ACReuseQueue

A queue to keep and reusing objects.
Objective-C
369
star
4

ACCodeSnippetRepositoryPlugin

A plugin for Xcode to synchronize code snippets with repositories
Objective-C
330
star
5

iOS-MagnifyingGlass

A magnifying glass for iOS
Objective-C
314
star
6

Populate

Populate is both an iOS app and library to easily create random-generated contacts.
Objective-C
120
star
7

instagram-filters

Instagram-like image filters
Python
116
star
8

flask-autodoc

Flask autodoc automatically creates an online documentation for your flask application.
Python
98
star
9

Segway

Segway is an iOS library for segues but without storyboards.
Objective-C
65
star
10

WebScraper

iOS library for web scraping
Objective-C
37
star
11

ACHalloween

A library with halloween-themed animations for iOS.
Objective-C
21
star
12

xcode-snippets

A set of custom code snippets for Xcode
Objective-C
20
star
13

iOS-Konami-Code

Objective-C
11
star
14

kanjinetworks

kanjinetworks is an interface for the Kanji Networks database.
Python
5
star
15

Spyglass

Events tracking analytics for iOS
Objective-C
4
star
16

NetBrowser

Proof-of-concept: Bonjour services browser
Objective-C
4
star
17

WidgetStoreProduct

Proof of concept: A SKStoreProductViewController replacement using iTunes web widgets
Objective-C
4
star
18

Delirium

Objective-C
4
star
19

Tumblr-backup

Make a local backup of your Tumblr blogs
Shell
3
star
20

esp8266_ddc

C++
3
star
21

gittime

Estimate time spend coding based on commits in a git repository.
Python
2
star
22

Hourglass

iOS library for testing if a time interval is elapsed
Objective-C
2
star
23

lldb_screengraph

LLDB script for creating (dot/graphviz) graphs of iOS screens based on breakpoints.
Python
2
star
24

maskcomp

Maskcomp is a library utility to compare two images, like iPhone screenshots, optionally with a mask.
Python
2
star
25

MultipleStoresTests

Testing multiple persistence store; one in the main bundle and one in the documents directory
Objective-C
1
star
26

IGInterfaceDataTable

Easily build WatchKit tables with complex data structures.
Objective-C
1
star
27

cpp_project_template

CMake
1
star
28

Janus

Proof of concept for building a "multiversal" (x86+arm) fat binary
Objective-C
1
star
29

jquery.formable

JavaScript
1
star
30

tourofcpp

Quick self-practice of C++11 based on the "A Tour of C++" book.
C++
1
star
31

pkunk.com

JavaScript
1
star
32

AsyncTestKit

iOS library for testing asynchronous operations
Objective-C
1
star
33

clang-tutorial

C++
1
star
34

sample-images

Sample images for various uses, resized to iphone and ipad screen sizes.
1
star
35

tome

HTML
1
star
36

WebViewsTests

Test web views performance with sunspider
JavaScript
1
star
37

MessagingTests

Proof of concept: Messing with Objective-C runtime's messages routing
Objective-C
1
star
38

SimulatorPushNotifications

Moved to https://github.com/acoomans/SimulatorRemoteNotifications
1
star