Skip to content
This repository has been archived by the owner on Aug 31, 2018. It is now read-only.

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
guilhermearaujo committed Mar 29, 2014
1 parent cc80e91 commit cc1b98c
Show file tree
Hide file tree
Showing 71 changed files with 10,355 additions and 0 deletions.
126 changes: 126 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,129 @@
#########################
# .gitignore file for Xcode5
#
# NB: if you are storing "built" products, this WILL NOT WORK,
# and you should use a different .gitignore (or none at all)
# This file is for SOURCE projects, where there are many extra
# files that we want to exclude
#
# For updates, see: http://stackoverflow.com/questions/49478/git-ignore-file-for-xcode-projects
# and https://gist.github.com/adamgit/3786883
#########################

#####
# OS X temporary files that should never be committed

.DS_Store
*.swp
*.lock
profile


####
# Xcode temporary files that should never be committed
#
# NB: NIB/XIB files still exist even on Storyboard projects, so we want this...

*~.nib


####
# Xcode build files -
#
# NB: slash on the end, so we only remove the FOLDER, not any files that were badly named "DerivedData"

DerivedData/

# NB: slash on the end, so we only remove the FOLDER, not any files that were badly named "build"

build/


#####
# Xcode private settings (window sizes, bookmarks, breakpoints, custom executables, smart groups)
#
# This is complicated:
#
# SOMETIMES you need to put this file in version control.
# Apple designed it poorly - if you use "custom executables", they are
# saved in this file.
# 99% of projects do NOT use those, so they do NOT want to version control this file.
# ..but if you're in the 1%, comment out the line "*.pbxuser"

*.pbxuser
*.mode1v3
*.mode2v3
*.perspectivev3
# NB: also, whitelist the default ones, some projects need to use these
!default.pbxuser
!default.mode1v3
!default.mode2v3
!default.perspectivev3


####
# Xcode 4 - semi-personal settings, often included in workspaces
#
# You can safely ignore the xcuserdata files - but do NOT ignore the files next to them
#

xcuserdata

####
# XCode 4 workspaces - more detailed
#
# Workspaces are important! They are a core feature of Xcode - don't exclude them :)
#
# Workspace layout is quite spammy. For reference:
#
# (root)/
# (project-name).xcodeproj/
# project.pbxproj
# project.xcworkspace/
# contents.xcworkspacedata
# xcuserdata/
# (your name)/xcuserdatad/
# xcuserdata/
# (your name)/xcuserdatad/
#
#
#
# Xcode 4 workspaces - SHARED
#
# This is UNDOCUMENTED (google: "developer.apple.com xcshareddata" - 0 results
# But if you're going to kill personal workspaces, at least keep the shared ones...
#
#
!xcshareddata

####
# XCode 4 build-schemes
#
# PRIVATE ones are stored inside xcuserdata
!xcschemes

####
# Xcode 4 - Deprecated classes
#
# Allegedly, if you manually "deprecate" your classes, they get moved here.
#
# We're using source-control, so this is a "feature" that we do not want!

*.moved-aside

####
# Xcode 5 - Source Control files
#
# Xcode 5 introduced a new file type .xccheckout. This files contains VCS metadata
# and should therefore not be checked into the VCS.

*.xccheckout

####
# UNKNOWN: recommended by others, but I can't discover what these files are
#
# ...none. Everything is now explained.:

# CocoaPods
#
# We recommend against adding the Pods directory to your .gitignore. However
Expand Down
28 changes: 28 additions & 0 deletions VHID/Info.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?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>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleIconFile</key>
<string></string>
<key>CFBundleIdentifier</key>
<string>com.alxn1.${PRODUCT_NAME:rfc1034Identifier}</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>${PRODUCT_NAME}</string>
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>NSPrincipalClass</key>
<string></string>
</dict>
</plist>
21 changes: 21 additions & 0 deletions VHID/MainController.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
//
// MainController.h
// VHID
//
// Created by alxn1 on 24.07.12.
// Copyright 2012 alxn1. All rights reserved.
//

#import "TestView.h"

#import <WirtualJoy/WJoyDevice.h>
#import <VHID/VHIDDevice.h>

@interface MainController : NSObject<VHIDDeviceDelegate, TestViewDelegate>
{
@private
VHIDDevice *m_MouseState;
WJoyDevice *m_VirtualMouse;
}

@end
73 changes: 73 additions & 0 deletions VHID/MainController.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
//
// MainController.m
// VHID
//
// Created by alxn1 on 24.07.12.
// Copyright 2012 alxn1. All rights reserved.
//

#import "MainController.h"

@implementation MainController

- (id)init
{
self = [super init];
if(self == nil)
return nil;

m_MouseState = [[VHIDDevice alloc] initWithType:VHIDDeviceTypeMouse
pointerCount:6
buttonCount:2
isRelative:YES];

NSLog(@"%@", m_MouseState);
m_VirtualMouse = [[WJoyDevice alloc] initWithHIDDescriptor:[m_MouseState descriptor]
productString:@"Virtual Alxn1 Mouse"];

[m_MouseState setDelegate:self];
if(m_VirtualMouse == nil || m_MouseState == nil)
NSLog(@"error");

return self;
}

- (void)dealloc
{
[m_MouseState release];
[m_VirtualMouse release];
[super dealloc];
}

- (void)VHIDDevice:(VHIDDevice*)device stateChanged:(NSData*)state
{
[m_VirtualMouse updateHIDState:state];
}

- (void)testView:(TestView*)view keyPressed:(TestViewKey)key
{
NSPoint newPosition = NSZeroPoint;

switch(key)
{
case TestViewKeyUp:
newPosition.y += 0.025f;
break;

case TestViewKeyDown:
newPosition.y -= 0.025f;
break;

case TestViewKeyLeft:
newPosition.x -= 0.025f;
break;

case TestViewKeyRight:
newPosition.x += 0.025f;
break;
}

[m_MouseState setPointer:0 position:newPosition];
}

@end
Loading

0 comments on commit cc1b98c

Please sign in to comment.