home *** CD-ROM | disk | FTP | other *** search
/ Caldera Network Desktop 1.0 / caldera-network-desktop-1.0.bin / images / ramdisk2-beta.img / usr / lib / perl / keyboard < prev    next >
Text File  |  1995-12-04  |  920b  |  55 lines

  1. # keyboard config -*-perl-*-
  2.  
  3. $keyboard = "";
  4. $keytablesloc = "/usr/lib/kbd/keytables";
  5.  
  6. sub configure_keyboard {
  7.     local ( @maps );
  8.  
  9.     opendir(DIR, "$fsmount$keytablesloc");
  10.     @maps = reverse sort grep(/\.map$/, readdir(DIR));
  11.     closedir(DIR);
  12.  
  13.     if (@maps == 0) {
  14.         &rhs_msgbox("Error",
  15. <<EOM
  16. >
  17. No keytables found in $fsmount$keytablesloc !
  18. >
  19. Are you sure you have installed the base system?
  20. EOM
  21.                      , 60);
  22.         return 0;
  23.     }
  24.  
  25.     if (! &rhs_menul("Keyboard Configuration",
  26. <<EOM
  27. >
  28. Select a keymap.
  29. >
  30. EOM
  31.              , 50, scalar(@maps), @maps)) {
  32.     return 0;
  33.     }
  34.  
  35.     $keyboard = $dialog_result;
  36.  
  37.     return 1;
  38. }
  39.  
  40. # This is used to select and load a keyboard mapping for
  41. # the install procedure
  42.  
  43. sub finish_keyboard {
  44.  
  45.     open(FD, ">$fsmount/etc/sysconfig/keyboard");
  46.     print FD "KEYTABLE=\"$keytablesloc/$keyboard\"\n";
  47.     close FD;
  48.  
  49.     return 1;
  50. }
  51.  
  52. ####################
  53. 1;
  54.