Open hologerry opened 8 years ago
同求。 Mac下用了一个tricky的办法,在本地改了代码实现。
文件:
/Applications/Electronic WeChat.app/Contents/Resources/app/src/inject-preload.js
增加:
// change to cmd+enter send message
injectBundle.updateBindingOfSendingMessage = () => {
var bind_sending_message = () => {
$('.action>[ng-if="isMacOS"]').html('Cmd+Enter to Send :)');
$('#editArea').off('keydown').on('keydown', function(e) {
if (e.which === 13) {
if (e.metaKey) {
$('.btn_send').trigger('click');
}
e.preventDefault();
}
});
};
var bind_textarea_focus = () => {
$('#editArea').off('focus').on('focus', function(e) {
bind_sending_message();
});
}
// 当页面点击的时候,执行
$('body').on('click', function() {
// bind_sending_message();
bind_textarea_focus();
});
};
文件:
/Applications/Electronic WeChat.app/Contents/Resources/app/src/main.js
在
browserWindow.webContents.executeJavaScript(`injectBundle.getBadgeJS()`);
下面增加一行:
browserWindow.webContents.executeJavaScript(`injectBundle.updateBindingOfSendingMessage()`);
不是实现功能的问题…要等到Control Panel写出来之后才可以添加…
同求哈
同求 +1
Feature request 希望能加上cmd+return发送或者return发送消息的设置