Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option to change how much spacebar scrolls #143

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions pages/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ var defaultOptions = {
// Keyboard Settings
keyboardSupport : true, // option
arrowScroll : 50, // [px]
spaceScroll : 0.9, // decimal

// Other
touchpadSupport : true,
Expand Down
6 changes: 6 additions & 0 deletions pages/options.html
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,12 @@ <h2 style="margin-top:0;">Scroll Settings</h2>
<td class="default_value"><span style="color: #00CCFF; font-size: 12px;"> <i>Default value: 4</i></span></td>
<td class="note" title="it affects how long the decceleration part is">(<b>ratio </b>of "tail" to "acceleration")</td>
</tr>
<tr>
<td class="setting-name"><label for="spaceScroll" title="higher means more scrolling for each spacebar key press">Spacebar step size</label></td>
<td><input id="spaceScroll" type="text" size="1" maxlength="3"></td>
<td class="default_value"><span style="color: #00CCFF; font-size: 12px;"> <i>Default value: 0.9</i></span></td>
<td class="note" title="higher means more scrolling for each spacebar key press">(<b>how</b> much with spacebar)</td>
</tr>
<tr>
<td style="width:180px;"><label for="arrowScroll" title="higher means more scrolling for each arrow key press">Arrow key step size [px]</label></td>
<td><input id="arrowScroll" type="text" size="1" maxlength="3"> </td>
Expand Down
1 change: 1 addition & 0 deletions pages/options.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ var optionsList = [
'animationTime',
'stepSize',
'arrowScroll',
'spaceScroll',
'middleMouse',
'accelerationMax',
'accelerationDelta',
Expand Down
3 changes: 2 additions & 1 deletion src/sscr.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ var defaultOptions = {
// Keyboard Settings
keyboardSupport : true, // option
arrowScroll : 50, // [px]
spaceScroll : 0.9, // decimal

// Other
touchpadSupport : false,
Expand Down Expand Up @@ -427,7 +428,7 @@ function keydown(event) {
break;
case key.spacebar: // (+ shift)
shift = event.shiftKey ? 1 : -1;
y = -shift * clientHeight * 0.9;
y = -shift * clientHeight * options.spaceScroll;
break;
case key.pageup:
y = -clientHeight * 0.9;
Expand Down