mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2026-02-01 13:15:46 +01:00
Update mapping definitions for Melodactyl and Teledactyl to use Args object.
This commit is contained in:
@@ -688,7 +688,7 @@ const Player = Module("player", {
|
|||||||
|
|
||||||
mappings.add([modes.PLAYER],
|
mappings.add([modes.PLAYER],
|
||||||
["z"], "Previous track",
|
["z"], "Previous track",
|
||||||
function (count) { ex.playerprev({ "#": count }); },
|
function (args) { ex.playerprev({ "#": args.count }); },
|
||||||
{ count: true });
|
{ count: true });
|
||||||
|
|
||||||
mappings.add([modes.PLAYER],
|
mappings.add([modes.PLAYER],
|
||||||
@@ -697,7 +697,7 @@ const Player = Module("player", {
|
|||||||
|
|
||||||
mappings.add([modes.PLAYER],
|
mappings.add([modes.PLAYER],
|
||||||
["b"], "Next track",
|
["b"], "Next track",
|
||||||
function (count) { ex.playernext({ "#": count }); },
|
function (args) { ex.playernext({ "#": args.count }); },
|
||||||
{ count: true });
|
{ count: true });
|
||||||
|
|
||||||
mappings.add([modes.PLAYER],
|
mappings.add([modes.PLAYER],
|
||||||
@@ -726,22 +726,22 @@ const Player = Module("player", {
|
|||||||
|
|
||||||
mappings.add([modes.PLAYER],
|
mappings.add([modes.PLAYER],
|
||||||
["h", "<Left>"], "Seek -10s",
|
["h", "<Left>"], "Seek -10s",
|
||||||
function (count) { player.seekBackward(Math.max(1, count) * 10000); },
|
function (args) { player.seekBackward(Math.max(1, args.count) * 10000); },
|
||||||
{ count: true });
|
{ count: true });
|
||||||
|
|
||||||
mappings.add([modes.PLAYER],
|
mappings.add([modes.PLAYER],
|
||||||
["l", "<Right>"], "Seek +10s",
|
["l", "<Right>"], "Seek +10s",
|
||||||
function (count) { player.seekForward(Math.max(1, count) * 10000); },
|
function (args) { player.seekForward(Math.max(1, args.count) * 10000); },
|
||||||
{ count: true });
|
{ count: true });
|
||||||
|
|
||||||
mappings.add([modes.PLAYER],
|
mappings.add([modes.PLAYER],
|
||||||
["H", "<S-Left>"], "Seek -1m",
|
["H", "<S-Left>"], "Seek -1m",
|
||||||
function (count) { player.seekBackward(Math.max(1, count) * 60000); },
|
function (args) { player.seekBackward(Math.max(1, args.count) * 60000); },
|
||||||
{ count: true });
|
{ count: true });
|
||||||
|
|
||||||
mappings.add([modes.PLAYER],
|
mappings.add([modes.PLAYER],
|
||||||
["L", "<S-Right>"], "Seek +1m",
|
["L", "<S-Right>"], "Seek +1m",
|
||||||
function (count) { player.seekForward(Math.max(1, count) * 60000); },
|
function (args) { player.seekForward(Math.max(1, args.count) * 60000); },
|
||||||
{ count: true });
|
{ count: true });
|
||||||
|
|
||||||
mappings.add([modes.PLAYER],
|
mappings.add([modes.PLAYER],
|
||||||
@@ -754,7 +754,7 @@ const Player = Module("player", {
|
|||||||
|
|
||||||
mappings.add([modes.PLAYER],
|
mappings.add([modes.PLAYER],
|
||||||
["/"], "Search forward for a track",
|
["/"], "Search forward for a track",
|
||||||
function (args) { commandline.open("/", "", modes.SEARCH_VIEW_FORWARD); });
|
function () { commandline.open("/", "", modes.SEARCH_VIEW_FORWARD); });
|
||||||
|
|
||||||
mappings.add([modes.PLAYER],
|
mappings.add([modes.PLAYER],
|
||||||
["n"], "Find the next track",
|
["n"], "Find the next track",
|
||||||
|
|||||||
@@ -527,40 +527,40 @@ const Mail = Module("mail", {
|
|||||||
|
|
||||||
mappings.add(myModes, ["j", "<Right>"],
|
mappings.add(myModes, ["j", "<Right>"],
|
||||||
"Select next message",
|
"Select next message",
|
||||||
function (count) { mail.selectMessage(function (msg) true, false, false, false, count); },
|
function (args) { mail.selectMessage(function (msg) true, false, false, false, args.count); },
|
||||||
{ count: true });
|
{ count: true });
|
||||||
|
|
||||||
mappings.add(myModes, ["gj"],
|
mappings.add(myModes, ["gj"],
|
||||||
"Select next message, including closed threads",
|
"Select next message, including closed threads",
|
||||||
function (count) { mail.selectMessage(function (msg) true, false, true, false, count); },
|
function (args) { mail.selectMessage(function (msg) true, false, true, false, args.count); },
|
||||||
{ count: true });
|
{ count: true });
|
||||||
|
|
||||||
mappings.add(myModes, ["J", "<Tab>"],
|
mappings.add(myModes, ["J", "<Tab>"],
|
||||||
"Select next unread message",
|
"Select next unread message",
|
||||||
function (count) { mail.selectMessage(function (msg) !msg.isRead, true, true, false, count); },
|
function (args) { mail.selectMessage(function (msg) !msg.isRead, true, true, false, args.count); },
|
||||||
{ count: true });
|
{ count: true });
|
||||||
|
|
||||||
mappings.add(myModes, ["k", "<Left>"],
|
mappings.add(myModes, ["k", "<Left>"],
|
||||||
"Select previous message",
|
"Select previous message",
|
||||||
function (count) { mail.selectMessage(function (msg) true, false, false, true, count); },
|
function (args) { mail.selectMessage(function (msg) true, false, false, true, args.count); },
|
||||||
{ count: true });
|
{ count: true });
|
||||||
|
|
||||||
mappings.add(myModes, ["gk"],
|
mappings.add(myModes, ["gk"],
|
||||||
"Select previous message",
|
"Select previous message",
|
||||||
function (count) { mail.selectMessage(function (msg) true, false, true, true, count); },
|
function (args) { mail.selectMessage(function (msg) true, false, true, true, args.count); },
|
||||||
{ count: true });
|
{ count: true });
|
||||||
|
|
||||||
mappings.add(myModes, ["K"],
|
mappings.add(myModes, ["K"],
|
||||||
"Select previous unread message",
|
"Select previous unread message",
|
||||||
function (count) { mail.selectMessage(function (msg) !msg.isRead, true, true, true, count); },
|
function (args) { mail.selectMessage(function (msg) !msg.isRead, true, true, true, args.count); },
|
||||||
{ count: true });
|
{ count: true });
|
||||||
|
|
||||||
mappings.add(myModes, ["*"],
|
mappings.add(myModes, ["*"],
|
||||||
"Select next message from the same sender",
|
"Select next message from the same sender",
|
||||||
function (count) {
|
function (args) {
|
||||||
try {
|
try {
|
||||||
let author = gDBView.hdrForFirstSelectedMessage.mime2DecodedAuthor.toLowerCase();
|
let author = gDBView.hdrForFirstSelectedMessage.mime2DecodedAuthor.toLowerCase();
|
||||||
mail.selectMessage(function (msg) msg.mime2DecodedAuthor.toLowerCase().indexOf(author) == 0, true, true, false, count);
|
mail.selectMessage(function (msg) msg.mime2DecodedAuthor.toLowerCase().indexOf(author) == 0, true, true, false, args.count);
|
||||||
}
|
}
|
||||||
catch (e) { dactyl.beep(); }
|
catch (e) { dactyl.beep(); }
|
||||||
},
|
},
|
||||||
@@ -568,10 +568,10 @@ const Mail = Module("mail", {
|
|||||||
|
|
||||||
mappings.add(myModes, ["#"],
|
mappings.add(myModes, ["#"],
|
||||||
"Select previous message from the same sender",
|
"Select previous message from the same sender",
|
||||||
function (count) {
|
function (args) {
|
||||||
try {
|
try {
|
||||||
let author = gDBView.hdrForFirstSelectedMessage.mime2DecodedAuthor.toLowerCase();
|
let author = gDBView.hdrForFirstSelectedMessage.mime2DecodedAuthor.toLowerCase();
|
||||||
mail.selectMessage(function (msg) msg.mime2DecodedAuthor.toLowerCase().indexOf(author) == 0, true, true, true, count);
|
mail.selectMessage(function (msg) msg.mime2DecodedAuthor.toLowerCase().indexOf(author) == 0, true, true, true, args.count);
|
||||||
}
|
}
|
||||||
catch (e) { dactyl.beep(); }
|
catch (e) { dactyl.beep(); }
|
||||||
},
|
},
|
||||||
@@ -613,22 +613,22 @@ const Mail = Module("mail", {
|
|||||||
// SCROLLING
|
// SCROLLING
|
||||||
mappings.add(myModes, ["<Down>"],
|
mappings.add(myModes, ["<Down>"],
|
||||||
"Scroll message down",
|
"Scroll message down",
|
||||||
function (count) { buffer.scrollLines(Math.max(count, 1)); },
|
function (args) { buffer.scrollLines(Math.max(args.count, 1)); },
|
||||||
{ count: true });
|
{ count: true });
|
||||||
|
|
||||||
mappings.add(myModes, ["<Up>"],
|
mappings.add(myModes, ["<Up>"],
|
||||||
"Scroll message up",
|
"Scroll message up",
|
||||||
function (count) { buffer.scrollLines(-Math.max(count, 1)); },
|
function (args) { buffer.scrollLines(-Math.max(args.count, 1)); },
|
||||||
{ count: true });
|
{ count: true });
|
||||||
|
|
||||||
mappings.add([modes.MESSAGE], ["<Left>"],
|
mappings.add([modes.MESSAGE], ["<Left>"],
|
||||||
"Select previous message",
|
"Select previous message",
|
||||||
function (count) { mail.selectMessage(function (msg) true, false, false, true, count); },
|
function (args) { mail.selectMessage(function (msg) true, false, false, true, args.count); },
|
||||||
{ count: true });
|
{ count: true });
|
||||||
|
|
||||||
mappings.add([modes.MESSAGE], ["<Right>"],
|
mappings.add([modes.MESSAGE], ["<Right>"],
|
||||||
"Select next message",
|
"Select next message",
|
||||||
function (count) { mail.selectMessage(function (msg) true, false, false, false, count); },
|
function (args) { mail.selectMessage(function (msg) true, false, false, false, args.count); },
|
||||||
{ count: true });
|
{ count: true });
|
||||||
|
|
||||||
// UNDO/REDO
|
// UNDO/REDO
|
||||||
@@ -677,29 +677,29 @@ const Mail = Module("mail", {
|
|||||||
|
|
||||||
mappings.add(myModes, ["]s"],
|
mappings.add(myModes, ["]s"],
|
||||||
"Select next starred message",
|
"Select next starred message",
|
||||||
function (count) { mail.selectMessage(function (msg) msg.isFlagged, true, true, false, count); },
|
function (args) { mail.selectMessage(function (msg) msg.isFlagged, true, true, false, args.count); },
|
||||||
{ count: true });
|
{ count: true });
|
||||||
|
|
||||||
mappings.add(myModes, ["[s"],
|
mappings.add(myModes, ["[s"],
|
||||||
"Select previous starred message",
|
"Select previous starred message",
|
||||||
function (count) { mail.selectMessage(function (msg) msg.isFlagged, true, true, true, count); },
|
function (args) { mail.selectMessage(function (msg) msg.isFlagged, true, true, true, args.count); },
|
||||||
{ count: true });
|
{ count: true });
|
||||||
|
|
||||||
mappings.add(myModes, ["]a"],
|
mappings.add(myModes, ["]a"],
|
||||||
"Select next message with an attachment",
|
"Select next message with an attachment",
|
||||||
function (count) { mail.selectMessage(function (msg) gDBView.db.HasAttachments(msg.messageKey), true, true, false, count); },
|
function (args) { mail.selectMessage(function (msg) gDBView.db.HasAttachments(msg.messageKey), true, true, false, args.count); },
|
||||||
{ count: true });
|
{ count: true });
|
||||||
|
|
||||||
mappings.add(myModes, ["[a"],
|
mappings.add(myModes, ["[a"],
|
||||||
"Select previous message with an attachment",
|
"Select previous message with an attachment",
|
||||||
function (count) { mail.selectMessage(function (msg) gDBView.db.HasAttachments(msg.messageKey), true, true, true, count); },
|
function (args) { mail.selectMessage(function (msg) gDBView.db.HasAttachments(msg.messageKey), true, true, true, args.count); },
|
||||||
{ count: true });
|
{ count: true });
|
||||||
|
|
||||||
// FOLDER SWITCHING
|
// FOLDER SWITCHING
|
||||||
mappings.add(myModes, ["gi"],
|
mappings.add(myModes, ["gi"],
|
||||||
"Go to inbox",
|
"Go to inbox",
|
||||||
function (count) {
|
function (args) {
|
||||||
let folder = mail.getFolders("Inbox", false, true)[(count > 0) ? (count - 1) : 0];
|
let folder = mail.getFolders("Inbox", false, true)[(args.count > 0) ? (args.count - 1) : 0];
|
||||||
if (folder)
|
if (folder)
|
||||||
SelectFolder(folder.URI);
|
SelectFolder(folder.URI);
|
||||||
else
|
else
|
||||||
@@ -709,9 +709,8 @@ const Mail = Module("mail", {
|
|||||||
|
|
||||||
mappings.add(myModes, ["<C-n>"],
|
mappings.add(myModes, ["<C-n>"],
|
||||||
"Select next folder",
|
"Select next folder",
|
||||||
function (count) {
|
function (args) {
|
||||||
count = Math.max(1, count);
|
let newPos = this._getCurrentFolderIndex() + Math.max(1, args.count);
|
||||||
let newPos = this._getCurrentFolderIndex() + count;
|
|
||||||
if (newPos >= gFolderTreeView.rowCount) {
|
if (newPos >= gFolderTreeView.rowCount) {
|
||||||
newPos = newPos % gFolderTreeView.rowCount;
|
newPos = newPos % gFolderTreeView.rowCount;
|
||||||
commandline.echo("search hit BOTTOM, continuing at TOP", commandline.HL_WARNINGMSG, commandline.APPEND_TO_MESSAGES);
|
commandline.echo("search hit BOTTOM, continuing at TOP", commandline.HL_WARNINGMSG, commandline.APPEND_TO_MESSAGES);
|
||||||
@@ -722,16 +721,15 @@ const Mail = Module("mail", {
|
|||||||
|
|
||||||
mappings.add(myModes, ["<C-N>"],
|
mappings.add(myModes, ["<C-N>"],
|
||||||
"Go to next mailbox with unread messages",
|
"Go to next mailbox with unread messages",
|
||||||
function (count) {
|
function (args) {
|
||||||
this._selectUnreadFolder(false, count);
|
this._selectUnreadFolder(false, args.count);
|
||||||
},
|
},
|
||||||
{ count: true });
|
{ count: true });
|
||||||
|
|
||||||
mappings.add(myModes, ["<C-p>"],
|
mappings.add(myModes, ["<C-p>"],
|
||||||
"Select previous folder",
|
"Select previous folder",
|
||||||
function (count) {
|
function (args) {
|
||||||
count = Math.max(1, count);
|
let newPos = this._getCurrentFolderIndex() - Math.max(1, args.count);
|
||||||
let newPos = this._getCurrentFolderIndex() - count;
|
|
||||||
if (newPos < 0) {
|
if (newPos < 0) {
|
||||||
newPos = (newPos % gFolderTreeView.rowCount) + gFolderTreeView.rowCount;
|
newPos = (newPos % gFolderTreeView.rowCount) + gFolderTreeView.rowCount;
|
||||||
commandline.echo("search hit TOP, continuing at BOTTOM", commandline.HL_WARNINGMSG, commandline.APPEND_TO_MESSAGES);
|
commandline.echo("search hit TOP, continuing at BOTTOM", commandline.HL_WARNINGMSG, commandline.APPEND_TO_MESSAGES);
|
||||||
@@ -742,8 +740,8 @@ const Mail = Module("mail", {
|
|||||||
|
|
||||||
mappings.add(myModes, ["<C-P>"],
|
mappings.add(myModes, ["<C-P>"],
|
||||||
"Go to previous mailbox with unread messages",
|
"Go to previous mailbox with unread messages",
|
||||||
function (count) {
|
function (args) {
|
||||||
this._selectUnreadFolder(true, count);
|
this._selectUnreadFolder(true, args.count);
|
||||||
},
|
},
|
||||||
{ count: true });
|
{ count: true });
|
||||||
|
|
||||||
@@ -770,22 +768,22 @@ const Mail = Module("mail", {
|
|||||||
|
|
||||||
mappings.add(myModes, ["<C-i>"],
|
mappings.add(myModes, ["<C-i>"],
|
||||||
"Go forward",
|
"Go forward",
|
||||||
function (count) { if (count < 1) count = 1; while (count--) GoNextMessage(nsMsgNavigationType.forward, true); },
|
function ({ count }) { if (count < 1) count = 1; while (count--) GoNextMessage(nsMsgNavigationType.forward, true); },
|
||||||
{ count: true });
|
{ count: true });
|
||||||
|
|
||||||
mappings.add(myModes, ["<C-o>"],
|
mappings.add(myModes, ["<C-o>"],
|
||||||
"Go back",
|
"Go back",
|
||||||
function (count) { if (count < 1) count = 1; while (count--) GoNextMessage(nsMsgNavigationType.back, true); },
|
function ({ count }) { if (count < 1) count = 1; while (count--) GoNextMessage(nsMsgNavigationType.back, true); },
|
||||||
{ count: true });
|
{ count: true });
|
||||||
|
|
||||||
mappings.add(myModes, ["gg"],
|
mappings.add(myModes, ["gg"],
|
||||||
"Select first message",
|
"Select first message",
|
||||||
function (count) { if (count < 1) count = 1; while (count--) GoNextMessage(nsMsgNavigationType.firstMessage, true); },
|
function ({ count }) { if (count < 1) count = 1; while (count--) GoNextMessage(nsMsgNavigationType.firstMessage, true); },
|
||||||
{ count: true });
|
{ count: true });
|
||||||
|
|
||||||
mappings.add(myModes, ["G"],
|
mappings.add(myModes, ["G"],
|
||||||
"Select last message",
|
"Select last message",
|
||||||
function (count) { if (count < 1) count = 1; while (count--) GoNextMessage(nsMsgNavigationType.lastMessage, false); },
|
function ({ count }) { if (count < 1) count = 1; while (count--) GoNextMessage(nsMsgNavigationType.lastMessage, false); },
|
||||||
{ count: true });
|
{ count: true });
|
||||||
|
|
||||||
// tagging messages
|
// tagging messages
|
||||||
|
|||||||
Reference in New Issue
Block a user