├── .gitignore ├── MasterVolumeControl ├── COPYRIGHT.txt ├── EndpointVolume.cs ├── Interop.MMDeviceAPI.dll ├── MasterVolumeControl.cs ├── MasterVolumeControlLibrary.csproj ├── Properties │ └── AssemblyInfo.cs └── WaveLibMixer.dll ├── Misuzilla.Applications.AppleWirelessKeyboardHelper.sln ├── Misuzilla.Applications.AppleWirelessKeyboardHelper ├── AppleWirelessKeyboardHelper.ico ├── Enum.cs ├── EventArgs.cs ├── HIDImports.cs ├── Helper.cs ├── IronPython.Modules.dll ├── IronPython.dll ├── LICENSE.txt ├── Microsoft.Scripting.dll ├── Misuzilla.Applications.AppleWirelessKeyboardHelper.csproj ├── Program.cs ├── Properties │ └── AssemblyInfo.cs ├── Readme.html ├── Resources │ ├── AppleWirelessKeyboardHelperTrayIcon.ico │ ├── AppleWirelessKeyboardHelperTrayIcon16x16.ico │ ├── Common.Designer.cs │ ├── Common.resx │ ├── Strings.Designer.cs │ ├── Strings.ja.resx │ └── Strings.resx ├── Scripts │ └── Default.py.sample ├── Util.cs └── Win32.cs ├── MonitorBrightnessControl ├── MonitorBrightnessControl.cs ├── MonitorBrightnessControlLibrary.csproj └── Properties │ └── AssemblyInfo.cs └── Package.proj /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | 4 | # User-specific files 5 | *.suo 6 | *.user 7 | *.userosscache 8 | *.sln.docstates 9 | 10 | # User-specific files (MonoDevelop/Xamarin Studio) 11 | *.userprefs 12 | 13 | # Build results 14 | [Dd]ebug/ 15 | [Dd]ebugPublic/ 16 | [Rr]elease/ 17 | [Rr]eleases/ 18 | x64/ 19 | x86/ 20 | bld/ 21 | [Bb]in/ 22 | [Oo]bj/ 23 | [Ll]og/ 24 | 25 | # Visual Studio 2015 cache/options directory 26 | .vs/ 27 | # Uncomment if you have tasks that create the project's static files in wwwroot 28 | #wwwroot/ 29 | 30 | # MSTest test Results 31 | [Tt]est[Rr]esult*/ 32 | [Bb]uild[Ll]og.* 33 | 34 | # NUNIT 35 | *.VisualState.xml 36 | TestResult.xml 37 | 38 | # Build Results of an ATL Project 39 | [Dd]ebugPS/ 40 | [Rr]eleasePS/ 41 | dlldata.c 42 | 43 | # DNX 44 | project.lock.json 45 | project.fragment.lock.json 46 | artifacts/ 47 | 48 | *_i.c 49 | *_p.c 50 | *_i.h 51 | *.ilk 52 | *.meta 53 | *.obj 54 | *.pch 55 | *.pdb 56 | *.pgc 57 | *.pgd 58 | *.rsp 59 | *.sbr 60 | *.tlb 61 | *.tli 62 | *.tlh 63 | *.tmp 64 | *.tmp_proj 65 | *.log 66 | *.vspscc 67 | *.vssscc 68 | .builds 69 | *.pidb 70 | *.svclog 71 | *.scc 72 | 73 | # Chutzpah Test files 74 | _Chutzpah* 75 | 76 | # Visual C++ cache files 77 | ipch/ 78 | *.aps 79 | *.ncb 80 | *.opendb 81 | *.opensdf 82 | *.sdf 83 | *.cachefile 84 | *.VC.db 85 | *.VC.VC.opendb 86 | 87 | # Visual Studio profiler 88 | *.psess 89 | *.vsp 90 | *.vspx 91 | *.sap 92 | 93 | # TFS 2012 Local Workspace 94 | $tf/ 95 | 96 | # Guidance Automation Toolkit 97 | *.gpState 98 | 99 | # ReSharper is a .NET coding add-in 100 | _ReSharper*/ 101 | *.[Rr]e[Ss]harper 102 | *.DotSettings.user 103 | 104 | # JustCode is a .NET coding add-in 105 | .JustCode 106 | 107 | # TeamCity is a build add-in 108 | _TeamCity* 109 | 110 | # DotCover is a Code Coverage Tool 111 | *.dotCover 112 | 113 | # NCrunch 114 | _NCrunch_* 115 | .*crunch*.local.xml 116 | nCrunchTemp_* 117 | 118 | # MightyMoose 119 | *.mm.* 120 | AutoTest.Net/ 121 | 122 | # Web workbench (sass) 123 | .sass-cache/ 124 | 125 | # Installshield output folder 126 | [Ee]xpress/ 127 | 128 | # DocProject is a documentation generator add-in 129 | DocProject/buildhelp/ 130 | DocProject/Help/*.HxT 131 | DocProject/Help/*.HxC 132 | DocProject/Help/*.hhc 133 | DocProject/Help/*.hhk 134 | DocProject/Help/*.hhp 135 | DocProject/Help/Html2 136 | DocProject/Help/html 137 | 138 | # Click-Once directory 139 | publish/ 140 | 141 | # Publish Web Output 142 | *.[Pp]ublish.xml 143 | *.azurePubxml 144 | # TODO: Comment the next line if you want to checkin your web deploy settings 145 | # but database connection strings (with potential passwords) will be unencrypted 146 | #*.pubxml 147 | *.publishproj 148 | 149 | # Microsoft Azure Web App publish settings. Comment the next line if you want to 150 | # checkin your Azure Web App publish settings, but sensitive information contained 151 | # in these scripts will be unencrypted 152 | PublishScripts/ 153 | 154 | # NuGet Packages 155 | *.nupkg 156 | # The packages folder can be ignored because of Package Restore 157 | **/packages/* 158 | # except build/, which is used as an MSBuild target. 159 | !**/packages/build/ 160 | # Uncomment if necessary however generally it will be regenerated when needed 161 | #!**/packages/repositories.config 162 | # NuGet v3's project.json files produces more ignoreable files 163 | *.nuget.props 164 | *.nuget.targets 165 | 166 | # Microsoft Azure Build Output 167 | csx/ 168 | *.build.csdef 169 | 170 | # Microsoft Azure Emulator 171 | ecf/ 172 | rcf/ 173 | 174 | # Windows Store app package directories and files 175 | AppPackages/ 176 | BundleArtifacts/ 177 | Package.StoreAssociation.xml 178 | _pkginfo.txt 179 | 180 | # Visual Studio cache files 181 | # files ending in .cache can be ignored 182 | *.[Cc]ache 183 | # but keep track of directories ending in .cache 184 | !*.[Cc]ache/ 185 | 186 | # Others 187 | ClientBin/ 188 | ~$* 189 | *~ 190 | *.dbmdl 191 | *.dbproj.schemaview 192 | *.jfm 193 | *.pfx 194 | *.publishsettings 195 | node_modules/ 196 | orleans.codegen.cs 197 | 198 | # Since there are multiple workflows, uncomment next line to ignore bower_components 199 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) 200 | #bower_components/ 201 | 202 | # RIA/Silverlight projects 203 | Generated_Code/ 204 | 205 | # Backup & report files from converting an old project file 206 | # to a newer Visual Studio version. Backup files are not needed, 207 | # because we have git ;-) 208 | _UpgradeReport_Files/ 209 | Backup*/ 210 | UpgradeLog*.XML 211 | UpgradeLog*.htm 212 | 213 | # SQL Server files 214 | *.mdf 215 | *.ldf 216 | 217 | # Business Intelligence projects 218 | *.rdl.data 219 | *.bim.layout 220 | *.bim_*.settings 221 | 222 | # Microsoft Fakes 223 | FakesAssemblies/ 224 | 225 | # GhostDoc plugin setting file 226 | *.GhostDoc.xml 227 | 228 | # Node.js Tools for Visual Studio 229 | .ntvs_analysis.dat 230 | 231 | # Visual Studio 6 build log 232 | *.plg 233 | 234 | # Visual Studio 6 workspace options file 235 | *.opt 236 | 237 | # Visual Studio LightSwitch build output 238 | **/*.HTMLClient/GeneratedArtifacts 239 | **/*.DesktopClient/GeneratedArtifacts 240 | **/*.DesktopClient/ModelManifest.xml 241 | **/*.Server/GeneratedArtifacts 242 | **/*.Server/ModelManifest.xml 243 | _Pvt_Extensions 244 | 245 | # Paket dependency manager 246 | .paket/paket.exe 247 | paket-files/ 248 | 249 | # FAKE - F# Make 250 | .fake/ 251 | 252 | # JetBrains Rider 253 | .idea/ 254 | *.sln.iml 255 | 256 | # CodeRush 257 | .cr/ 258 | 259 | # Python Tools for Visual Studio (PTVS) 260 | __pycache__/ 261 | *.pyc -------------------------------------------------------------------------------- /MasterVolumeControl/COPYRIGHT.txt: -------------------------------------------------------------------------------- 1 | Master Volume Control Library 2 | 3 | The MIT License 4 | 5 | Copyright © 2007 Mayuki Sawatari 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in 15 | all copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | THE SOFTWARE. 24 | 25 | ---- 26 | 27 | WaveLibMixer.dll by CastorTiu 28 | http://www.codeproject.com/useritems/AudioLib.asp?df=100&forumid=217323&exp=0&select=1363103 -------------------------------------------------------------------------------- /MasterVolumeControl/EndpointVolume.cs: -------------------------------------------------------------------------------- 1 | // $Id$ 2 | #region LICENSE 3 | /* 4 | * This source-code licensed under Public Domain 5 | */ 6 | #endregion 7 | using System; 8 | using System.Collections.Generic; 9 | using System.Text; 10 | using System.Runtime.InteropServices; 11 | 12 | // 13 | // Windows SDK 6.0 / endpointvolume.h 14 | // 15 | namespace Misuzilla.InteropServices.AudioEndpointVolume 16 | { 17 | public static class IID 18 | { 19 | public const String IAudioEndpointVolume = "5CDF2C82-841E-4546-9722-0CF74078229A"; 20 | public const String IAudioEndpointVolumeCallback = "657804FA-D6AD-4496-8A60-352752AF4F89"; 21 | public const String IAudioMeterInformation = "C02216F6-8C67-4B5B-9D00-D008E73E0064"; 22 | } 23 | 24 | [Guid(IID.IAudioEndpointVolume)] 25 | [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] 26 | public interface IAudioEndpointVolume 27 | { 28 | void RegisterControlChangeNotify(IAudioEndpointVolumeCallback pNotify); 29 | void UnregisterControlChangeNotify(IAudioEndpointVolumeCallback pNotify); 30 | UInt32 GetChannelCount(); 31 | void SetMasterVolumeLevel(Single fLevelDB, ref Guid pguidEventContext); 32 | void SetMasterVolumeLevelScalar(Single fLevelDB, ref Guid pguidEventContext); 33 | Single GetMasterVolumeLevel(); 34 | Single GetMasterVolumeLevelScalar(); 35 | void SetChannelVolumeLevel(UInt32 nChannel, Single fLevelDB, ref Guid pguidEventContext); 36 | void SetChannelVolumeLevelScalar(UInt32 nChannel, Single fLevelDB, ref Guid pguidEventContext); 37 | Single GetMasterVolumeLevel(UInt32 nChannel); 38 | Single GetMasterVolumeLevelScalar(UInt32 nChannel); 39 | void SetMute([MarshalAs(UnmanagedType.Bool)] Boolean bMute, ref Guid pguidEventContext); 40 | [return: MarshalAs(UnmanagedType.Bool)] 41 | Boolean GetMute(); 42 | void GetVolumeStepInfo(out UInt32 pnStep, out UInt32 pnStepCount); 43 | void VolumeStepUp(ref Guid pguidEventContext); 44 | void VolumeStepDown(ref Guid pguidEventContext); 45 | void QueryHardwareSupport(); 46 | void GetVolumeRange(Single pflVolumeMindB, Single pflVolumeMaxdb, Single pfVolumeIncrementdB); 47 | } 48 | 49 | [Guid(IID.IAudioEndpointVolumeCallback)] 50 | [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] 51 | public interface IAudioEndpointVolumeCallback 52 | { 53 | void OnNotify(AUDIO_VOLUME_NOTIFICATION_DATA pNotify); 54 | } 55 | 56 | [Guid(IID.IAudioMeterInformation)] 57 | [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] 58 | public interface IAudioMeterInformation 59 | { 60 | Single GetPeakValue(); 61 | UInt32 GetMeteringChannelCount(); 62 | Single GetChannelsPeakValues(UInt32 u32ChannelCount); 63 | UInt32 QueryHardwareSupport(); 64 | } 65 | 66 | [StructLayout(LayoutKind.Sequential)] 67 | public class AUDIO_VOLUME_NOTIFICATION_DATA 68 | { 69 | public Guid guidEventContext; 70 | public Boolean bMuted; 71 | public Single fMasterVolume; 72 | public UInt32 nChannels; 73 | public Single afChannelVolumes;//[ 1 ]; 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /MasterVolumeControl/Interop.MMDeviceAPI.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mayuki/AppleWirelessKeyboardHelper/6e519f90f898c3899d57de809dc3523d245b8ce1/MasterVolumeControl/Interop.MMDeviceAPI.dll -------------------------------------------------------------------------------- /MasterVolumeControl/MasterVolumeControl.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mayuki/AppleWirelessKeyboardHelper/6e519f90f898c3899d57de809dc3523d245b8ce1/MasterVolumeControl/MasterVolumeControl.cs -------------------------------------------------------------------------------- /MasterVolumeControl/MasterVolumeControlLibrary.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | Debug 4 | AnyCPU 5 | 8.0.50727 6 | 2.0 7 | {8CE671E0-E48E-4562-8C5F-253125D9489B} 8 | Library 9 | Properties 10 | MasterVolumeControlLibrary 11 | MasterVolumeControlLibrary 12 | 13 | 14 | 3.5 15 | 16 | 17 | v2.0 18 | 19 | 20 | true 21 | full 22 | false 23 | bin\Debug\ 24 | DEBUG;TRACE 25 | prompt 26 | 4 27 | 28 | 29 | pdbonly 30 | true 31 | bin\Release\ 32 | TRACE 33 | prompt 34 | 4 35 | 36 | 37 | true 38 | bin\x86\Debug\ 39 | DEBUG;TRACE 40 | full 41 | x86 42 | true 43 | GlobalSuppressions.cs 44 | prompt 45 | 46 | 47 | bin\x86\Release\ 48 | TRACE 49 | true 50 | pdbonly 51 | x86 52 | true 53 | GlobalSuppressions.cs 54 | prompt 55 | 56 | 57 | 58 | False 59 | .\Interop.MMDeviceAPI.dll 60 | 61 | 62 | 63 | 64 | 65 | False 66 | .\WaveLibMixer.dll 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 89 | -------------------------------------------------------------------------------- /MasterVolumeControl/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // アセンブリに関する一般情報は以下の属性セットをとおして制御されます。 6 | // アセンブリに関連付けられている情報を変更するには、 7 | // これらの属性値を変更してください。 8 | [assembly: AssemblyTitle("Master Volume Control Library")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("Misuzilla Organization")] 12 | [assembly: AssemblyProduct("Master Volume Control Library")] 13 | [assembly: AssemblyCopyright("Copyright (C) Misuzilla Organization 2007")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // ComVisible を false に設定すると、このアセンブリ内の型は COM コンポーネントには 18 | // 参照不可能になります。COM からこのアセンブリ内の型にアクセスする場合は、 19 | // その型の ComVisible 属性を true に設定してください。 20 | [assembly: ComVisible(false)] 21 | 22 | // 次の GUID は、このプロジェクトが COM に公開される場合の、typelib の ID です 23 | [assembly: Guid("98293faa-3185-4adf-b904-fa13a1f3fe86")] 24 | 25 | // アセンブリのバージョン情報は、以下の 4 つの値で構成されています: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // すべての値を指定するか、下のように '*' を使ってリビジョンおよびビルド番号を 33 | // 既定値にすることができます: 34 | [assembly: AssemblyVersion("1.0.0.0")] 35 | [assembly: AssemblyFileVersion("1.0.0.0")] 36 | -------------------------------------------------------------------------------- /MasterVolumeControl/WaveLibMixer.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mayuki/AppleWirelessKeyboardHelper/6e519f90f898c3899d57de809dc3523d245b8ce1/MasterVolumeControl/WaveLibMixer.dll -------------------------------------------------------------------------------- /Misuzilla.Applications.AppleWirelessKeyboardHelper.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 15 4 | VisualStudioVersion = 15.0.28010.2036 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Misuzilla.Applications.AppleWirelessKeyboardHelper", "Misuzilla.Applications.AppleWirelessKeyboardHelper\Misuzilla.Applications.AppleWirelessKeyboardHelper.csproj", "{A4D4C6B9-6641-4B3D-A023-27C8EC699F9C}" 7 | ProjectSection(ProjectDependencies) = postProject 8 | {E7997027-6A1A-4C0E-95C7-143A3CC7FC92} = {E7997027-6A1A-4C0E-95C7-143A3CC7FC92} 9 | EndProjectSection 10 | EndProject 11 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MasterVolumeControlLibrary", "MasterVolumeControl\MasterVolumeControlLibrary.csproj", "{8CE671E0-E48E-4562-8C5F-253125D9489B}" 12 | EndProject 13 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MonitorBrightnessControlLibrary", "MonitorBrightnessControl\MonitorBrightnessControlLibrary.csproj", "{E7997027-6A1A-4C0E-95C7-143A3CC7FC92}" 14 | EndProject 15 | Global 16 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 17 | Debug|Any CPU = Debug|Any CPU 18 | Debug|x86 = Debug|x86 19 | Release|Any CPU = Release|Any CPU 20 | Release|x86 = Release|x86 21 | EndGlobalSection 22 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 23 | {A4D4C6B9-6641-4B3D-A023-27C8EC699F9C}.Debug|Any CPU.ActiveCfg = Debug|x86 24 | {A4D4C6B9-6641-4B3D-A023-27C8EC699F9C}.Debug|Any CPU.Build.0 = Debug|x86 25 | {A4D4C6B9-6641-4B3D-A023-27C8EC699F9C}.Debug|x86.ActiveCfg = Debug|x86 26 | {A4D4C6B9-6641-4B3D-A023-27C8EC699F9C}.Debug|x86.Build.0 = Debug|x86 27 | {A4D4C6B9-6641-4B3D-A023-27C8EC699F9C}.Release|Any CPU.ActiveCfg = Release|x86 28 | {A4D4C6B9-6641-4B3D-A023-27C8EC699F9C}.Release|Any CPU.Build.0 = Release|x86 29 | {A4D4C6B9-6641-4B3D-A023-27C8EC699F9C}.Release|x86.ActiveCfg = Release|x86 30 | {A4D4C6B9-6641-4B3D-A023-27C8EC699F9C}.Release|x86.Build.0 = Release|x86 31 | {8CE671E0-E48E-4562-8C5F-253125D9489B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 32 | {8CE671E0-E48E-4562-8C5F-253125D9489B}.Debug|Any CPU.Build.0 = Debug|Any CPU 33 | {8CE671E0-E48E-4562-8C5F-253125D9489B}.Debug|x86.ActiveCfg = Debug|Any CPU 34 | {8CE671E0-E48E-4562-8C5F-253125D9489B}.Debug|x86.Build.0 = Debug|Any CPU 35 | {8CE671E0-E48E-4562-8C5F-253125D9489B}.Release|Any CPU.ActiveCfg = Release|Any CPU 36 | {8CE671E0-E48E-4562-8C5F-253125D9489B}.Release|Any CPU.Build.0 = Release|Any CPU 37 | {8CE671E0-E48E-4562-8C5F-253125D9489B}.Release|x86.ActiveCfg = Release|Any CPU 38 | {E7997027-6A1A-4C0E-95C7-143A3CC7FC92}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 39 | {E7997027-6A1A-4C0E-95C7-143A3CC7FC92}.Debug|Any CPU.Build.0 = Debug|Any CPU 40 | {E7997027-6A1A-4C0E-95C7-143A3CC7FC92}.Debug|x86.ActiveCfg = Debug|Any CPU 41 | {E7997027-6A1A-4C0E-95C7-143A3CC7FC92}.Release|Any CPU.ActiveCfg = Release|Any CPU 42 | {E7997027-6A1A-4C0E-95C7-143A3CC7FC92}.Release|Any CPU.Build.0 = Release|Any CPU 43 | {E7997027-6A1A-4C0E-95C7-143A3CC7FC92}.Release|x86.ActiveCfg = Release|Any CPU 44 | EndGlobalSection 45 | GlobalSection(SolutionProperties) = preSolution 46 | HideSolutionNode = FALSE 47 | EndGlobalSection 48 | GlobalSection(ExtensibilityGlobals) = postSolution 49 | SolutionGuid = {0F642F56-ABBD-40FE-9430-700A433A6073} 50 | EndGlobalSection 51 | EndGlobal 52 | -------------------------------------------------------------------------------- /Misuzilla.Applications.AppleWirelessKeyboardHelper/AppleWirelessKeyboardHelper.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mayuki/AppleWirelessKeyboardHelper/6e519f90f898c3899d57de809dc3523d245b8ce1/Misuzilla.Applications.AppleWirelessKeyboardHelper/AppleWirelessKeyboardHelper.ico -------------------------------------------------------------------------------- /Misuzilla.Applications.AppleWirelessKeyboardHelper/Enum.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace Misuzilla.Applications.AppleWirelessKeyboardHelper 6 | { 7 | [Flags] 8 | internal enum AppleKeyboardKeys : byte 9 | { 10 | None = 0x00, 11 | Fn = 0x10, 12 | Eject = 0x08 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /Misuzilla.Applications.AppleWirelessKeyboardHelper/EventArgs.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | using System.Windows.Forms; 5 | 6 | namespace Misuzilla.Applications.AppleWirelessKeyboardHelper 7 | { 8 | internal class KeyEventArgs : EventArgs 9 | { 10 | public Boolean IsPowerButtonDown; 11 | public AppleKeyboardKeys AppleKeyboardKey; 12 | 13 | public KeyEventArgs(Boolean isPowerButtonDown, AppleKeyboardKeys appleKeyboardKey) 14 | { 15 | IsPowerButtonDown = isPowerButtonDown; 16 | AppleKeyboardKey = appleKeyboardKey; 17 | } 18 | } 19 | 20 | internal class AppleKeyboardEventArgs : EventArgs 21 | { 22 | public AppleKeyboardKeys AppleKeyState; 23 | public Keys Key; 24 | public Win32.KeyboardHookEventStruct KeyEventStruct; 25 | public Boolean Handled = false; 26 | 27 | public AppleKeyboardEventArgs(AppleKeyboardKeys appleKeyState, Keys key, Win32.KeyboardHookEventStruct keyEventStruct) 28 | { 29 | AppleKeyState = appleKeyState; 30 | Key = key; 31 | KeyEventStruct = keyEventStruct; 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /Misuzilla.Applications.AppleWirelessKeyboardHelper/HIDImports.cs: -------------------------------------------------------------------------------- 1 | ////////////////////////////////////////////////////////////////////////////////// 2 | // HIDImports.cs 3 | // Managed Wiimote Library 4 | // Written by Brian Peek (http://www.brianpeek.com/) 5 | // for MSDN's Coding4Fun (http://msdn.microsoft.com/coding4fun/) 6 | // Visit http://msdn.microsoft.com/coding4fun/hardware/article.aspx?articleid=1879033 7 | // for more information 8 | ////////////////////////////////////////////////////////////////////////////////// 9 | 10 | using System; 11 | using System.Runtime.InteropServices; 12 | using System.IO; 13 | using Microsoft.Win32.SafeHandles; 14 | 15 | namespace WiimoteLib 16 | { 17 | /// 18 | /// Win32 import information for use with the Wiimote library 19 | /// 20 | class HIDImports 21 | { 22 | // 23 | // Flags controlling what is included in the device information set built 24 | // by SetupDiGetClassDevs 25 | // 26 | public const int DIGCF_DEFAULT = 0x00000001; // only valid with DIGCF_DEVICEINTERFACE 27 | public const int DIGCF_PRESENT = 0x00000002; 28 | public const int DIGCF_ALLCLASSES = 0x00000004; 29 | public const int DIGCF_PROFILE = 0x00000008; 30 | public const int DIGCF_DEVICEINTERFACE = 0x00000010; 31 | 32 | [Flags] 33 | public enum EFileAttributes : uint 34 | { 35 | Readonly = 0x00000001, 36 | Hidden = 0x00000002, 37 | System = 0x00000004, 38 | Directory = 0x00000010, 39 | Archive = 0x00000020, 40 | Device = 0x00000040, 41 | Normal = 0x00000080, 42 | Temporary = 0x00000100, 43 | SparseFile = 0x00000200, 44 | ReparsePoint = 0x00000400, 45 | Compressed = 0x00000800, 46 | Offline = 0x00001000, 47 | NotContentIndexed= 0x00002000, 48 | Encrypted = 0x00004000, 49 | Write_Through = 0x80000000, 50 | Overlapped = 0x40000000, 51 | NoBuffering = 0x20000000, 52 | RandomAccess = 0x10000000, 53 | SequentialScan = 0x08000000, 54 | DeleteOnClose = 0x04000000, 55 | BackupSemantics = 0x02000000, 56 | PosixSemantics = 0x01000000, 57 | OpenReparsePoint = 0x00200000, 58 | OpenNoRecall = 0x00100000, 59 | FirstPipeInstance= 0x00080000 60 | } 61 | 62 | [StructLayout(LayoutKind.Sequential)] 63 | public struct SP_DEVINFO_DATA 64 | { 65 | public uint cbSize; 66 | public Guid ClassGuid; 67 | public uint DevInst; 68 | public IntPtr Reserved; 69 | } 70 | 71 | [StructLayout(LayoutKind.Sequential)] 72 | public struct SP_DEVICE_INTERFACE_DATA 73 | { 74 | public int cbSize; 75 | public Guid InterfaceClassGuid; 76 | public int Flags; 77 | public IntPtr RESERVED; 78 | } 79 | 80 | [StructLayout(LayoutKind.Sequential, Pack = 1)] 81 | public struct SP_DEVICE_INTERFACE_DETAIL_DATA 82 | { 83 | public UInt32 cbSize; 84 | [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)] 85 | public string DevicePath; 86 | } 87 | 88 | [StructLayout(LayoutKind.Sequential)] 89 | public struct HIDD_ATTRIBUTES 90 | { 91 | public int Size; 92 | public short VendorID; 93 | public short ProductID; 94 | public short VersionNumber; 95 | } 96 | 97 | [DllImport(@"hid.dll", CharSet=CharSet.Auto, SetLastError = true)] 98 | public static extern void HidD_GetHidGuid(out Guid gHid); 99 | 100 | [DllImport("hid.dll")] 101 | public static extern Boolean HidD_GetAttributes(IntPtr HidDeviceObject, ref HIDD_ATTRIBUTES Attributes); 102 | 103 | [DllImport("hid.dll")] 104 | internal extern static bool HidD_SetOutputReport( 105 | IntPtr HidDeviceObject, 106 | byte[] lpReportBuffer, 107 | uint ReportBufferLength); 108 | 109 | [DllImport(@"setupapi.dll", CharSet = CharSet.Auto, SetLastError = true)] 110 | public static extern IntPtr SetupDiGetClassDevs( 111 | ref Guid ClassGuid, 112 | [MarshalAs(UnmanagedType.LPTStr)] string Enumerator, 113 | IntPtr hwndParent, 114 | UInt32 Flags 115 | ); 116 | 117 | [DllImport(@"setupapi.dll", CharSet=CharSet.Auto, SetLastError = true)] 118 | public static extern Boolean SetupDiEnumDeviceInterfaces( 119 | IntPtr hDevInfo, 120 | //ref SP_DEVINFO_DATA devInfo, 121 | IntPtr devInvo, 122 | ref Guid interfaceClassGuid, 123 | UInt32 memberIndex, 124 | ref SP_DEVICE_INTERFACE_DATA deviceInterfaceData 125 | ); 126 | 127 | [DllImport(@"setupapi.dll", SetLastError = true)] 128 | public static extern Boolean SetupDiGetDeviceInterfaceDetail( 129 | IntPtr hDevInfo, 130 | ref SP_DEVICE_INTERFACE_DATA deviceInterfaceData, 131 | IntPtr deviceInterfaceDetailData, 132 | UInt32 deviceInterfaceDetailDataSize, 133 | out UInt32 requiredSize, 134 | IntPtr deviceInfoData 135 | ); 136 | 137 | [DllImport(@"setupapi.dll", SetLastError = true)] 138 | public static extern Boolean SetupDiGetDeviceInterfaceDetail( 139 | IntPtr hDevInfo, 140 | ref SP_DEVICE_INTERFACE_DATA deviceInterfaceData, 141 | ref SP_DEVICE_INTERFACE_DETAIL_DATA deviceInterfaceDetailData, 142 | UInt32 deviceInterfaceDetailDataSize, 143 | out UInt32 requiredSize, 144 | IntPtr deviceInfoData 145 | ); 146 | 147 | [DllImport(@"setupapi.dll", CharSet=CharSet.Auto, SetLastError = true)] 148 | public static extern UInt16 SetupDiDestroyDeviceInfoList( IntPtr hDevInfo ); 149 | 150 | [DllImport("Kernel32.dll", SetLastError = true, CharSet = CharSet.Auto)] 151 | public static extern SafeFileHandle CreateFile( 152 | string fileName, 153 | [MarshalAs(UnmanagedType.U4)] FileAccess fileAccess, 154 | [MarshalAs(UnmanagedType.U4)] FileShare fileShare, 155 | IntPtr securityAttributes, 156 | [MarshalAs(UnmanagedType.U4)] FileMode creationDisposition, 157 | [MarshalAs(UnmanagedType.U4)] EFileAttributes flags, 158 | IntPtr template); 159 | 160 | [DllImport("kernel32.dll", SetLastError=true)] 161 | [return: MarshalAs(UnmanagedType.Bool)] 162 | public static extern bool CloseHandle(IntPtr hObject); 163 | } 164 | } 165 | -------------------------------------------------------------------------------- /Misuzilla.Applications.AppleWirelessKeyboardHelper/Helper.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mayuki/AppleWirelessKeyboardHelper/6e519f90f898c3899d57de809dc3523d245b8ce1/Misuzilla.Applications.AppleWirelessKeyboardHelper/Helper.cs -------------------------------------------------------------------------------- /Misuzilla.Applications.AppleWirelessKeyboardHelper/IronPython.Modules.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mayuki/AppleWirelessKeyboardHelper/6e519f90f898c3899d57de809dc3523d245b8ce1/Misuzilla.Applications.AppleWirelessKeyboardHelper/IronPython.Modules.dll -------------------------------------------------------------------------------- /Misuzilla.Applications.AppleWirelessKeyboardHelper/IronPython.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mayuki/AppleWirelessKeyboardHelper/6e519f90f898c3899d57de809dc3523d245b8ce1/Misuzilla.Applications.AppleWirelessKeyboardHelper/IronPython.dll -------------------------------------------------------------------------------- /Misuzilla.Applications.AppleWirelessKeyboardHelper/LICENSE.txt: -------------------------------------------------------------------------------- 1 | The MIT License 2 | 3 | Copyright © 2007 Mayuki Sawatari 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. -------------------------------------------------------------------------------- /Misuzilla.Applications.AppleWirelessKeyboardHelper/Microsoft.Scripting.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mayuki/AppleWirelessKeyboardHelper/6e519f90f898c3899d57de809dc3523d245b8ce1/Misuzilla.Applications.AppleWirelessKeyboardHelper/Microsoft.Scripting.dll -------------------------------------------------------------------------------- /Misuzilla.Applications.AppleWirelessKeyboardHelper/Misuzilla.Applications.AppleWirelessKeyboardHelper.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | Debug 4 | AnyCPU 5 | 9.0.30729 6 | 2.0 7 | {A4D4C6B9-6641-4B3D-A023-27C8EC699F9C} 8 | WinExe 9 | Properties 10 | Misuzilla.Applications.AppleWirelessKeyboardHelper 11 | AppleWirelessKeyboardHelper 12 | 13 | 14 | AppleWirelessKeyboardHelper.ico 15 | 16 | 17 | 3.5 18 | 19 | 20 | publish\ 21 | true 22 | Disk 23 | false 24 | Foreground 25 | 7 26 | Days 27 | false 28 | false 29 | true 30 | 0 31 | 1.0.0.%2a 32 | false 33 | false 34 | true 35 | v2.0 36 | 37 | 38 | true 39 | full 40 | false 41 | bin\Debug\ 42 | DEBUG;TRACE 43 | prompt 44 | 4 45 | 46 | 47 | pdbonly 48 | true 49 | bin\Release\ 50 | TRACE 51 | prompt 52 | 4 53 | 54 | 55 | true 56 | bin\x86\Debug\ 57 | DEBUG;TRACE 58 | full 59 | x86 60 | true 61 | GlobalSuppressions.cs 62 | prompt 63 | true 64 | -Microsoft.Globalization#CA1305;-Microsoft.Design#CA2210;-Microsoft.Design#CA1014;-Microsoft.Design#CA1060;-Microsoft.Performance#CA1823 65 | 66 | 67 | bin\x86\Release\ 68 | TRACE 69 | true 70 | pdbonly 71 | x86 72 | true 73 | GlobalSuppressions.cs 74 | prompt 75 | 76 | 77 | 78 | False 79 | .\IronPython.dll 80 | 81 | 82 | False 83 | .\IronPython.Modules.dll 84 | 85 | 86 | False 87 | .\Microsoft.Scripting.dll 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | True 104 | True 105 | Common.resx 106 | 107 | 108 | True 109 | True 110 | Strings.resx 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | Designer 123 | ResXFileCodeGenerator 124 | Common.Designer.cs 125 | 126 | 127 | Designer 128 | 129 | 130 | Designer 131 | ResXFileCodeGenerator 132 | Strings.Designer.cs 133 | 134 | 135 | 136 | 137 | 138 | Always 139 | 140 | 141 | 142 | 143 | Always 144 | 145 | 146 | 147 | 148 | {8CE671E0-E48E-4562-8C5F-253125D9489B} 149 | MasterVolumeControlLibrary 150 | 151 | 152 | 153 | 154 | False 155 | .NET Framework Client Profile 156 | false 157 | 158 | 159 | False 160 | .NET Framework 2.0 %28x86%29 161 | true 162 | 163 | 164 | False 165 | .NET Framework 3.0 %28x86%29 166 | false 167 | 168 | 169 | False 170 | .NET Framework 3.5 171 | false 172 | 173 | 174 | False 175 | .NET Framework 3.5 SP1 176 | false 177 | 178 | 179 | 180 | 187 | -------------------------------------------------------------------------------- /Misuzilla.Applications.AppleWirelessKeyboardHelper/Program.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mayuki/AppleWirelessKeyboardHelper/6e519f90f898c3899d57de809dc3523d245b8ce1/Misuzilla.Applications.AppleWirelessKeyboardHelper/Program.cs -------------------------------------------------------------------------------- /Misuzilla.Applications.AppleWirelessKeyboardHelper/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // アセンブリに関する一般情報は以下の属性セットをとおして制御されます。 6 | // アセンブリに関連付けられている情報を変更するには、 7 | // これらの属性値を変更してください。 8 | [assembly: AssemblyTitle("Apple Wireless Keyboard Helper")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("Misuzilla Organization")] 12 | [assembly: AssemblyProduct("Apple Wireless Keyboard Helper")] 13 | [assembly: AssemblyCopyright("Copyright (C) Misuzilla Organization 2007")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // ComVisible を false に設定すると、このアセンブリ内の型は COM コンポーネントには 18 | // 参照不可能になります。COM からこのアセンブリ内の型にアクセスする場合は、 19 | // その型の ComVisible 属性を true に設定してください。 20 | [assembly: ComVisible(false)] 21 | 22 | // 次の GUID は、このプロジェクトが COM に公開される場合の、typelib の ID です 23 | [assembly: Guid("a0ce23b8-de8d-437e-93e8-a7abc433ae29")] 24 | 25 | // アセンブリのバージョン情報は、以下の 4 つの値で構成されています: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | [assembly: AssemblyVersion("1.0.0.0")] 33 | [assembly: AssemblyFileVersion("1.0.0.0")] 34 | -------------------------------------------------------------------------------- /Misuzilla.Applications.AppleWirelessKeyboardHelper/Readme.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | Apple Wireless Keyboard Helper for Windows 4 | 5 | 6 | 24 | 25 |

Apple Wireless Keyboard Helper for Windows

26 |

このアプリケーションの概要

27 |

Apple Wireless Keyboard(アルミニウム型)のFnキーやEjectキーなどの特殊キーをWindows上で扱えるようにするためのヘルパーアプリケーションです。

28 | 29 |

動作に必要な環境

30 | 35 |

ただし、動作の確認を行った環境はWindows Vista Ultimate Edition (x64) + Apple Wireless Keyboard 英語配列のみです。

36 | 37 |

インストール

38 |

アーカイブの内容を適当なフォルダにコピーしてください。

39 |

ただし、ファイルサーバのようなネットワークドライブ上に配置した場合、実行時にエラーが発生する場合があります。 40 | ローカルコンピュータ上のフォルダに配置することをおすすめします。 41 | ネットワークドライブ上に配置したい場合には.NET Frameworkのセキュリティの設定を変更する必要があります。 42 |

43 | 44 |

実行と終了

45 |

実行するには AppleWirelessKeyboardHelper.exe をエクスプローラ等から実行してください。 46 | 実行後しばらくするとWindowsの通知領域(タスクバーのアイコン領域)にアイコンが表示され、スクリプトを読み込んだというメッセージが表示されます。

47 |

終了は通知領域のアイコンのコンテキストメニューより「Apple Wireless Keyboard Helper の終了」を選択してください。

48 | 49 |

使い方

50 |

Fn+ファンクションキーやEjectを押すとあらかじめセットされているコマンドが実行されます。あらかじめセットされているコマンドは以下の通りです。

51 |
52 | 53 |
Fn+F1
54 |
メッセージボックスを表示するテスト(サンプル)
55 | 56 |
Fn+F2
57 |
バルーンツールチップを表示するテスト(サンプル)
58 | 59 |
Fn+F3
60 |
Windows VistaでAeroを利用している場合は3D Flip。それ以外の環境ではデスクトップを表示
61 | 62 |
Fn+F4
63 |
PrintScreen キー
64 | 65 |
Fn+F7
66 |
iTunesで前の曲へ
67 | 68 |
Fn+F8
69 |
iTunesで再生・一時停止
70 | 71 |
Fn+F9
72 |
iTunesで次の曲へ
73 | 74 |
Fn+F10
75 |
コンピュータの音量をミュート(またはミュート解除)
76 | 77 |
Fn+F11
78 |
コンピュータの音量を下げる
79 | 80 |
Fn+F12
81 |
Fn+Delete(WindowsのDelete) (F12をDeleteにマッピングしている人向け)
82 |
コンピュータの音量を上げる
83 | 84 |
Fn+Del(キーボード)
85 |
Del キー
86 | 87 |
Fn+Up/Down
88 |
PageUp/PageDown キー
89 | 90 |
Fn+Left/Right
91 |
Home/End キー
92 | 93 |
電源ボタン
94 |
デスクトップのロック
95 | 96 |
英数キー(JIS)
97 |
IMEの切り替え
98 | 99 |
カナキー(JIS)
100 |
変換
101 |
102 | 103 |

注意

104 |

このアプリケーションの影響をうけるのは現在のデスクトップに対してのみです。ログオンやロックした場合の画面には影響しません。

105 | 106 |

キー設定をカスタマイズ

107 |

あらかじめキー設定されているものがあわない、もしくはもっとこうしたいという場合にはカスタマイズすることができます。 108 | 設定ファイルの書式はIronPythonスクリプトそのものですので、高度なスクリプティングを実行することもできます。

109 |

設定ファイルはアプリケーションのファイルが含まれているフォルダにある Scripts フォルダの中に配置されています。このフォルダの中にPythonのファイル(拡張子 .py)を配置することでアプリケーションが認識できるようになります。

110 |

標準の設定はDefault.py.sampleに含まれています。このファイルを参考にカスタマイズしてください。

111 |

設定ファイルを修正したら、通知領域のコンテキストメニューから「キー設定スクリプトの再読込」を選択することで設定ファイル(スクリプト)を有効にできます。

112 | 113 |

ソースコードとライセンス

114 |

ソースコードは以下のURLより入手することができます。

115 |
116 |
Trac
117 |
http://trac.misuzilla.org/etcetera/browser/Apple Wireless Keyboard Helper
118 | 119 |
Subversion
120 |
http://svn.misuzilla.org/etcetera/Apple Wireless Keyboard Helper/
121 |
122 |

ライセンスはLICENSE.txtにあるとおりMIT Licenseに従って扱ってください。

123 |

このアプリケーションにはManaged Library for Nintendo's Wiimoteのコードの一部(HIDImport.cs)とCastorTiu氏のWaveLibMixer.dllを含んでいます。

124 | 125 |

IronPython

126 |

Copyright (c) Microsoft Corporation.

127 | 128 |
Copyright © 2007 沢渡真雪(Mayuki Sawatari) <mayuki@misuzilla.org>
-------------------------------------------------------------------------------- /Misuzilla.Applications.AppleWirelessKeyboardHelper/Resources/AppleWirelessKeyboardHelperTrayIcon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mayuki/AppleWirelessKeyboardHelper/6e519f90f898c3899d57de809dc3523d245b8ce1/Misuzilla.Applications.AppleWirelessKeyboardHelper/Resources/AppleWirelessKeyboardHelperTrayIcon.ico -------------------------------------------------------------------------------- /Misuzilla.Applications.AppleWirelessKeyboardHelper/Resources/AppleWirelessKeyboardHelperTrayIcon16x16.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mayuki/AppleWirelessKeyboardHelper/6e519f90f898c3899d57de809dc3523d245b8ce1/Misuzilla.Applications.AppleWirelessKeyboardHelper/Resources/AppleWirelessKeyboardHelperTrayIcon16x16.ico -------------------------------------------------------------------------------- /Misuzilla.Applications.AppleWirelessKeyboardHelper/Resources/Common.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace Misuzilla.Applications.AppleWirelessKeyboardHelper.Resources { 12 | using System; 13 | 14 | 15 | /// 16 | /// A strongly-typed resource class, for looking up localized strings, etc. 17 | /// 18 | // This class was auto-generated by the StronglyTypedResourceBuilder 19 | // class via a tool like ResGen or Visual Studio. 20 | // To add or remove a member, edit your .ResX file then rerun ResGen 21 | // with the /str option, or rebuild your VS project. 22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")] 23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 25 | internal class Common { 26 | 27 | private static global::System.Resources.ResourceManager resourceMan; 28 | 29 | private static global::System.Globalization.CultureInfo resourceCulture; 30 | 31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] 32 | internal Common() { 33 | } 34 | 35 | /// 36 | /// Returns the cached ResourceManager instance used by this class. 37 | /// 38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 39 | internal static global::System.Resources.ResourceManager ResourceManager { 40 | get { 41 | if (object.ReferenceEquals(resourceMan, null)) { 42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Misuzilla.Applications.AppleWirelessKeyboardHelper.Resources.Common", typeof(Common).Assembly); 43 | resourceMan = temp; 44 | } 45 | return resourceMan; 46 | } 47 | } 48 | 49 | /// 50 | /// Overrides the current thread's CurrentUICulture property for all 51 | /// resource lookups using this strongly typed resource class. 52 | /// 53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 54 | internal static global::System.Globalization.CultureInfo Culture { 55 | get { 56 | return resourceCulture; 57 | } 58 | set { 59 | resourceCulture = value; 60 | } 61 | } 62 | 63 | /// 64 | /// Looks up a localized resource of type System.Drawing.Icon similar to (Icon). 65 | /// 66 | internal static System.Drawing.Icon AppleWirelessKeyboardHelperTrayIcon { 67 | get { 68 | object obj = ResourceManager.GetObject("AppleWirelessKeyboardHelperTrayIcon", resourceCulture); 69 | return ((System.Drawing.Icon)(obj)); 70 | } 71 | } 72 | 73 | /// 74 | /// Looks up a localized resource of type System.Drawing.Icon similar to (Icon). 75 | /// 76 | internal static System.Drawing.Icon AppleWirelessKeyboardHelperTrayIcon16x16 { 77 | get { 78 | object obj = ResourceManager.GetObject("AppleWirelessKeyboardHelperTrayIcon16x16", resourceCulture); 79 | return ((System.Drawing.Icon)(obj)); 80 | } 81 | } 82 | } 83 | } 84 | -------------------------------------------------------------------------------- /Misuzilla.Applications.AppleWirelessKeyboardHelper/Resources/Common.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | 121 | 122 | AppleWirelessKeyboardHelperTrayIcon.ico;System.Drawing.Icon, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a 123 | 124 | 125 | AppleWirelessKeyboardHelperTrayIcon16x16.ico;System.Drawing.Icon, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a 126 | 127 | -------------------------------------------------------------------------------- /Misuzilla.Applications.AppleWirelessKeyboardHelper/Resources/Strings.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace Misuzilla.Applications.AppleWirelessKeyboardHelper.Resources { 12 | using System; 13 | 14 | 15 | /// 16 | /// A strongly-typed resource class, for looking up localized strings, etc. 17 | /// 18 | // This class was auto-generated by the StronglyTypedResourceBuilder 19 | // class via a tool like ResGen or Visual Studio. 20 | // To add or remove a member, edit your .ResX file then rerun ResGen 21 | // with the /str option, or rebuild your VS project. 22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")] 23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 25 | internal class Strings { 26 | 27 | private static global::System.Resources.ResourceManager resourceMan; 28 | 29 | private static global::System.Globalization.CultureInfo resourceCulture; 30 | 31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] 32 | internal Strings() { 33 | } 34 | 35 | /// 36 | /// Returns the cached ResourceManager instance used by this class. 37 | /// 38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 39 | internal static global::System.Resources.ResourceManager ResourceManager { 40 | get { 41 | if (object.ReferenceEquals(resourceMan, null)) { 42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Misuzilla.Applications.AppleWirelessKeyboardHelper.Resources.Strings", typeof(Strings).Assembly); 43 | resourceMan = temp; 44 | } 45 | return resourceMan; 46 | } 47 | } 48 | 49 | /// 50 | /// Overrides the current thread's CurrentUICulture property for all 51 | /// resource lookups using this strongly typed resource class. 52 | /// 53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 54 | internal static global::System.Globalization.CultureInfo Culture { 55 | get { 56 | return resourceCulture; 57 | } 58 | set { 59 | resourceCulture = value; 60 | } 61 | } 62 | 63 | /// 64 | /// Looks up a localized string similar to import clr 65 | /// 66 | ///from System import * 67 | ///from System.Diagnostics import Process 68 | ///from System.Runtime.InteropServices import Marshal 69 | ///from System.Windows.Forms import * 70 | ///from Misuzilla.Applications.AppleWirelessKeyboardHelper import Program, Util 71 | /// 72 | ///# Master Volume Control 73 | ///clr.AddReferenceByPartialName("MasterVolumeControlLibrary") 74 | ///from MasterVolumeControlLibrary import MasterVolumeControl 75 | ///volControl = MasterVolumeControl.GetControl() 76 | /// 77 | ///# Monitor Brightness Control 78 | ///clr.AddReferenceByPartialName("MonitorBrigh [rest of string was truncated]";. 79 | /// 80 | internal static string DefaultPythonScript { 81 | get { 82 | return ResourceManager.GetString("DefaultPythonScript", resourceCulture); 83 | } 84 | } 85 | 86 | /// 87 | /// Looks up a localized string similar to Apple Wireless Keyboard connected.. 88 | /// 89 | internal static string KeyboardConnected { 90 | get { 91 | return ResourceManager.GetString("KeyboardConnected", resourceCulture); 92 | } 93 | } 94 | 95 | /// 96 | /// Looks up a localized string similar to Apple Wireless Keyboard disconnected.. 97 | /// 98 | internal static string KeyboardDisconnected { 99 | get { 100 | return ResourceManager.GetString("KeyboardDisconnected", resourceCulture); 101 | } 102 | } 103 | 104 | /// 105 | /// Looks up a localized string similar to Apple Wireless Keyboard is not connected.. 106 | /// 107 | internal static string KeyboardNotConnected { 108 | get { 109 | return ResourceManager.GetString("KeyboardNotConnected", resourceCulture); 110 | } 111 | } 112 | 113 | /// 114 | /// Looks up a localized string similar to E&xit Apple Wireless Keyboard Helper. 115 | /// 116 | internal static string MenuItemExit { 117 | get { 118 | return ResourceManager.GetString("MenuItemExit", resourceCulture); 119 | } 120 | } 121 | 122 | /// 123 | /// Looks up a localized string similar to &Reload key configuration scripts. 124 | /// 125 | internal static string MenuItemReloadScripts { 126 | get { 127 | return ResourceManager.GetString("MenuItemReloadScripts", resourceCulture); 128 | } 129 | } 130 | 131 | /// 132 | /// Looks up a localized string similar to An error occurred while loading script. 133 | /// 134 | ///Path: {0} 135 | ///Reason: 136 | ///{1}. 137 | /// 138 | internal static string ScriptException { 139 | get { 140 | return ResourceManager.GetString("ScriptException", resourceCulture); 141 | } 142 | } 143 | 144 | /// 145 | /// Looks up a localized string similar to Scripts reloaded.. 146 | /// 147 | internal static string ScriptsLoaded { 148 | get { 149 | return ResourceManager.GetString("ScriptsLoaded", resourceCulture); 150 | } 151 | } 152 | 153 | /// 154 | /// Looks up a localized string similar to An error occurred while loading script. 155 | /// 156 | ///Path: {0} 157 | ///Line: {1}, Column: {2} 158 | ///Reason: 159 | ///{3}. 160 | /// 161 | internal static string ScriptSyntaxException { 162 | get { 163 | return ResourceManager.GetString("ScriptSyntaxException", resourceCulture); 164 | } 165 | } 166 | } 167 | } 168 | -------------------------------------------------------------------------------- /Misuzilla.Applications.AppleWirelessKeyboardHelper/Resources/Strings.ja.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | 121 | Apple Wireless Keyboard が接続されました。 122 | 123 | 124 | Apple Wireless Keyboard の接続が切れました。 125 | 126 | 127 | Apple Wireless Keyboard が接続されていません。 128 | 129 | 130 | Apple Wireless Keyboard Helper の終了(&X) 131 | 132 | 133 | キー設定スクリプトの再読込(&R) 134 | 135 | 136 | スクリプトを読み込み中にエラーが発生しました。 137 | 138 | ファイル: {0} 139 | 原因: 140 | {1} 141 | 142 | 143 | スクリプトを読み込みました。 144 | 145 | 146 | スクリプトを読み込み中にエラーが発生しました。 147 | 148 | ファイル: {0} 149 | 行: {1}, 列: {2} 150 | 原因: 151 | {3} 152 | 153 | -------------------------------------------------------------------------------- /Misuzilla.Applications.AppleWirelessKeyboardHelper/Resources/Strings.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | 121 | ..\Scripts\Default.py.sample;System.String, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a 122 | 123 | 124 | Apple Wireless Keyboard connected. 125 | 126 | 127 | Apple Wireless Keyboard disconnected. 128 | 129 | 130 | Apple Wireless Keyboard is not connected. 131 | 132 | 133 | E&xit Apple Wireless Keyboard Helper 134 | 135 | 136 | &Reload key configuration scripts 137 | 138 | 139 | An error occurred while loading script. 140 | 141 | Path: {0} 142 | Reason: 143 | {1} 144 | 145 | 146 | Scripts reloaded. 147 | 148 | 149 | An error occurred while loading script. 150 | 151 | Path: {0} 152 | Line: {1}, Column: {2} 153 | Reason: 154 | {3} 155 | 156 | -------------------------------------------------------------------------------- /Misuzilla.Applications.AppleWirelessKeyboardHelper/Scripts/Default.py.sample: -------------------------------------------------------------------------------- 1 | import clr 2 | 3 | from System import * 4 | from System.Diagnostics import Process 5 | from System.Runtime.InteropServices import Marshal 6 | from System.Windows.Forms import * 7 | from Misuzilla.Applications.AppleWirelessKeyboardHelper import Program, Util 8 | 9 | # Master Volume Control 10 | clr.AddReferenceByPartialName("MasterVolumeControlLibrary") 11 | from MasterVolumeControlLibrary import MasterVolumeControl 12 | volControl = MasterVolumeControl.GetControl() 13 | 14 | # Monitor Brightness Control 15 | clr.AddReferenceByPartialName("MonitorBrightnessControlLibrary") 16 | from MonitorBrightnessControlLibrary import MonitorBrightnessControl 17 | brtControl = MonitorBrightnessControl.GetControl() 18 | 19 | def OnLoad(sender, e): 20 | pass 21 | 22 | def OnUnload(sender, e): 23 | volControl.Dispose() 24 | brtControl.Dispose() 25 | 26 | Program.Load += OnLoad 27 | Program.Unload += OnUnload 28 | 29 | """ 30 | Power Button 31 | """ 32 | def OnDown_Power(): 33 | # Lock desktop 34 | Process.Start("rundll32.exe", "user32.dll,LockWorkStation") 35 | 36 | """ 37 | Eject Button 38 | """ 39 | def OnDown_Eject(): 40 | #Util.Eject("E"); 41 | pass 42 | 43 | """ 44 | Alpha Numeric(eisu) (JIS only) 45 | """ 46 | def OnUp_JISAlphaNumeric(): 47 | Util.SendInput(Keys.HanjaMode) # IME on/off 48 | 49 | """ 50 | Kana Key (JIS only) 51 | """ 52 | def OnUp_JISKana(): 53 | Util.SendInput(Keys.IMEConvert) # IME Convert 54 | 55 | """ 56 | Fn + F1 ... F12 (OnDown_Fn_[KeyName]) 57 | """ 58 | #def OnDown_Fn_F1(): 59 | # MessageBox.Show('Fn+F1') # System.Windows.Forms.MessageBox 60 | # 61 | #def OnDown_Fn_F2(): 62 | # brtControl.BrightnessUp() 63 | # Program.ShowBalloonTip('Fn+F2') # ShowBalloonTip(str) or ShowBalloonTip(str, System.Windows.Forms.ToolTipIcon) 64 | 65 | def OnDown_Fn_F1(): 66 | brtControl.BrightnessDown() 67 | 68 | def OnDown_Fn_F2(): 69 | brtControl.BrightnessUp() 70 | 71 | def OnDown_Fn_F3(): 72 | if Environment.OSVersion.Version.Major >= 6: 73 | Process.Start("rundll32.exe", "DwmApi #105") # 3D Filp 74 | else: 75 | toggleDesktop() # Show Desktops 76 | 77 | def OnDown_Fn_F4(): 78 | Util.SendInput(Keys.PrintScreen) # System.Windows.Forms.Keys 79 | 80 | def OnDown_Fn_F5(): 81 | pass 82 | 83 | def OnDown_Fn_F6(): 84 | pass 85 | 86 | def OnDown_Fn_F7(): 87 | # iTunes / Previous Track 88 | execiTunes(lambda it: it.PreviousTrack()) 89 | 90 | def OnDown_Fn_F8(): 91 | # iTunes / PlayPause 92 | execiTunes(lambda it: it.PlayPause()) 93 | 94 | def OnDown_Fn_F9(): 95 | # iTunes / PlayPause 96 | execiTunes(lambda it: it.NextTrack()) 97 | 98 | def OnDown_Fn_F10(): 99 | volControl.Mute = not volControl.Mute 100 | 101 | def OnDown_Fn_F11(): 102 | volControl.VolumeDown() 103 | 104 | def OnDown_Fn_F12(): 105 | volControl.VolumeUp() 106 | 107 | """ 108 | Fn+BackSpace -> Delete 109 | """ 110 | def OnDown_Fn_Back(): 111 | Util.SendInput(Keys.Delete) 112 | 113 | """ 114 | Fn+Delete -> VolumeUp (for F12 replaced by Delete) 115 | """ 116 | def OnDown_Fn_Delete(): 117 | volControl.VolumeUp() 118 | 119 | """ 120 | Fn+Up/Down -> PageUp/PageDown 121 | """ 122 | def OnDown_Fn_Up(): 123 | Util.SendInput(Keys.PageUp) 124 | 125 | def OnDown_Fn_Down(): 126 | Util.SendInput(Keys.PageDown) 127 | 128 | """ 129 | Fn+Left/Right -> Home/End 130 | """ 131 | def OnDown_Fn_Left(): 132 | Util.SendInput(Keys.Home) 133 | 134 | def OnDown_Fn_Right(): 135 | Util.SendInput(Keys.End) 136 | 137 | # ---- 138 | 139 | # Create COM Object 140 | def createObject(progID): 141 | t = Type.GetTypeFromProgID(progID) 142 | return Activator.CreateInstance(t) 143 | 144 | # iTunes Helper functions 145 | def execiTunes(f): 146 | it = createObject('iTunes.Application') 147 | f(it) 148 | Marshal.ReleaseComObject(it) 149 | 150 | # Show desktop 151 | def toggleDesktop(): 152 | shell = createObject('Shell.Application') 153 | shell.ToggleDesktop() 154 | Marshal.ReleaseComObject(shell) 155 | -------------------------------------------------------------------------------- /Misuzilla.Applications.AppleWirelessKeyboardHelper/Util.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mayuki/AppleWirelessKeyboardHelper/6e519f90f898c3899d57de809dc3523d245b8ce1/Misuzilla.Applications.AppleWirelessKeyboardHelper/Util.cs -------------------------------------------------------------------------------- /Misuzilla.Applications.AppleWirelessKeyboardHelper/Win32.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mayuki/AppleWirelessKeyboardHelper/6e519f90f898c3899d57de809dc3523d245b8ce1/Misuzilla.Applications.AppleWirelessKeyboardHelper/Win32.cs -------------------------------------------------------------------------------- /MonitorBrightnessControl/MonitorBrightnessControl.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Management; 3 | 4 | namespace MonitorBrightnessControlLibrary 5 | { 6 | public abstract class MonitorBrightnessControl : IDisposable 7 | { 8 | public abstract void BrightnessUp(); 9 | public abstract void BrightnessDown(); 10 | 11 | public static MonitorBrightnessControl GetControl() 12 | { 13 | 14 | if (Environment.OSVersion.Platform == PlatformID.Win32NT && 15 | Environment.OSVersion.Version.Major >= 6) // WMI is supported Vista or later 16 | { 17 | return new MonitorBrightnessControlWMI(); 18 | } 19 | else // XP or older has no support of WMI 20 | { 21 | return null; 22 | } 23 | } 24 | #region IDisposable member 25 | 26 | public abstract void Dispose(); 27 | 28 | #endregion 29 | } 30 | 31 | public class MonitorBrightnessControlWMI : MonitorBrightnessControl 32 | { 33 | private Byte _curBrightness; 34 | private Byte[] _brTable; 35 | private UInt32 levels; 36 | 37 | public MonitorBrightnessControlWMI() 38 | { 39 | 40 | using (var _Brightness = 41 | new ManagementClass("root/wmi", "WmiMonitorBrightness", null)) 42 | using (var _BrightnessMethods = 43 | new ManagementClass("root/wmi", "WmiMonitorBrightnessMethods", null)) 44 | { 45 | foreach (ManagementObject mo in _Brightness.GetInstances()) 46 | { 47 | levels = (UInt32)mo["Levels"]; 48 | if (levels <= 0) 49 | { 50 | break; 51 | } 52 | _brTable = new Byte[levels]; 53 | _brTable = (Byte[])mo["Level"]; 54 | } 55 | } 56 | } 57 | 58 | 59 | public override void BrightnessUp() 60 | { 61 | 62 | GetBrightness(); 63 | 64 | int i; 65 | for (i = 0; i < levels - 1 && _brTable[i] <= _curBrightness; i++) 66 | { 67 | ; 68 | } 69 | SetBrightness(_brTable[i]); 70 | } 71 | 72 | public override void BrightnessDown() 73 | { 74 | 75 | GetBrightness(); 76 | 77 | int i; 78 | for (i = (int)levels - 1; i > 0 && _brTable[i] >= _curBrightness; i--) 79 | { 80 | ; 81 | } 82 | SetBrightness(_brTable[i]); 83 | } 84 | 85 | public void GetBrightness() 86 | { 87 | using (var _Brightness = 88 | new ManagementClass("root/wmi", "WmiMonitorBrightness", null)) 89 | using (var _BrightnessMethods = 90 | new ManagementClass("root/wmi", "WmiMonitorBrightnessMethods", null)) 91 | { 92 | foreach (ManagementObject mo in _Brightness.GetInstances()) 93 | { 94 | _curBrightness = (Byte)mo["CurrentBrightness"]; 95 | break; //get first result only 96 | } 97 | } 98 | } 99 | 100 | public void SetBrightness(Byte brightness) 101 | { 102 | 103 | using (var _Brightness = 104 | new ManagementClass("root/wmi", "WmiMonitorBrightness", null)) 105 | using (var _BrightnessMethods = 106 | new ManagementClass("root/wmi", "WmiMonitorBrightnessMethods", null)) 107 | using (var inParams = _BrightnessMethods.GetMethodParameters("WmiSetBrightness")) 108 | { 109 | foreach (ManagementObject mo in _BrightnessMethods.GetInstances()) 110 | { 111 | inParams["Brightness"] = brightness; // set brightness to brightness % 112 | inParams["Timeout"] = 1; 113 | mo.InvokeMethod("WmiSetBrightness", inParams, null); 114 | break; 115 | } 116 | } 117 | } 118 | 119 | #region iDisposable member 120 | public override void Dispose() 121 | { 122 | // Marshal.ReleaseComObject(_Brightness); 123 | // _Brightness.Dispose(); 124 | // Marshal.ReleaseComObject(_BrightnessMethods); 125 | // _BrightnessMethods = null; 126 | } 127 | 128 | #endregion\ 129 | } 130 | } 131 | -------------------------------------------------------------------------------- /MonitorBrightnessControl/MonitorBrightnessControlLibrary.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Debug 5 | AnyCPU 6 | 9.0.30729 7 | 2.0 8 | {E7997027-6A1A-4C0E-95C7-143A3CC7FC92} 9 | Library 10 | Properties 11 | MonitorBrightnessControlLibrary 12 | MonitorBrightnessControlLibrary 13 | v2.0 14 | 512 15 | 16 | 17 | 18 | 19 | 3.5 20 | 21 | 22 | true 23 | full 24 | false 25 | bin\Debug\ 26 | DEBUG;TRACE 27 | prompt 28 | 4 29 | 30 | 31 | pdbonly 32 | true 33 | bin\Release\ 34 | TRACE 35 | prompt 36 | 4 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 56 | -------------------------------------------------------------------------------- /MonitorBrightnessControl/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // アセンブリに関する一般情報は以下の属性セットをとおして制御されます。 6 | // アセンブリに関連付けられている情報を変更するには、 7 | // これらの属性値を変更してください。 8 | [assembly: AssemblyTitle("Monitor Brightness Control Library")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("Monitor Brightness Control Library")] 13 | [assembly: AssemblyCopyright("Copyright © 2016")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // ComVisible を false に設定すると、その型はこのアセンブリ内で COM コンポーネントから 18 | // 参照不可能になります。COM からこのアセンブリ内の型にアクセスする場合は、 19 | // その型の ComVisible 属性を true に設定してください。 20 | [assembly: ComVisible(false)] 21 | 22 | // 次の GUID は、このプロジェクトが COM に公開される場合の、typelib の ID です 23 | [assembly: Guid("fb90ac18-2df3-4616-baba-194009d1ade2")] 24 | 25 | // アセンブリのバージョン情報は、以下の 4 つの値で構成されています: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // すべての値を指定するか、下のように '*' を使ってビルドおよびリビジョン番号を 33 | // 既定値にすることができます: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /Package.proj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Misuzilla.Applications.AppleWirelessKeyboardHelper\bin\x86\Release 7 | Package 8 | 9 | 10 | 11 | 12 | $(MSBuildExtensionsPath)\MSBuildCommunityTasks 13 | $(MSBuildProjectDirectory)\MSBuildTasks 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 34 | 35 | 36 | 37 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 54 | 55 | 56 | 60 | 61 | --------------------------------------------------------------------------------