@@ -120,37 +120,16 @@ bool Launcher::run(std::string collection, Item *collectionItem)
120120 selectedItemsDirectory,
121121 collection);
122122
123- /* Apply key mapping for selected item's directory if found */
124- std::string selectedItemDirnameKeyfile = Utils::getDirectory (selectedItemsPath) + " /default_config.key " ;
125- if (! access (selectedItemDirnameKeyfile. c_str (), R_OK)) {
123+ /* Create shell cmd */
124+ std::string cmd = SHELL_CMD_MAPPING_ROM ;
125+ cmd += " \" " + selectedItemsPath + " \" " ;
126126
127- /* Create shell cmd */
128- std::string cmd = SHELL_CMD_MAPPING_SET;
129- cmd += " " + selectedItemDirnameKeyfile;
130-
131- /* Log shell cmd */
132- Logger::write (Logger::ZONE_INFO, " Launcher" , " Applying keymap file: " + selectedItemDirnameKeyfile);
133- printf (" Applying keymap file cmd: \" %s\"\n " , cmd.c_str ());
134-
135- /* Launch shell cmd */
136- system (cmd.c_str ());
137- }
138-
139- /* Apply specific key mapping for selected item if found */
140- std::string selectedItemBasenameKeyfile = Utils::removeExtension (selectedItemsPath) + " .key" ;
141- if (!access (selectedItemBasenameKeyfile.c_str (), R_OK)) {
142-
143- /* Create shell cmd */
144- std::string cmd = SHELL_CMD_MAPPING_SET;
145- cmd += " " + selectedItemBasenameKeyfile;
146-
147- /* Log shell cmd */
148- Logger::write (Logger::ZONE_INFO, " Launcher" , " Applying keymap file: " + selectedItemBasenameKeyfile);
149- printf (" Applying keymap file cmd: \" %s\"\n " , cmd.c_str ());
127+ /* Log shell cmd */
128+ Logger::write (Logger::ZONE_INFO, " Launcher" , " Applying keymap rom: " + selectedItemsPath);
129+ printf (" Applying keymap rom cmd: \" %s\"\n " , cmd.c_str ());
150130
151- /* Launch shell cmd */
152- system (cmd.c_str ());
153- }
131+ /* Launch shell cmd */
132+ system (cmd.c_str ());
154133
155134 /* Restart audio amp */
156135 system (SHELL_CMD_TURN_AMPLI_ON);
@@ -165,8 +144,12 @@ bool Launcher::run(std::string collection, Item *collectionItem)
165144 /* Stop audio amp */
166145 system (SHELL_CMD_TURN_AMPLI_OFF);
167146
168- /* Reset default key mapping */
169- system (SHELL_CMD_MAPPING_RESET);
147+ /* Log shell cmd */
148+ Logger::write (Logger::ZONE_INFO, " Launcher" , " Applying keymap default" );
149+ printf (" Applying keymap default cmd: \" %s\"\n " , SHELL_CMD_MAPPING_DEFAULT);
150+
151+ /* Restore default key mapping */
152+ system (SHELL_CMD_MAPPING_DEFAULT);
170153
171154 /* Restore stored PID */
172155 char shellCmd[20 ];
0 commit comments