@@ -307,6 +307,15 @@ struct Keys {
307307        static  let  keepAspectRatio =  " General.FullscreenKeepAspectRatio " 
308308        static  let  exitOnEsc =  " General.FullscreenExitOnEsc " 
309309
310+         // Mouse
311+         static  let  retainMouseKeyComb =  " General.RetainMouseKeyComb " 
312+         static  let  retainMouseWithKeys =  " General.RetainMouseWithKeys " 
313+         static  let  retainMouseByClick =  " General.RetainMouseByClick " 
314+         static  let  retainMouseByEntering =  " General.RetainMouseByEntering " 
315+         static  let  releaseMouseKeyComb =  " General.ReleaseMouseKeyComb " 
316+         static  let  releaseMouseWithKeys =  " General.ReleaseMouseWithKeys " 
317+         static  let  releaseMouseByShaking =  " General.ReleaseMouseByShaking " 
318+ 
310319        // Miscellaneous
311320        static  let  ejectWithoutAsking =  " General.EjectWithoutAsking " 
312321        static  let  detachWithoutAsking =  " General.DetachWithoutAsking " 
@@ -326,6 +335,15 @@ extension DefaultsProxy {
326335        register ( Keys . Gen. keepAspectRatio,  false ) 
327336        register ( Keys . Gen. exitOnEsc,  true ) 
328337
338+         // Mouse
339+         register ( Keys . Gen. retainMouseKeyComb,  0 ) 
340+         register ( Keys . Gen. retainMouseWithKeys,  true ) 
341+         register ( Keys . Gen. retainMouseByClick,  true ) 
342+         register ( Keys . Gen. retainMouseByEntering,  false ) 
343+         register ( Keys . Gen. releaseMouseKeyComb,  0 ) 
344+         register ( Keys . Gen. releaseMouseWithKeys,  true ) 
345+         register ( Keys . Gen. releaseMouseByShaking,  true ) 
346+ 
329347        // Misc
330348        register ( Keys . Gen. ejectWithoutAsking,  false ) 
331349        register ( Keys . Gen. detachWithoutAsking,  false ) 
@@ -340,6 +358,14 @@ extension DefaultsProxy {
340358        let  keys  =  [  Keys . Gen. keepAspectRatio, 
341359                     Keys . Gen. exitOnEsc, 
342360
361+                      Keys . Gen. retainMouseKeyComb, 
362+                      Keys . Gen. retainMouseWithKeys, 
363+                      Keys . Gen. retainMouseByClick, 
364+                      Keys . Gen. retainMouseByEntering, 
365+                      Keys . Gen. releaseMouseKeyComb, 
366+                      Keys . Gen. releaseMouseWithKeys, 
367+                      Keys . Gen. releaseMouseByShaking, 
368+ 
343369                     Keys . Gen. ejectWithoutAsking, 
344370                     Keys . Gen. detachWithoutAsking, 
345371                     Keys . Gen. closeWithoutAsking, 
@@ -361,6 +387,14 @@ extension Preferences {
361387        defaults. set ( Keys . Gen. keepAspectRatio,  keepAspectRatio) 
362388        defaults. set ( Keys . Gen. exitOnEsc,  exitOnEsc) 
363389
390+         defaults. set ( Keys . Gen. retainMouseKeyComb,  retainMouseKeyComb) 
391+         defaults. set ( Keys . Gen. retainMouseWithKeys,  retainMouseWithKeys) 
392+         defaults. set ( Keys . Gen. retainMouseByClick,  retainMouseByClick) 
393+         defaults. set ( Keys . Gen. retainMouseByEntering,  retainMouseByEntering) 
394+         defaults. set ( Keys . Gen. releaseMouseKeyComb,  releaseMouseKeyComb) 
395+         defaults. set ( Keys . Gen. releaseMouseWithKeys,  releaseMouseWithKeys) 
396+         defaults. set ( Keys . Gen. releaseMouseByShaking,  releaseMouseByShaking) 
397+ 
364398        defaults. set ( Keys . Gen. ejectWithoutAsking,  ejectWithoutAsking) 
365399        defaults. set ( Keys . Gen. detachWithoutAsking,  detachWithoutAsking) 
366400        defaults. set ( Keys . Gen. closeWithoutAsking,  closeWithoutAsking) 
@@ -377,6 +411,14 @@ extension Preferences {
377411        keepAspectRatio =  defaults. bool ( Keys . Gen. keepAspectRatio) 
378412        exitOnEsc =  defaults. bool ( Keys . Gen. exitOnEsc) 
379413
414+         retainMouseKeyComb =  defaults. int ( Keys . Gen. retainMouseKeyComb) 
415+         retainMouseWithKeys =  defaults. bool ( Keys . Gen. retainMouseWithKeys) 
416+         retainMouseByClick =  defaults. bool ( Keys . Gen. retainMouseByClick) 
417+         retainMouseByEntering =  defaults. bool ( Keys . Gen. retainMouseByEntering) 
418+         releaseMouseKeyComb =  defaults. int ( Keys . Gen. releaseMouseKeyComb) 
419+         releaseMouseWithKeys =  defaults. bool ( Keys . Gen. releaseMouseWithKeys) 
420+         releaseMouseByShaking =  defaults. bool ( Keys . Gen. releaseMouseByShaking) 
421+ 
380422        ejectWithoutAsking =  defaults. bool ( Keys . Gen. ejectWithoutAsking) 
381423        detachWithoutAsking =  defaults. bool ( Keys . Gen. detachWithoutAsking) 
382424        closeWithoutAsking =  defaults. bool ( Keys . Gen. closeWithoutAsking) 
@@ -504,15 +546,6 @@ extension Keys {
504546        static  let  autofireBursts =  " Controls.AutofireBursts " 
505547        static  let  autofireBullets =  " Controls.AutofireBullets " 
506548        static  let  autofireFrequency =  " Controls.AutofireFrequency " 
507-         
508-         // Mouse
509-         static  let  retainMouseKeyComb =  " Controls.RetainMouseKeyComb " 
510-         static  let  retainMouseWithKeys =  " Controls.RetainMouseWithKeys " 
511-         static  let  retainMouseByClick =  " Controls.RetainMouseByClick " 
512-         static  let  retainMouseByEntering =  " Controls.RetainMouseByEntering " 
513-         static  let  releaseMouseKeyComb =  " Controls.ReleaseMouseKeyComb " 
514-         static  let  releaseMouseWithKeys =  " Controls.ReleaseMouseWithKeys " 
515-         static  let  releaseMouseByShaking =  " Controls.ReleaseMouseByShaking " 
516549    } 
517550} 
518551
@@ -554,15 +587,6 @@ extension DefaultsProxy {
554587        register ( Keys . Con. autofireBursts,  false ) 
555588        register ( Keys . Con. autofireBullets,  3 ) 
556589        register ( Keys . Con. autofireFrequency,  25 ) 
557- 
558-         // Mouse
559-         register ( Keys . Con. retainMouseKeyComb,  0 ) 
560-         register ( Keys . Con. retainMouseWithKeys,  true ) 
561-         register ( Keys . Con. retainMouseByClick,  true ) 
562-         register ( Keys . Con. retainMouseByEntering,  false ) 
563-         register ( Keys . Con. releaseMouseKeyComb,  0 ) 
564-         register ( Keys . Con. releaseMouseWithKeys,  true ) 
565-         register ( Keys . Con. releaseMouseByShaking,  true ) 
566590    } 
567591
568592    func  removeControlsUserDefaults( )  { 
@@ -576,15 +600,7 @@ extension DefaultsProxy {
576600
577601                     Keys . Con. autofire, 
578602                     Keys . Con. autofireBullets, 
579-                      Keys . Con. autofireFrequency, 
580-                      
581-                      Keys . Con. retainMouseKeyComb, 
582-                      Keys . Con. retainMouseWithKeys, 
583-                      Keys . Con. retainMouseByClick, 
584-                      Keys . Con. retainMouseByEntering, 
585-                      Keys . Con. releaseMouseKeyComb, 
586-                      Keys . Con. releaseMouseWithKeys, 
587-                      Keys . Con. releaseMouseByShaking ] 
603+                      Keys . Con. autofireFrequency ] 
588604
589605        for  key  in  keys {  removeKey ( key)  } 
590606    } 
@@ -608,14 +624,6 @@ extension Preferences {
608624        defaults. set ( Keys . Con. autofireBullets,  autofireBullets) 
609625        defaults. set ( Keys . Con. autofireFrequency,  autofireFrequency) 
610626
611-         defaults. set ( Keys . Con. retainMouseKeyComb,  retainMouseKeyComb) 
612-         defaults. set ( Keys . Con. retainMouseWithKeys,  retainMouseWithKeys) 
613-         defaults. set ( Keys . Con. retainMouseByClick,  retainMouseByClick) 
614-         defaults. set ( Keys . Con. retainMouseByEntering,  retainMouseByEntering) 
615-         defaults. set ( Keys . Con. releaseMouseKeyComb,  releaseMouseKeyComb) 
616-         defaults. set ( Keys . Con. releaseMouseWithKeys,  releaseMouseWithKeys) 
617-         defaults. set ( Keys . Con. releaseMouseByShaking,  releaseMouseByShaking) 
618-         
619627        defaults. save ( ) 
620628    } 
621629
@@ -633,14 +641,6 @@ extension Preferences {
633641        autofireBursts =  defaults. bool ( Keys . Con. autofireBursts) 
634642        autofireBullets =  defaults. int ( Keys . Con. autofireBullets) 
635643        autofireFrequency =  defaults. int ( Keys . Con. autofireFrequency) 
636- 
637-         retainMouseKeyComb =  defaults. int ( Keys . Con. retainMouseKeyComb) 
638-         retainMouseWithKeys =  defaults. bool ( Keys . Con. retainMouseWithKeys) 
639-         retainMouseByClick =  defaults. bool ( Keys . Con. retainMouseByClick) 
640-         retainMouseByEntering =  defaults. bool ( Keys . Con. retainMouseByEntering) 
641-         releaseMouseKeyComb =  defaults. int ( Keys . Con. releaseMouseKeyComb) 
642-         releaseMouseWithKeys =  defaults. bool ( Keys . Con. releaseMouseWithKeys) 
643-         releaseMouseByShaking =  defaults. bool ( Keys . Con. releaseMouseByShaking) 
644644    } 
645645} 
646646
0 commit comments