linux 屏蔽win+D切换到桌面的解决方案

利用了2天解决的;qt的具体实现方式如下:

屏蔽:
    QString filename = "/home/secadm/.Shield";        //当前文件夹中
    QString str = "remove mod4 = Super_L \nkeysym Super_L = Home \nkeysym Home =Super_L \nadd mod4 = Super_L\n";  //保存的文本内容
    str += "remove mod4 = Super_R \nkeycode 134 = End \nadd mod4 = Super_R\n";
    QFile file(filename);
    if(!file.open(QIODevice::ReadWrite|QIODevice::Text))
    {
       //QMessageBox::warning(this,"file write","can't open",QMessageBox::Yes);
    }
    QTextStream in(&file);
    in<    file.close();
    QProcess::execute("xmodmap /home/secadm/.Shield");
打开:
    QString filename = "/home/secadm/.Open";        //当前文件夹中
    QString str = "remove mod4 = Super_L \nkeysym Super_L = Home \nkeysym Home =Super_L \nadd mod4 = Super_L\n";  //保存的文本内容
    str += "keycode 134 = Super_R \nadd mod4 = Super_R";
    QFile file(filename);
    if(!file.open(QIODevice::ReadWrite|QIODevice::Text))
    {
      //QMessageBox::warning(this,"file write","can't open",QMessageBox::Yes);
    }
     QTextStream in(&file);
     in<     file.close();
     QProcess::execute("xmodmap /home/secadm/.Open");

你可能感兴趣的:(linux 屏蔽win+D切换到桌面的解决方案)