This repository has been archived by the owner on Aug 31, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
cc80e91
commit cc1b98c
Showing
71 changed files
with
10,355 additions
and
0 deletions.
There are no files selected for viewing
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
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
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> |
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
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 |
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
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 |
Oops, something went wrong.