Input: 90% of max analog value while analog sticks setup.
This commit is contained in:
32
charrom.cpp
32
charrom.cpp
@@ -187,21 +187,21 @@ void LoadFont(char* name)
|
||||
for (int pos = start; pos < sz; pos += 8)
|
||||
{
|
||||
int n = 0;
|
||||
for (int i = 128; i != 0; i >>= 1)
|
||||
{
|
||||
unsigned char b = 0;
|
||||
if (tempfont[pos + 0] & i) b |= 1;
|
||||
if (tempfont[pos + 1] & i) b |= 2;
|
||||
if (tempfont[pos + 2] & i) b |= 4;
|
||||
if (tempfont[pos + 3] & i) b |= 8;
|
||||
if (tempfont[pos + 4] & i) b |= 16;
|
||||
if (tempfont[pos + 5] & i) b |= 32;
|
||||
if (tempfont[pos + 6] & i) b |= 64;
|
||||
if (tempfont[pos + 7] & i) b |= 128;
|
||||
|
||||
charfont[ch][n++] = b;
|
||||
}
|
||||
|
||||
ch++;
|
||||
for (int i = 128; i != 0; i >>= 1)
|
||||
{
|
||||
unsigned char b = 0;
|
||||
if (tempfont[pos + 0] & i) b |= 1;
|
||||
if (tempfont[pos + 1] & i) b |= 2;
|
||||
if (tempfont[pos + 2] & i) b |= 4;
|
||||
if (tempfont[pos + 3] & i) b |= 8;
|
||||
if (tempfont[pos + 4] & i) b |= 16;
|
||||
if (tempfont[pos + 5] & i) b |= 32;
|
||||
if (tempfont[pos + 6] & i) b |= 64;
|
||||
if (tempfont[pos + 7] & i) b |= 128;
|
||||
|
||||
charfont[ch][n++] = b;
|
||||
}
|
||||
|
||||
ch++;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1686,9 +1686,11 @@ static void input_cb(struct input_event *ev, struct input_absinfo *absinfo, int
|
||||
|
||||
if (ev->type == EV_ABS)
|
||||
{
|
||||
max = (ev->value == absinfo->maximum);
|
||||
min = (ev->value == absinfo->minimum);
|
||||
printf("min=%d,max=%d\n", min, max);
|
||||
int threshold = (absinfo->maximum - absinfo->minimum) / 10;
|
||||
|
||||
max = (ev->value >= (absinfo->maximum - threshold));
|
||||
min = (ev->value <= (absinfo->minimum + threshold));
|
||||
printf("threshold=%d, min=%d, max=%d\n", threshold, min, max);
|
||||
}
|
||||
|
||||
//check DPAD horz
|
||||
|
||||
Reference in New Issue
Block a user