OSDN Git Service

initial
authorTakeshi Aida <aida@shizentai-factory.com>
Tue, 17 Dec 2013 19:10:58 +0000 (04:10 +0900)
committerTakeshi Aida <aida@shizentai-factory.com>
Tue, 17 Dec 2013 19:10:58 +0000 (04:10 +0900)
LICENSE [new file with mode: 0644]
README.md [new file with mode: 0644]
hidsetter.sln [new file with mode: 0644]
hidsetter/hidsetter.cpp [new file with mode: 0644]
hidsetter/hidsetter.vcxproj [new file with mode: 0644]
hidsetter/hidsetter.vcxproj.filters [new file with mode: 0644]
hidsetter/revive_key.ini [new file with mode: 0644]
hidsetter/stdafx.cpp [new file with mode: 0644]
hidsetter/stdafx.h [new file with mode: 0644]
hidsetter/targetver.h [new file with mode: 0644]

diff --git a/LICENSE b/LICENSE
new file mode 100644 (file)
index 0000000..329624c
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,20 @@
+The MIT License (MIT)
+
+Copyright (c) 2013 Takeshi Aida
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to
+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+the Software, and to permit persons to whom the Software is furnished to do so,
+subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/README.md b/README.md
new file mode 100644 (file)
index 0000000..b60933c
--- /dev/null
+++ b/README.md
@@ -0,0 +1,187 @@
+rvuset
+======
+
+REVIVE USB keycode setter
+
+使用法
+
+```
+rvuset <ini file>
+```
+
+usageコード表
+```
+       00      Reserved (no event indicated)
+       01      Keyboard ErrorRollOver
+       02      Keyboard POSTFail
+       03      Keyboard ErrorUndefined
+       04      Keyboard a and A
+       05      Keyboard b and B
+       06      Keyboard c and C
+       07      Keyboard d and D
+       08      Keyboard e and E
+       09      Keyboard f and F
+       0A      Keyboard g and G
+       0B      Keyboard h and H
+       0C      Keyboard i and I
+       0D      Keyboard j and J
+       0E      Keyboard k and K
+       0F      Keyboard l and L
+       10      Keyboard m and M
+       11      Keyboard n and N
+       12      Keyboard o and O
+       13      Keyboard p and P
+       14      Keyboard q and Q
+       15      Keyboard r and R
+       16      Keyboard s and S
+       17      Keyboard t and T
+       18      Keyboard u and U
+       19      Keyboard v and V
+       1A      Keyboard w and W
+       1B      Keyboard x and X
+       1C      Keyboard y and Y
+       1D      Keyboard z and Z
+       1E      Keyboard 1 and !
+       1F      Keyboard 2 and @
+       20      Keyboard 3 and #
+       21      Keyboard 4 and $
+       22      Keyboard 5 and %
+       23      Keyboard 6 and ^
+       24      Keyboard 7 and &
+       25      Keyboard 8 and *
+       26      Keyboard 9 and (
+       27      Keyboard 0 and )
+       28      Keyboard Return (ENTER)
+       29      Keyboard ESCAPE
+       2A      Keyboard DELETE (Backspace)
+       2B      Keyboard Tab
+       2C      Keyboard Spacebar
+       2D      Keyboard - and (underscore)
+       2E      Keyboard = and +
+       2F      Keyboard [ and {
+       30      Keyboard ] and }
+       31      Keyboard \ and |
+       32      Keyboard Non-US # and ~
+       33      Keyboard ; and :
+       34      Keyboard ' and "
+       35      Keyboard Grave Accent and Tilde
+       36      Keyboard, and <
+       37      Keyboard . and >
+       38      Keyboard / and ?
+       39      Keyboard Caps Lock
+       3A      Keyboard F1
+       3B      Keyboard F2
+       3C      Keyboard F3
+       3D      Keyboard F4
+       3E      Keyboard F5
+       3F      Keyboard F6
+       40      Keyboard F7
+       41      Keyboard F8
+       42      Keyboard F9
+       43      Keyboard F10
+       44      Keyboard F11
+       45      Keyboard F12
+       46      Keyboard PrintScreen
+       47      Keyboard Scroll Lock
+       48      Keyboard Pause
+       49      Keyboard Insert
+       4A      Keyboard Home
+       4B      Keyboard PageUp
+       4C      Keyboard Delete Forward
+       4D      Keyboard End
+       4E      Keyboard PageDown
+       4F      Keyboard RightArrow
+       50      Keyboard LeftArrow
+       51      Keyboard DownArrow
+       52      Keyboard UpArrow
+       53      Keypad Num Lock and Clear
+       54      Keypad /
+       55      Keypad *
+       56      Keypad -
+       57      Keypad +
+       58      Keypad ENTER
+       59      Keypad 1 and End
+       5A      Keypad 2 and Down Arrow
+       5B      Keypad 3 and PageDn
+       5C      Keypad 4 and Left Arrow
+       5D      Keypad 5
+       5E      Keypad 6 and Right Arrow
+       5F      Keypad 7 and Home
+       60      Keypad 8 and Up Arrow
+       61      Keypad 9 and PageUp
+       62      Keypad 0 and Insert
+       63      Keypad . and Delete
+       64      Keyboard Non-US \ and |
+       65      Keyboard Application
+       66      Keyboard Power
+       67      Keypad =
+       68      Keyboard F13
+       69      Keyboard F14
+       6A      Keyboard F15
+       6B      Keyboard F16
+       6C      Keyboard F17
+       6D      Keyboard F18
+       6E      Keyboard F19
+       6F      Keyboard F20
+       70      Keyboard F21
+       71      Keyboard F22
+       72      Keyboard F23
+       73      Keyboard F24
+       74      Keyboard Execute
+       75      Keyboard Help
+       76      Keyboard Menu
+       77      Keyboard Select
+       78      Keyboard Stop
+       79      Keyboard Again
+       7A      Keyboard Undo
+       7B      Keyboard Cut
+       7C      Keyboard Copy
+       7D      Keyboard Paste
+       7E      Keyboard Find
+       7F      Keyboard Mute
+       80      Keyboard Volume Up
+       81      Keyboard Volume Down
+       82      Keyboard Locking Caps Lock
+       83      Keyboard Locking Num Lock
+       84      Keyboard Locking Scroll Lock
+       85      Keypad Comma
+       86      Keypad Equal Sign
+       87      Keyboard International1
+       88      Keyboard International2
+       89      Keyboard International3
+       8A      Keyboard International4
+       8B      Keyboard International5
+       8C      Keyboard International6
+       8D      Keyboard International7
+       8E      Keyboard International8
+       8F      Keyboard International9
+       90      Keyboard LANG1
+       91      Keyboard LANG2
+       92      Keyboard LANG3
+       93      Keyboard LANG4
+       94      Keyboard LANG5
+       95      Keyboard LANG6
+       96      Keyboard LANG7
+       97      Keyboard LANG8
+       98      Keyboard LANG9
+       99      Keyboard Alternate Erase
+       9A      Keyboard SysReq/Attention
+       9B      Keyboard Cancel
+       9C      Keyboard Clear
+       9D      Keyboard Prior
+       9E      Keyboard Return
+       9F      Keyboard Separator
+       A0      Keyboard Out
+       A1      Keyboard Oper
+       A2      Keyboard Clear/Again
+       A3      Keyboard CrSel/Props
+       A4      Keyboard ExSel
+       E0      Keyboard LeftControl
+       E1      Keyboard LeftShift
+       E2      Keyboard LeftAlt
+       E3      Keyboard Left GUI
+       E4      Keyboard RightControl
+       E5      Keyboard RightShift
+       E6      Keyboard RightAlt
+       E7      Keyboard Right GUI
+```
diff --git a/hidsetter.sln b/hidsetter.sln
new file mode 100644 (file)
index 0000000..d8d938e
--- /dev/null
@@ -0,0 +1,20 @@
+
+Microsoft Visual Studio Solution File, Format Version 11.00
+# Visual Studio 2010
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "hidsetter", "hidsetter\hidsetter.vcxproj", "{8384D35D-02EB-481E-AD16-5131026EB409}"
+EndProject
+Global
+       GlobalSection(SolutionConfigurationPlatforms) = preSolution
+               Debug|Win32 = Debug|Win32
+               Release|Win32 = Release|Win32
+       EndGlobalSection
+       GlobalSection(ProjectConfigurationPlatforms) = postSolution
+               {8384D35D-02EB-481E-AD16-5131026EB409}.Debug|Win32.ActiveCfg = Debug|Win32
+               {8384D35D-02EB-481E-AD16-5131026EB409}.Debug|Win32.Build.0 = Debug|Win32
+               {8384D35D-02EB-481E-AD16-5131026EB409}.Release|Win32.ActiveCfg = Release|Win32
+               {8384D35D-02EB-481E-AD16-5131026EB409}.Release|Win32.Build.0 = Release|Win32
+       EndGlobalSection
+       GlobalSection(SolutionProperties) = preSolution
+               HideSolutionNode = FALSE
+       EndGlobalSection
+EndGlobal
diff --git a/hidsetter/hidsetter.cpp b/hidsetter/hidsetter.cpp
new file mode 100644 (file)
index 0000000..d0f3dad
--- /dev/null
@@ -0,0 +1,202 @@
+//
+// (C)2013 Shizentai Factory Co.
+//  All rights reserved.
+//
+
+#include "stdafx.h"
+#include <iostream>
+
+#include <windows.h>
+extern "C" {
+#include <hidsdi.h>
+#include <hidpi.h>
+}
+#include <setupapi.h>
+
+#pragma comment( lib, "hid.lib" )
+#pragma comment( lib, "setupapi.lib" )
+
+using namespace std;
+
+#define VENDER_ID              0x22ea
+#define PRODUCT_ID     0x0006
+#define DEVICE_USAGE   0xff0001
+#define INPUT_SIZE     65
+#define OUTPUT_SIZE    65
+#define N_PIN                          12
+enum EEPROM
+{
+       EPR_MODE = 0,
+       EPR_VALUE = 1,
+       EPR_MODIFIER = 2
+};
+
+
+HANDLE openHidCtrlDevice()
+{
+       GUID guidHid;
+
+       HidD_GetHidGuid( &guidHid );
+       HDEVINFO hDevList = SetupDiGetClassDevs( &guidHid, NULL, NULL, DIGCF_PRESENT|DIGCF_DEVICEINTERFACE );
+       if ( !hDevList )
+       {
+               cerr << "no HIDs" << endl;
+               return NULL;
+       }
+
+       HANDLE rc = INVALID_HANDLE_VALUE;
+       for ( DWORD dwIndex = 0;  rc == INVALID_HANDLE_VALUE;  dwIndex++ )
+       {
+               SP_DEVICE_INTERFACE_DATA  devInfoData;
+               ZeroMemory( &devInfoData, sizeof(devInfoData) );
+               devInfoData.cbSize = sizeof(devInfoData);
+               if ( !SetupDiEnumDeviceInterfaces( hDevList, NULL, &guidHid, dwIndex, &devInfoData ) )
+                       break;
+               DWORD dwLength = 0;
+               SetupDiGetDeviceInterfaceDetail( hDevList, &devInfoData, NULL, 0, &dwLength, NULL );
+               PSP_DEVICE_INTERFACE_DETAIL_DATA pDevDetail = (PSP_DEVICE_INTERFACE_DETAIL_DATA)HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, dwLength );
+               pDevDetail->cbSize = sizeof(SP_DEVICE_INTERFACE_DETAIL_DATA);
+               DWORD dwRequired = 0;
+               while ( SetupDiGetDeviceInterfaceDetail( hDevList, &devInfoData, pDevDetail, dwLength, &dwRequired, NULL ) )
+               {
+                       //wcout << pDevDetail->DevicePath << endl;
+
+                       HANDLE hDev = CreateFile( pDevDetail->DevicePath, GENERIC_READ|GENERIC_WRITE, 0, NULL, OPEN_EXISTING, NULL, NULL );
+                       if ( hDev == INVALID_HANDLE_VALUE )
+                               break;
+                       while ( 1 )
+                       {
+                               HIDD_ATTRIBUTES attr;
+                               if ( !HidD_GetAttributes( hDev, &attr ) )
+                                       break;
+                               if ( attr.VendorID != VENDER_ID  ||  attr.ProductID != PRODUCT_ID )
+                                       break;
+
+                               PHIDP_PREPARSED_DATA pPreparsed;
+                               if ( !HidD_GetPreparsedData( hDev, &pPreparsed ) )
+                                       break;
+                               HIDP_CAPS caps;
+                               if ( HidP_GetCaps( pPreparsed, &caps ) != HIDP_STATUS_SUCCESS )
+                                       break;
+                               if ( ((caps.UsagePage<<8) | caps.Usage) != DEVICE_USAGE )
+                                       break;
+
+                               // HID\90§\8cä\83f\83o\83C\83\83I\81[\83v\83\93\90¬\8c÷
+                               rc = hDev;
+
+                               break;
+                       }
+
+                       if ( rc == INVALID_HANDLE_VALUE )
+                               CloseHandle( hDev );
+                       break;
+               }
+               HeapFree( GetProcessHeap(), 0, pDevDetail );
+       }
+       SetupDiDestroyDeviceInfoList( hDevList );
+
+       return rc;
+}
+
+bool isValidDevice( HANDLE hDev )
+{
+       BYTE bufOUT[ OUTPUT_SIZE ];
+       ZeroMemory( bufOUT, sizeof(bufOUT) );
+       bufOUT[ 1 ] = 0x56;
+
+       DWORD dwProcessed = 0;
+       if ( WriteFile( hDev, bufOUT, OUTPUT_SIZE, &dwProcessed, NULL ) )
+       {
+               BYTE bufIN[ INPUT_SIZE ];
+               ZeroMemory( bufIN, sizeof(bufIN) );
+               dwProcessed = 0;
+               if ( ReadFile( hDev, bufIN, INPUT_SIZE, &dwProcessed, NULL ) )
+               {
+                       if ( bufIN[ 1 ] == 'V'  &&  bufIN[ 2 ] == '0' )
+                               return true;
+               }
+       }
+       return false;
+}
+
+bool loadIniFile( BYTE pImg[ OUTPUT_SIZE ], LPCTSTR pFilename )
+{
+       ZeroMemory( pImg, OUTPUT_SIZE );
+       pImg[ 1 ] = 0x80;
+
+       TCHAR szApp[ 8 ];
+       TCHAR szValue[ 3 ];
+       TCHAR szMod[ 3 ];
+       for ( int pin=0; pin<N_PIN; pin++ )
+       {
+               BYTE* cur = &pImg[ pin*3+2 ];
+               wsprintf( szApp, _T("PIN%d"), pin+1 );
+               int mode = (int)GetPrivateProfileInt( szApp, _T("MODE"), -1, pFilename );
+               cur[ 0 ] = mode;
+               if ( mode < 0 )
+                       continue;
+               GetPrivateProfileString( szApp, _T("VALUE"), _T(""), szValue, ARRAYSIZE(szValue), pFilename );
+               GetPrivateProfileString( szApp, _T("MODIFIER"), _T(""), szMod, ARRAYSIZE(szMod), pFilename );
+               TCHAR* p;
+               errno = 0;
+               cur[ 1 ] = (BYTE)_tcstol( szValue, &p, 16 );
+               if ( errno != 0 )
+                       return false;
+               cur[ 2 ] = (BYTE)_tcstol( szMod, &p, 16 );
+               if ( errno != 0 )
+                       return false;
+       }
+       return true;
+}
+
+int _tmain(int argc, _TCHAR* argv[])
+{
+       if ( argc < 2 )
+       {
+               cerr << "REVIVE USB keycode setter  (C)2013 Shizentai Factory Co." << endl;
+               cerr << "Usage: rvuset <ini file>" << endl;
+               return 0;
+       }
+       DWORD dwLength = GetFullPathName( argv[ 1 ], 0, NULL, NULL );
+       if ( dwLength == 0 )
+       {
+               cerr << "cannot read specified file" << endl;
+               return -1;
+       }
+       TCHAR* pFilename = new TCHAR[ dwLength ];
+       GetFullPathName( argv[ 1 ], dwLength, pFilename, NULL );
+       BYTE imgROM[ OUTPUT_SIZE ];
+       bool isLoaded = loadIniFile( imgROM, pFilename );
+       delete[] pFilename;
+       if ( !isLoaded )
+       {
+               cerr << "load error" << endl;
+               return -2;
+       }
+
+       HANDLE hDev = openHidCtrlDevice();
+       if ( hDev == INVALID_HANDLE_VALUE )
+       {
+               cerr << "no connected device" << endl;
+               return -3;
+       }
+
+       int rc = 0;
+       if ( isValidDevice( hDev ) )
+       {
+               DWORD dwProcessed = 0;
+               if ( !WriteFile( hDev, imgROM, OUTPUT_SIZE, &dwProcessed, NULL ) )
+               {
+                       cerr << "cannot write to device" << endl;
+                       rc = -4;
+               }
+       }
+       else
+       {
+               cerr << "invalid version" << endl;
+               rc = -5;
+       }
+       CloseHandle( hDev );
+
+       return rc;
+}
diff --git a/hidsetter/hidsetter.vcxproj b/hidsetter/hidsetter.vcxproj
new file mode 100644 (file)
index 0000000..27a31b3
--- /dev/null
@@ -0,0 +1,91 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <ItemGroup Label="ProjectConfigurations">
+    <ProjectConfiguration Include="Debug|Win32">
+      <Configuration>Debug</Configuration>
+      <Platform>Win32</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Release|Win32">
+      <Configuration>Release</Configuration>
+      <Platform>Win32</Platform>
+    </ProjectConfiguration>
+  </ItemGroup>
+  <PropertyGroup Label="Globals">
+    <ProjectGuid>{8384D35D-02EB-481E-AD16-5131026EB409}</ProjectGuid>
+    <Keyword>Win32Proj</Keyword>
+    <RootNamespace>hidsetter</RootNamespace>
+  </PropertyGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+    <ConfigurationType>Application</ConfigurationType>
+    <UseDebugLibraries>true</UseDebugLibraries>
+    <CharacterSet>Unicode</CharacterSet>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+    <ConfigurationType>Application</ConfigurationType>
+    <UseDebugLibraries>false</UseDebugLibraries>
+    <WholeProgramOptimization>true</WholeProgramOptimization>
+    <CharacterSet>Unicode</CharacterSet>
+  </PropertyGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+  <ImportGroup Label="ExtensionSettings">
+  </ImportGroup>
+  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+  <PropertyGroup Label="UserMacros" />
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+    <LinkIncremental>true</LinkIncremental>
+    <TargetName>rvuset</TargetName>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+    <LinkIncremental>false</LinkIncremental>
+    <TargetName>rvuset</TargetName>
+  </PropertyGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+    <ClCompile>
+      <PrecompiledHeader>Use</PrecompiledHeader>
+      <WarningLevel>Level3</WarningLevel>
+      <Optimization>Disabled</Optimization>
+      <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+    </ClCompile>
+    <Link>
+      <SubSystem>Console</SubSystem>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+    </Link>
+  </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+    <ClCompile>
+      <WarningLevel>Level3</WarningLevel>
+      <PrecompiledHeader>Use</PrecompiledHeader>
+      <Optimization>MaxSpeed</Optimization>
+      <FunctionLevelLinking>true</FunctionLevelLinking>
+      <IntrinsicFunctions>true</IntrinsicFunctions>
+      <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+    </ClCompile>
+    <Link>
+      <SubSystem>Console</SubSystem>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+      <EnableCOMDATFolding>true</EnableCOMDATFolding>
+      <OptimizeReferences>true</OptimizeReferences>
+    </Link>
+  </ItemDefinitionGroup>
+  <ItemGroup>
+    <ClInclude Include="stdafx.h" />
+    <ClInclude Include="targetver.h" />
+  </ItemGroup>
+  <ItemGroup>
+    <ClCompile Include="hidsetter.cpp" />
+    <ClCompile Include="stdafx.cpp">
+      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
+      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>
+    </ClCompile>
+  </ItemGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+  <ImportGroup Label="ExtensionTargets">
+  </ImportGroup>
+</Project>
\ No newline at end of file
diff --git a/hidsetter/hidsetter.vcxproj.filters b/hidsetter/hidsetter.vcxproj.filters
new file mode 100644 (file)
index 0000000..e7a707c
--- /dev/null
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <ItemGroup>
+    <Filter Include="ソース ファイル">
+      <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
+      <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
+    </Filter>
+    <Filter Include="ヘッダー ファイル">
+      <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
+      <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
+    </Filter>
+    <Filter Include="リソース ファイル">
+      <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
+      <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
+    </Filter>
+  </ItemGroup>
+  <ItemGroup>
+    <ClInclude Include="stdafx.h">
+      <Filter>ヘッダー ファイル</Filter>
+    </ClInclude>
+    <ClInclude Include="targetver.h">
+      <Filter>ヘッダー ファイル</Filter>
+    </ClInclude>
+  </ItemGroup>
+  <ItemGroup>
+    <ClCompile Include="stdafx.cpp">
+      <Filter>ソース ファイル</Filter>
+    </ClCompile>
+    <ClCompile Include="hidsetter.cpp">
+      <Filter>ソース ファイル</Filter>
+    </ClCompile>
+  </ItemGroup>
+</Project>
\ No newline at end of file
diff --git a/hidsetter/revive_key.ini b/hidsetter/revive_key.ini
new file mode 100644 (file)
index 0000000..6662921
--- /dev/null
@@ -0,0 +1,93 @@
+;
+; MODE == \96³\8ew\92è
+; \82È\82É\82à\82µ\82È\82¢
+;
+; MODE ==  0 ... mouse
+; VALUE ==  0 ... \8d\83N\83\8a\83b\83N
+;           1 ... \89E\83N\83\8a\83b\83N
+;           2 ... \83z\83C\81[\83\8b\83N\83\8a\83b\83N
+;           3 ... \8fã\88Ú\93®
+;           4 ... \89º\88Ú\93®
+;           5 ... \8d\88Ú\93®
+;           6 ... \89E\88Ú\93®
+;           7 ... \83z\83C\81[\83\8b\8fã
+;           8 ... \83z\83C\81[\83\8b\89º
+;           9 ... \83}\83E\83X\88Ú\93®\91¬\93x\95Ï\8dX
+; MODIFIER == \83X\83e\83b\83v\90\94 -127\81`127
+;
+; MODE ==  1 ... keyboard
+; VALUE ==  \83X\83L\83\83\83\93\83R\81[\83h(usage) 2\8c\8516\90i\95\\8bL
+; MODIFIER == SHIFT,CTRL,ALT,WIN\82Ì\89\9f\89º\8fó\91Ô(8bit) 2\8c\8516\90i\95\\8bL
+;             bit 0 ... LEFT CTRL
+;             bit 1 ... LEFT SHIFT
+;             bit 2 ... LEFT ALT
+;             bit 3 ... LEFT GUI
+;             bit 4 ... RIGHT CTRL
+;             bit 5 ... RIGHT SHIFT
+;             bit 6 ... RIGHT ALT
+;             bit 7 ... RIGHT GUI
+;
+; MODE ==  2 ... joystick
+; reviveUSB\82Ì\83t\83@\81[\83\80\83E\83F\83A\82ª\8aÔ\88á\82Á\82Ä\82é\82Ý\82½\82¢
+; \8eg\82¦\82Ü\82¹\82ñ
+;
+
+[PIN1]
+MODE = 1
+VALUE = 04                     ; "a"
+MODIFIER = 00
+
+[PIN2]
+MODE = 1
+VALUE = 05                     ; "b"
+MODIFIER = 00
+
+[PIN3]
+MODE = 1
+VALUE = 06                     ; "c"
+MODIFIER = 00
+
+[PIN4]
+MODE = 1
+VALUE = 07                     ; "d"
+MODIFIER = 00
+
+[PIN5]
+MODE = 1
+VALUE = 08                     ; "e"
+MODIFIER = 00
+
+[PIN6]
+MODE = 1
+VALUE = 09                     ; "f"
+MODIFIER = 00
+
+[PIN7]
+MODE = 1
+VALUE = 04                     ; "a"
+MODIFIER = 00
+
+[PIN8]
+MODE = 1
+VALUE = 04                     ; "a"
+MODIFIER = 00
+
+[PIN9]
+MODE = 1
+VALUE = 04                     ; "a"
+MODIFIER = 00
+
+[PIN10]
+MODE = 1
+VALUE = 04                     ; "a"
+MODIFIER = 00
+
+[PIN11]
+MODE = 1
+VALUE = 04                     ; "a"
+MODIFIER = 00
+
+[PIN12]
+MODE = 1
+VALUE = 04                     ; "a"
+MODIFIER = 00
diff --git a/hidsetter/stdafx.cpp b/hidsetter/stdafx.cpp
new file mode 100644 (file)
index 0000000..490fa19
--- /dev/null
@@ -0,0 +1,8 @@
+// stdafx.cpp : \95W\8f\80\83C\83\93\83N\83\8b\81[\83h hidsetter.pch \82Ì\82Ý\82ð
+// \8aÜ\82Þ\83\\81[\83\83t\83@\83C\83\8b\82Í\81A\83v\83\8a\83R\83\93\83p\83C\83\8b\8dÏ\82Ý\83w\83b\83_\81[\82É\82È\82è\82Ü\82·\81B
+// stdafx.obj \82É\82Í\83v\83\8a\83R\83\93\83p\83C\83\8b\8dÏ\82Ý\8c^\8fî\95ñ\82ª\8aÜ\82Ü\82ê\82Ü\82·\81B
+
+#include "stdafx.h"
+
+// TODO: \82±\82Ì\83t\83@\83C\83\8b\82Å\82Í\82È\82­\81ASTDAFX.H \82Å\95K\97v\82È
+// \92Ç\89Á\83w\83b\83_\81[\82ð\8eQ\8fÆ\82µ\82Ä\82­\82¾\82³\82¢\81B
diff --git a/hidsetter/stdafx.h b/hidsetter/stdafx.h
new file mode 100644 (file)
index 0000000..93c07ff
--- /dev/null
@@ -0,0 +1,15 @@
+// stdafx.h : \95W\8f\80\82Ì\83V\83X\83e\83\80 \83C\83\93\83N\83\8b\81[\83\83t\83@\83C\83\8b\82Ì\83C\83\93\83N\83\8b\81[\83\83t\83@\83C\83\8b\81A\82Ü\82½\82Í
+// \8eQ\8fÆ\89ñ\90\94\82ª\91½\82­\81A\82©\82Â\82 \82Ü\82è\95Ï\8dX\82³\82ê\82È\82¢\81A\83v\83\8d\83W\83F\83N\83g\90ê\97p\82Ì\83C\83\93\83N\83\8b\81[\83\83t\83@\83C\83\8b
+// \82ð\8bL\8fq\82µ\82Ü\82·\81B
+//
+
+#pragma once
+
+#include "targetver.h"
+
+#include <stdio.h>
+#include <tchar.h>
+
+
+
+// TODO: \83v\83\8d\83O\83\89\83\80\82É\95K\97v\82È\92Ç\89Á\83w\83b\83_\81[\82ð\82±\82±\82Å\8eQ\8fÆ\82µ\82Ä\82­\82¾\82³\82¢\81B
diff --git a/hidsetter/targetver.h b/hidsetter/targetver.h
new file mode 100644 (file)
index 0000000..10b7ccd
--- /dev/null
@@ -0,0 +1,8 @@
+#pragma once
+
+// SDKDDKVer.h \82ð\83C\83\93\83N\83\8b\81[\83h\82·\82é\82Æ\81A\97\98\97p\82Å\82«\82é\8dÅ\82à\8fã\88Ê\82Ì Windows \83v\83\89\83b\83g\83t\83H\81[\83\80\82ª\92è\8b`\82³\82ê\82Ü\82·\81B
+
+// \88È\91O\82Ì Windows \83v\83\89\83b\83g\83t\83H\81[\83\80\97p\82É\83A\83v\83\8a\83P\81[\83V\83\87\83\93\82ð\83r\83\8b\83h\82·\82é\8fê\8d\87\82Í\81AWinSDKVer.h \82ð\83C\83\93\83N\83\8b\81[\83h\82µ\81A
+// SDKDDKVer.h \82ð\83C\83\93\83N\83\8b\81[\83h\82·\82é\91O\82É\81A\83T\83|\81[\83g\91Î\8fÛ\82Æ\82·\82é\83v\83\89\83b\83g\83t\83H\81[\83\80\82ð\8e¦\82·\82æ\82¤\82É _WIN32_WINNT \83}\83N\83\8d\82ð\90Ý\92è\82µ\82Ü\82·\81B
+
+#include <SDKDDKVer.h>