UseGettext
WindowLocaleTitle {Keyboard Setup}
WindowSize 365 265		# Taille
Font "xft:monospace:pixelsize=11;"

Init
 Begin
  WarpPointer 2
  Set $FILE=(GetScriptArgument 1)
  If $FILE=={} Then
   Set $FILE={.xinitrc-fvwm}

  Set $pos=0
  Set $finish=1
  While $finish=={1} Do
  Begin
    Set $pos=(Add $pos 1)
    Set $tmp=(GetOutput {xset -q} $pos 1)
    If $tmp=={auto} Then
      Set $finish=0
    If $pos=={50} Then
      Set $finish=0
  End
  If $pos=={50} Then
  Begin
   Do {Exec sh -c "echo 'KeyboardSetup: uncompatible xset'"}
   Quit
  End
  ChangeValue 4 (GetOutput  {xset -q} $pos 7)
  If (GetOutput  {xset -q } $pos 3)==on Then
   ChangeValue 6 1
  Set $pos=(Add $pos 1)
  ChangeTitle 7 (GetOutput  {xset -q} $pos 4)
  ChangeTitle 9 (GetOutput  {xset -q} $pos 7)
 End
 
Widget 1
Property
 Size 85 20
 Position 30 225
 Flags NoReliefString
 Type PushButton
 LocaleTitle {Apply}
Main
 Case message of
  SingleClic :
  Begin
   Do {Exec xset c } (GetValue 4)
   If (GetValue 6) == 1 Then
    Do {Exec xset r on r rate } (GetTitle 7) { } (GetTitle 9)
   Else
    Do {Exec xset r off}
  End
End

Widget 2
Property
 Size 85 25
 Position 140 225
 Flags NoReliefString
 Type PushButton
 LocaleTitle {Save}
Main
 Case message of
  SingleClic :
  Begin
   Do {Exec xset c } (GetValue 4)
   If (GetValue 6) == 1 Then
   Begin
    Do {Exec xset r on r rate }  (GetTitle 7) { } (GetTitle 9)
    WriteToFile $FILE {xset r on r rate }  (GetTitle 7) { } (GetTitle 9) { c } (GetValue 4)
   End
   Else
   Begin
    Do {Exec xset r off}
    WriteToFile $FILE {xset r off c } (GetValue 4)
   End
   Do {Exec chmod +x ~/} $FILE
   #Quit
  End
End

Widget 3
Property
 Size 85 25
 Position 250 225
 Flags NoReliefString
 Type PushButton
 LocaleTitle {Quit}
Main
 Case message of
  SingleClic :
  Begin
   Quit
  End
End

Widget 4
Property
 Size 300 1
 Position 35 145
 Flags NoReliefString
 Type HScrollBar
 MinValue 0
 MaxValue 100
 Value 0
Main
 Case message of
  SingleClic :
  Begin
  End
End

Widget 5
Property
 Position 30 125
 Size 300 20 
 Flags NoReliefString NoFocus Center
 Type ItemDraw
 LocaleTitle {Click Volume (%)}
Main
 Case message of
  SingleClic :
  Begin
  End
End

Widget 6
Property
 Position 30 30
 Flags NoReliefString
 Type CheckBox
 LocaleTitle {AutoRepeat On}
Main
 Case message of
  SingleClic :
  Begin
  End
End

Widget 7
Property
 Size 60 1
 Position 220 60
 Flags NoReliefString
 Type TextField
Main
 Case message of
  SingleClic :
  Begin
  End
End

Widget 8
Property
 Position 40 65
 Flags NoReliefString NoFocus
 Type ItemDraw
 LocaleTitle {Start Delay:  }
Main
 Case message of
  SingleClic :
  Begin
  End
End

Widget 9
Property
 Size 60 1
 Position 220 90
 Flags NoReliefString
 Type TextField
Main
 Case message of
  SingleClic :
  Begin
  End
End

Widget 10
Property
 Position 40 95
 Flags NoReliefString NoFocus
 Type ItemDraw
 LocaleTitle {Repeat Delay:}
Main
 Case message of
  SingleClic :
  Begin
  End
End

Widget 11
Property
 Size 345 205
 Position 10 10
 Type Rectangle
Main
 Case message of
  SingleClic :
  Begin
  End
End

Widget 12
Property
 Position 15 3
 Flags NoReliefString NoFocus
 Type ItemDraw
 LocaleTitle {Keyboard}
Main
 Case message of
  SingleClic :
  Begin
  End
End












