Modifiers are keywords that you add to those definitions to change their meanings.
Questions tagged [modifiers]
74 questions
26
votes
2 answers
Difference between Keys.Shift and Keys.ShiftKey
In my application i detect when a key is pressed and see if the modifier is the shift key but the Keys enumerator has Shift and ShiftKey.
It seems the event is always sending Keys.Shift, but is there a case where the Keys.ShiftKey will be used?…

Brian Tacker
- 1,091
- 2
- 18
- 37
21
votes
6 answers
Can an overriding method have a different access specifier from that in the base class?
Which access modifier, in an abstract class, do I have to use for a method,
so the subclasses can decide whether it should be public or not? Is it possible to "override" a modifier in Java or not?
public abstract class A {
??? void…

jam
- 1,253
- 1
- 12
- 26
9
votes
4 answers
What is the opposite of c++ `override` / `final` specifier?
In c++11 the override specifier protects from not overriding an intended virtual base function (because the signatures do not match).
The final specifier protects from unintentionally overriding a function in a derived class.
=> Is there a…

Martin Hennings
- 16,418
- 9
- 48
- 68
8
votes
2 answers
Detecting Shift modifiers on MouseEvent generated from click in swing
I'm handling some MouseEvent in a GUI application using Java Swing.
Since now i was analyzing mouse events inside mousePressed method, only to determine if
a left or right click happened.
My code was:
public void mousePressed(MouseEvent me) {
…

Heisenbug
- 38,762
- 28
- 132
- 190
7
votes
2 answers
Matching printf Formatting with iomanip
I have some old C code I'm trying to replicate the behavior of in C++. It uses the printf modifiers: "%06.02f".
I naively thought that iomanip was just as capable, and did:
cout << setfill('0') << setw(6) << setprecision(2)
When I try to output the…

Jonathan Mee
- 37,899
- 23
- 129
- 288
5
votes
0 answers
Keybinding with more than one Key programmatically
The way to bind CTRL + S is
new KeyBinding( SaveCommand, Key.S, ModifierKeys.Control )
for CTRL +Shift + S is
new KeyBinding( SaveCommand, Key.S, ModifierKeys.Control | ModifierKeys.Shift)
But, how about CTRL +H + S?? Any suggestions?

maskalek
- 453
- 5
- 18
4
votes
1 answer
Remap modifiers key in vim
I had remapped my capslock to the hyper key as mod3 using xmodmap.
Here is the result of xmodmap
shift Shift_L (0x32), Shift_R (0x3e)
lock
control Control_L (0x25), Control_R (0x69)
mod1 Alt_L (0x40), Alt_R (0x6c), Meta_L…

deaddroid
- 410
- 2
- 12
4
votes
2 answers
Why is the modifier set to Friend in Winforms?
When adding a new control to the designer in Winforms, the modifier on the control is set to Friend, but the default modifier is Private (right clicking the property and resetting the modifier).
Does anyone know why?
Is there a setting to set the…

eflles
- 6,606
- 11
- 41
- 55
4
votes
6 answers
Java constants and static modifiers
In java, constants as known as keyword (final) with a value that will never change. I have seen some people create constants without declaring a static modifier. My question is, should constants be declared as a static? If so or if not, why?

TheDetailer
- 289
- 5
- 16
4
votes
1 answer
Error C2270: Modifiers not allowed on nonmember functions
I'm getting this error when compiling:
error C2270: 'busco' : modifiers not allowed on nonmember functions
I think I understand the reason but I don't know how to fix it, if I take the const out I get a C2662 error.
Here is the code:
template…

moondaisy
- 4,303
- 6
- 41
- 70
4
votes
1 answer
expresso store modifier
I am working on a shop for a florist. The bouquets sometimes come in more than one size. I would like to have the different sizes available in a dropdown menu (i.e. regular = £30, medium = £50, large = £70). I would like to set this field up as a…

Alissa J. Robinson
- 151
- 3
3
votes
2 answers
Using of "open" and "public"
I already read the documentation about the new modifiers "open" and "fileprivate". But there are two things that I don't understand:
Why is it not possible to declare protocols or extensions also as "open"? And does it mean that it's not possible…

altralaser
- 2,035
- 5
- 36
- 55
3
votes
1 answer
Regex modifiers in Webmethods
I am trying to use a regex pattern in Webmethods map step.
The problem is to ignore the case of matching string using regex modifiers.
E.g.:
input is 'TEST' or 'test' or 'Test'
Branch on 'input'
/test/i : MAP
But as I read on different…

Dev Utkarsh
- 1,377
- 2
- 18
- 43
2
votes
3 answers
"TypeError: can't convert String into Integer" when trying to CTRL+click or SHIFT+click in watir-webdriver/selenium-webdriver script
I am trying to select multiple items in a date picker defined as table, in a cucumber script using watir-webdriver/selenium-webdriver on Chrome browser.
The date picker allows Ctrl and Shift as modifiers.
This is the code for a cell:

GMD
- 698
- 5
- 12
2
votes
2 answers
Unexpected Behavior wrt the final modifier
This is my code
package alpha ;
class A1
{
static class A11
{
private
final // WHAT IS THE EFFECT OF THIS MODIFIER?
void fun ( String caller )
{
System . out . println ( "A11:\t" +…

emory
- 10,725
- 2
- 30
- 58